Skip to content

Commit 3f1f9a2

Browse files
fix: update file with requested changes
1 parent 7358300 commit 3f1f9a2

File tree

9 files changed

+120
-168
lines changed

9 files changed

+120
-168
lines changed

lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/median.h

Lines changed: 0 additions & 38 deletions
This file was deleted.

lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/median/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@license Apache-2.0
44
5-
Copyright (c) 2014 The Stdlib Authors.
5+
Copyright (c) 2018 The Stdlib Authors.
66
77
Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
@@ -184,7 +184,6 @@ The function accepts the following arguments:
184184
- **a**: `[in] double` shape parameter.
185185
- **b**: `[in] double` shape parameter.
186186

187-
188187
```c
189188
double stdlib_base_dists_kumaraswamy_median( const double a, const double b );
190189

@@ -214,10 +213,6 @@ double stdlib_base_dists_kumaraswamy_median( const double a, const double b );
214213
#include <stdlib.h>
215214
#include <stdio.h>
216215
217-
double stdlib_base_dists_kumaraswamy_median( const double a, const double b ) {
218-
return pow( 1.0 - pow( 0.5, 1.0 / b ), 1.0 / a );
219-
}
220-
221216
static double random_uniform( const double min, const double max ) {
222217
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
223218
return min + ( v * (max - min) );

lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/median/benchmark/c/benchmark.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ static double benchmark( void ) {
100100
int i;
101101

102102
for ( i = 0; i < 100; i++ ) {
103-
// Generate random parameters for Kumaraswamy distribution
104-
// Ensure parameters are positive and within reasonable ranges
105103
a[ i ] = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
106104
b[ i ] = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
107105
}
@@ -140,4 +138,4 @@ int main( void ) {
140138
printf( "ok %d benchmark finished\n", i+1 );
141139
}
142140
print_summary( REPEATS, REPEATS );
143-
}
141+
}

lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/median/lib/native.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var addon = require( './../src/addon.node' );
2828
/**
2929
* Returns the median of a Kumaraswamy distribution.
3030
*
31+
* @private
3132
* @param {number} a - shape parameter
3233
* @param {number} b - shape parameter
3334
* @returns {number} median
Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
11
{
2-
"options": {
2+
"options": {
3+
"task": "build",
4+
"wasm": false
5+
},
6+
"fields": [
7+
{
8+
"field": "src",
9+
"resolve": true,
10+
"relative": true
11+
},
12+
{
13+
"field": "include",
14+
"resolve": true,
15+
"relative": true
16+
},
17+
{
18+
"field": "libraries",
19+
"resolve": false,
20+
"relative": false
21+
},
22+
{
23+
"field": "libpath",
24+
"resolve": true,
25+
"relative": false
26+
}
27+
],
28+
"confs": [
29+
{
330
"task": "build",
4-
"wasm": false
31+
"wasm": false,
32+
"src": [
33+
"./src/main.c"
34+
],
35+
"include": [
36+
"./include"
37+
],
38+
"libraries": [],
39+
"libpath": [],
40+
"dependencies": [
41+
"@stdlib/math/base/napi/binary",
42+
"@stdlib/math/base/assert/is-nan",
43+
"@stdlib/constants/float64/eps"
44+
]
45+
},
46+
{
47+
"task": "benchmark",
48+
"wasm": false,
49+
"src": [
50+
"./src/main.c"
51+
],
52+
"include": [
53+
"./include"
54+
],
55+
"libraries": [],
56+
"libpath": [],
57+
"dependencies": [
58+
"@stdlib/math/base/assert/is-nan",
59+
"@stdlib/constants/float64/eps"
60+
]
561
},
6-
"fields": [
7-
{
8-
"field": "src",
9-
"resolve": true,
10-
"relative": true
11-
},
12-
{
13-
"field": "include",
14-
"resolve": true,
15-
"relative": true
16-
},
17-
{
18-
"field": "libraries",
19-
"resolve": false,
20-
"relative": false
21-
},
22-
{
23-
"field": "libpath",
24-
"resolve": true,
25-
"relative": false
26-
}
27-
],
28-
"confs": [
29-
{
30-
"task": "build",
31-
"wasm": false,
32-
"src": [
33-
"./src/main.c"
34-
],
35-
"include": [
36-
"./include"
37-
],
38-
"libraries": [],
39-
"libpath": [],
40-
"dependencies": [
41-
"@stdlib/math/base/napi/binary",
42-
"@stdlib/math/base/assert/is-nan"
43-
]
44-
},
45-
{
46-
"task": "benchmark",
47-
"wasm": false,
48-
"src": [
49-
"./src/main.c"
50-
],
51-
"include": [
52-
"./include"
53-
],
54-
"libraries": [],
55-
"libpath": [],
56-
"dependencies": [
57-
"@stdlib/math/base/assert/is-nan",
58-
"@stdlib/constants/float64/eps"
59-
]
60-
},
61-
{
62-
"task": "examples",
63-
"wasm": false,
64-
"src": [
65-
"./src/main.c"
66-
],
67-
"include": [
68-
"./include"
69-
],
70-
"libraries": [],
71-
"libpath": [],
72-
"dependencies": [
73-
"@stdlib/math/base/assert/is-nan",
74-
"@stdlib/constants/float64/eps"
75-
]
76-
}
77-
]
78-
}
79-
62+
{
63+
"task": "examples",
64+
"wasm": false,
65+
"src": [
66+
"./src/main.c"
67+
],
68+
"include": [
69+
"./include"
70+
],
71+
"libraries": [],
72+
"libpath": [],
73+
"dependencies": [
74+
"@stdlib/math/base/assert/is-nan",
75+
"@stdlib/constants/float64/eps"
76+
]
77+
}
78+
]
79+
}
Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@stdlib/stats/base/dists/kumaraswamy/median",
3-
"version": "0.0.1",
4-
"description": "Kumaraswamy distribution median.",
2+
"name": "@stdlib/stats/base/dists/kumaraswamy",
3+
"version": "0.0.0",
4+
"description": "Kumaraswamy's double bounded distribution.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",
@@ -13,24 +13,15 @@
1313
"url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
1414
}
1515
],
16-
"main": "./lib/main.js",
17-
"gypfile": true,
16+
"main": "./lib",
1817
"directories": {
19-
"benchmark": "./benchmark",
2018
"doc": "./docs",
2119
"example": "./examples",
22-
"include": "./include",
2320
"lib": "./lib",
24-
"src": "./src",
2521
"test": "./test"
2622
},
27-
"types": "./docs/types/index.d.ts",
28-
"scripts": {
29-
"build": "gcc -I./include -o lib/main src/main.c",
30-
"test": "node test/test.js",
31-
"benchmark": "node benchmark/benchmark.js",
32-
"lint": "eslint ."
33-
},
23+
"types": "./docs/types",
24+
"scripts": {},
3425
"homepage": "https://github.com/stdlib-js/stdlib",
3526
"repository": {
3627
"type": "git",
@@ -39,15 +30,11 @@
3930
"bugs": {
4031
"url": "https://github.com/stdlib-js/stdlib/issues"
4132
},
42-
"dependencies": {
43-
"mathjs": "^11.5.0"
44-
},
45-
"devDependencies": {
46-
"eslint": "^8.0.0"
47-
},
33+
"dependencies": {},
34+
"devDependencies": {},
4835
"engines": {
49-
"node": ">=12.0.0",
50-
"npm": ">=6.0.0"
36+
"node": ">=0.10.0",
37+
"npm": ">2.7.0"
5138
},
5239
"os": [
5340
"aix",
@@ -63,13 +50,19 @@
6350
"keywords": [
6451
"stdlib",
6552
"stdmath",
53+
"standard",
54+
"library",
55+
"std",
56+
"lib",
6657
"statistics",
6758
"stats",
59+
"probability",
60+
"prob",
6861
"distribution",
6962
"dist",
70-
"continuous",
7163
"kumaraswamy",
72-
"median",
73-
"univariate"
64+
"bounded",
65+
"univariate",
66+
"continuous"
7467
]
7568
}

lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/median/src/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "stdlib/math/base/assert/is_nan.h"
2121
#include <math.h>
2222

23-
2423
/**
2524
* Returns the median of a Kumaraswamy distribution.
2625
*

lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/median/test/fixtures/julia/runner.jl

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,38 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818

19-
import Distributions: var, Geometric
19+
import Distributions: median, Kumaraswamy
2020
import JSON
2121

2222
"""
23-
gen( p, name )
23+
gen( a, b, name )
2424
2525
Generate fixture data and write to file.
2626
2727
# Arguments
2828
29-
* `x`: input value
30-
* `p`: success probability
29+
* `a`: shape parameter a (must be positive)
30+
* `b`: shape parameter b (must be positive)
3131
* `name::AbstractString`: output filename
3232
3333
# Examples
3434
3535
``` julia
36-
julia> p = rand( 1000 );
37-
julia> gen( p, \"data.json\" );
36+
julia> a = rand( 1000 );
37+
julia> b = rand( 1000 );
38+
julia> gen( a, b, \"data.json\" );
3839
```
3940
"""
40-
function gen( p, name )
41-
z = Array{Float64}( undef, length(p) );
42-
for i in eachindex(p)
43-
z[ i ] = var( Geometric( p[ i ] ) );
41+
function gen( a, b, name )
42+
z = Array{Float64}( undef, length(a) );
43+
for i in eachindex(a)
44+
z[ i ] = median( Kumaraswamy( a[ i ], b[ i ] ) );
4445
end
4546

4647
# Store data to be written to file as a collection:
4748
data = Dict([
48-
("p", p),
49+
("a", a),
50+
("b", b),
4951
("expected", z)
5052
]);
5153

@@ -66,6 +68,6 @@ file = @__FILE__;
6668
dir = dirname( file );
6769

6870
# Generate fixtures:
69-
p = rand( 1000 );
70-
gen( p, "data.json" );
71-
71+
a = rand( 1000 );
72+
b = rand( 1000 );
73+
gen( a, b, "data.json" );

0 commit comments

Comments
 (0)