Skip to content

Commit 82b1762

Browse files
committed
Auto-generated commit
1 parent bf208a6 commit 82b1762

File tree

17 files changed

+479
-136
lines changed

17 files changed

+479
-136
lines changed

CHANGELOG.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,37 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-03-30)
7+
## Unreleased (2025-06-13)
8+
9+
<section class="features">
10+
11+
### Features
12+
13+
- [`33266af`](https://github.com/stdlib-js/stdlib/commit/33266af98fc620c8fdcc2fa9a9624b776b5f8f9b) - refactor and add protocol support to `stats/base/stdevpn` [(#6225)](https://github.com/stdlib-js/stdlib/pull/6225)
14+
15+
</section>
16+
17+
<!-- /.features -->
18+
19+
<section class="issues">
20+
21+
### Closed Issues
22+
23+
This release closes the following issue:
24+
25+
[#5683](https://github.com/stdlib-js/stdlib/issues/5683)
26+
27+
</section>
28+
29+
<!-- /.issues -->
830

931
<section class="commits">
1032

1133
### Commits
1234

1335
<details>
1436

37+
- [`33266af`](https://github.com/stdlib-js/stdlib/commit/33266af98fc620c8fdcc2fa9a9624b776b5f8f9b) - **feat:** refactor and add protocol support to `stats/base/stdevpn` [(#6225)](https://github.com/stdlib-js/stdlib/pull/6225) _(by Amisha Chhajed, Athan Reines, Gururaj Gurram, stdlib-bot)_
1538
- [`8e9e556`](https://github.com/stdlib-js/stdlib/commit/8e9e556cbd76873f3418d4b999f1c2f125282a0d) - **refactor:** update paths _(by Aayush Khanna)_
1639
- [`4df836a`](https://github.com/stdlib-js/stdlib/commit/4df836acfee5e6f359fc5d15a31ee9f6ef4237f0) - **refactor:** update paths _(by Aayush Khanna)_
1740

@@ -25,9 +48,12 @@
2548

2649
### Contributors
2750

28-
A total of 1 person contributed to this release. Thank you to this contributor:
51+
A total of 4 people contributed to this release. Thank you to the following contributors:
2952

3053
- Aayush Khanna
54+
- Amisha Chhajed
55+
- Athan Reines
56+
- Gururaj Gurram
3157

3258
</section>
3359

CONTRIBUTORS

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ AlyAbdelmoneim <[email protected]>
2222
Aman Bhansali <[email protected]>
2323
AmanBhadkariya <[email protected]>
2424
Amit Jimiwal <[email protected]>
25+
Annamalai Prabu <[email protected]>
2526
Anshu Kumar <[email protected]>
2627
Anshu Kumar <[email protected]>
2728
Anudeep Sanapala <[email protected]>
@@ -38,27 +39,33 @@ Daniel Killenberger <[email protected]>
3839
Daniel Yu <[email protected]>
3940
Debashis Maharana <[email protected]>
4041
Deep Trivedi <[email protected]>
42+
Deepak Singh <[email protected]>
4143
Desh Deepak Kant <[email protected]>
4244
4345
Dhanyabad behera <[email protected]>
4446
Dhruv Arvind Singh <[email protected]>
4547
Dhruvil Mehta <[email protected]>
48+
Dipjyoti Das <[email protected]>
4649
Divyansh Seth <[email protected]>
4750
Dominic Lim <[email protected]>
4851
Dominik Moritz <[email protected]>
4952
Dorrin Sotoudeh <[email protected]>
5053
EuniceSim142 <[email protected]>
5154
Frank Kovacs <[email protected]>
5255
GK Bishnoi <[email protected]>
56+
GURU PRASAD SHARMA <[email protected]>
5357
58+
Gautam Kaushik <[email protected]>
5459
Gautam sharma <[email protected]>
60+
Girish Garg <[email protected]>
5561
Golden Kumar <[email protected]>
5662
Gunj Joshi <[email protected]>
5763
Gururaj Gurram <[email protected]>
5864
Haroon Rasheed <[email protected]>
59-
Harsh <[email protected].com>
65+
Harsh <harshyadav6078@gmail.com>
6066
6167
Harshita Kalani <[email protected]>
68+
Hemang Choudhary <[email protected]>
6269
Hemant M Mehta <[email protected]>
6370
Hridyanshu <[email protected]>
6471
Jaimin Godhani <[email protected]>
@@ -75,16 +82,20 @@ Jordan Gallivan <[email protected]>
7582
Joris Labie <[email protected]>
7683
Justin Dennison <[email protected]>
7784
Justyn Shelby <[email protected]>
78-
Karan Anand <[email protected]>
85+
Karan Anand <[email protected]>
86+
Karan Vasudevamurthy <[email protected]>
87+
Karan Yadav <[email protected]>
7988
Karthik Prakash <[email protected]>
8089
Kaushikgtm <[email protected]>
8190
Kavyansh-Bagdi <[email protected]>
8291
Kohantika Nath <[email protected]>
8392
Krishnam Agarwal <[email protected]>
8493
Krishnendu Das <[email protected]>
8594
Kshitij-Dale <[email protected]>
95+
Lalit Narayan Yadav <[email protected]>
8696
Lovelin Dhoni J B <[email protected]>
8797
98+
Mahfuza Humayra Mohona <[email protected]>
8899
Manik Sharma <[email protected]>
89100
Manvith M <[email protected]>
90101
Marcus Fantham <[email protected]>
@@ -95,24 +106,31 @@ Mohammad Bin Aftab <[email protected]>
95106
Mohammad Kaif <[email protected]>
96107
Momtchil Momtchev <[email protected]>
97108
Muhammad Haris <[email protected]>
109+
Muhammad Taaha Tariq <[email protected]>
110+
Muhmmad Saad <[email protected]>
98111
Naresh Jagadeesan <[email protected]>
99112
Naveen Kumar <[email protected]>
100113
Neeraj Pathak <[email protected]>
114+
NirvedMishra <[email protected]>
101115
Nishant Shinde <[email protected]>
116+
Nishant singh <[email protected]>
102117
Nishchay Rajput <[email protected]>
103118
Nithin Katta <[email protected]>
104119
Nourhan Hasan <[email protected]>
105120
Ognjen Jevremović <[email protected]>
106121
Oneday12323 <[email protected]>
107122
Ori Miles <[email protected]>
108123
Philipp Burckhardt <[email protected]>
124+
Pierre Forstmann <[email protected]>
109125
Prajjwal Bajpai <[email protected]>
110126
Prajwal Kulkarni <[email protected]>
111127
Pranav Goswami <[email protected]>
112128
Pranjal Jha <[email protected]>
113129
Prashant Kumar Yadav <[email protected]>
130+
PrathamBhamare <[email protected]>
114131
Pratik Singh <[email protected]>
115132
Pratyush Kumar Chouhan <[email protected]>
133+
Pravesh Kunwar <[email protected]>
116134
Priyansh Prajapati <[email protected]>
117135
Priyanshu Agarwal <[email protected]>
118136
Pulkit Gupta <[email protected]>
@@ -126,12 +144,16 @@ Rishav <[email protected]>
126144
Rishav Tarway <[email protected]>
127145
Robert Gislason <[email protected]>
128146
Roman Stetsyk <[email protected]>
147+
129148
Rutam Kathale <[email protected]>
130149
Ruthwik Chikoti <[email protected]>
131150
Ryan Seal <[email protected]>
132151
Rylan Yang <[email protected]>
133152
SAHIL KUMAR <[email protected]>
134153
SHIVAM YADAV <[email protected]>
154+
Sachin Raj <[email protected]>
155+
Sahil Goyal <[email protected]>
156+
Sai Avinash <[email protected]>
135157
Sai Srikar Dumpeti <[email protected]>
136158
Sanchay Ketan Sinha <[email protected]>
137159
Sarthak Paandey <[email protected]>
@@ -150,14 +172,19 @@ Spandan Barve <[email protected]>
150172
Stephannie Jiménez Gacha <[email protected]>
151173
Suhaib Ilahi <[email protected]>
152174
Suraj Kumar <[email protected]>
175+
Swapnil Hajare <[email protected]>
153176
Tanishq Ahuja <[email protected]>
154177
Tirtadwipa Manunggal <[email protected]>
155178
Tudor Pagu <[email protected]>
156179
Tufailahmed Bargir <[email protected]>
180+
Tushar Bhardwaj <[email protected]>
181+
Uday Kakade <[email protected]>
182+
Ujjwal Kirti <[email protected]>
157183
Utkarsh <http://[email protected]>
158184
Utkarsh Raj <[email protected]>
159185
UtkershBasnet <[email protected]>
160186
Vaibhav Patel <[email protected]>
187+
Vara Rahul Rajana <[email protected]>
161188
Varad Gupta <[email protected]>
162189
Vinit Pandit <[email protected]>
163190
Vivek Maurya <[email protected]>
@@ -166,11 +193,15 @@ Yaswanth Kosuru <[email protected]>
166193
Yernar Yergaziyev <[email protected]>
167194
Yugal Kaushik <[email protected]>
168195
Yuvi Mittal <[email protected]>
196+
devshree-bhati <[email protected]>
169197
170198
ekambains <[email protected]>
171199
fadiothman22 <[email protected]>
200+
iraandrushko <[email protected]>
201+
lohithganni <[email protected]>
172202
olenkabilonizhka <[email protected]>
173203
pranav-1720 <[email protected]>
174204
rahulrangers <[email protected]>
175205
176206
207+

README.md

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ To view installation and usage instructions specific to each branch build, be su
131131
var stdevpn = require( '@stdlib/stats-base-stdevpn' );
132132
```
133133

134-
#### stdevpn( N, correction, x, stride )
134+
#### stdevpn( N, correction, x, strideX )
135135

136-
Computes the [standard deviation][standard-deviation] of a strided array `x` using a two-pass algorithm.
136+
Computes the [standard deviation][standard-deviation] of a strided array using a two-pass algorithm.
137137

138138
```javascript
139139
var x = [ 1.0, -2.0, 2.0 ];
@@ -147,17 +147,14 @@ The function has the following parameters:
147147
- **N**: number of indexed elements.
148148
- **correction**: degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
149149
- **x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
150-
- **stride**: index increment for `x`.
150+
- **strideX**: stride length for `x`.
151151

152-
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`,
152+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`,
153153

154154
```javascript
155-
var floor = require( '@stdlib/math-base-special-floor' );
156-
157155
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ];
158-
var N = floor( x.length / 2 );
159156

160-
var v = stdevpn( N, 1, x, 2 );
157+
var v = stdevpn( 4, 1, x, 2 );
161158
// returns 2.5
162159
```
163160

@@ -167,18 +164,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [
167164

168165
```javascript
169166
var Float64Array = require( '@stdlib/array-float64' );
170-
var floor = require( '@stdlib/math-base-special-floor' );
171167

172168
var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
173169
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
174170

175-
var N = floor( x0.length / 2 );
176-
177-
var v = stdevpn( N, 1, x1, 2 );
171+
var v = stdevpn( 4, 1, x1, 2 );
178172
// returns 2.5
179173
```
180174

181-
#### stdevpn.ndarray( N, correction, x, stride, offset )
175+
#### stdevpn.ndarray( N, correction, x, strideX, offsetX )
182176

183177
Computes the [standard deviation][standard-deviation] of a strided array using a two-pass algorithm and alternative indexing semantics.
184178

@@ -191,17 +185,14 @@ var v = stdevpn.ndarray( x.length, 1, x, 1, 0 );
191185

192186
The function has the following additional parameters:
193187

194-
- **offset**: starting index for `x`.
188+
- **offsetX**: starting index for `x`.
195189

196-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other value in `x` starting from the second value
190+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the [standard deviation][standard-deviation] for every other element in the strided array starting from the second element
197191

198192
```javascript
199-
var floor = require( '@stdlib/math-base-special-floor' );
200-
201193
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];
202-
var N = floor( x.length / 2 );
203194

204-
var v = stdevpn.ndarray( N, 1, x, 2, 1 );
195+
var v = stdevpn.ndarray( 4, 1, x, 2, 1 );
205196
// returns 2.5
206197
```
207198

@@ -215,6 +206,7 @@ var v = stdevpn.ndarray( N, 1, x, 2, 1 );
215206

216207
- If `N <= 0`, both functions return `NaN`.
217208
- If `N - c` is less than or equal to `0` (where `c` corresponds to the provided degrees of freedom adjustment), both functions return `NaN`.
209+
- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array-base/accessor`][@stdlib/array/base/accessor]).
218210
- Depending on the environment, the typed versions ([`dstdevpn`][@stdlib/stats/strided/dstdevpn], [`sstdevpn`][@stdlib/stats/strided/sstdevpn], etc.) are likely to be significantly more performant.
219211

220212
</section>
@@ -228,18 +220,12 @@ var v = stdevpn.ndarray( N, 1, x, 2, 1 );
228220
<!-- eslint no-undef: "error" -->
229221

230222
```javascript
231-
var randu = require( '@stdlib/random-base-randu' );
232-
var round = require( '@stdlib/math-base-special-round' );
233-
var Float64Array = require( '@stdlib/array-float64' );
223+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
234224
var stdevpn = require( '@stdlib/stats-base-stdevpn' );
235225

236-
var x;
237-
var i;
238-
239-
x = new Float64Array( 10 );
240-
for ( i = 0; i < x.length; i++ ) {
241-
x[ i ] = round( (randu()*100.0) - 50.0 );
242-
}
226+
var x = discreteUniform( 10, -50, 50, {
227+
'dtype': 'float64'
228+
});
243229
console.log( x );
244230

245231
var v = stdevpn( x.length, 1, x, 1 );
@@ -359,6 +345,8 @@ Copyright &copy; 2016-2025. The Stdlib [Authors][stdlib-authors].
359345

360346
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
361347

348+
[@stdlib/array/base/accessor]: https://github.com/stdlib-js/array-base-accessor
349+
362350
[@stdlib/stats/strided/dstdevpn]: https://github.com/stdlib-js/stats-strided-dstdevpn
363351

364352
[@stdlib/stats/strided/sstdevpn]: https://github.com/stdlib-js/stats-strided-sstdevpn

benchmark/benchmark.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,20 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench-harness' );
24-
var randu = require( '@stdlib/random-base-randu' );
24+
var uniform = require( '@stdlib/random-array-uniform' );
2525
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2626
var pow = require( '@stdlib/math-base-special-pow' );
2727
var pkg = require( './../package.json' ).name;
2828
var stdevpn = require( './../lib/stdevpn.js' );
2929

3030

31+
// VARIABLES //
32+
33+
var options = {
34+
'dtype': 'generic'
35+
};
36+
37+
3138
// FUNCTIONS //
3239

3340
/**
@@ -38,13 +45,7 @@ var stdevpn = require( './../lib/stdevpn.js' );
3845
* @returns {Function} benchmark function
3946
*/
4047
function createBenchmark( len ) {
41-
var x;
42-
var i;
43-
44-
x = [];
45-
for ( i = 0; i < len; i++ ) {
46-
x.push( ( randu()*20.0 ) - 10.0 );
47-
}
48+
var x = uniform( len, -10, 10, options );
4849
return benchmark;
4950

5051
function benchmark( b ) {

benchmark/benchmark.ndarray.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,20 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench-harness' );
24-
var randu = require( '@stdlib/random-base-randu' );
24+
var uniform = require( '@stdlib/random-array-uniform' );
2525
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2626
var pow = require( '@stdlib/math-base-special-pow' );
2727
var pkg = require( './../package.json' ).name;
2828
var stdevpn = require( './../lib/ndarray.js' );
2929

3030

31+
// VARIABLES //
32+
33+
var options = {
34+
'dtype': 'generic'
35+
};
36+
37+
3138
// FUNCTIONS //
3239

3340
/**
@@ -38,13 +45,7 @@ var stdevpn = require( './../lib/ndarray.js' );
3845
* @returns {Function} benchmark function
3946
*/
4047
function createBenchmark( len ) {
41-
var x;
42-
var i;
43-
44-
x = [];
45-
for ( i = 0; i < len; i++ ) {
46-
x.push( ( randu()*20.0 ) - 10.0 );
47-
}
48+
var x = uniform( len, -10, 10, options );
4849
return benchmark;
4950

5051
function benchmark( b ) {

0 commit comments

Comments
 (0)