You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contributing/FAQ.md
-18Lines changed: 0 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,6 @@ limitations under the License.
31
31
-[What should I do if JavaScript linting on my commits fails because my function exceeds the maximum permissible number of parameters?](#max-params)
32
32
-[I have opened a pull request, where can I seek feedback?](#pr-feedback)
33
33
-[I need to generate fixtures for my tests. How can I do that, and what are the best references for inspiration?](#generate-fixtures)
34
-
-[I am facing a `Shadowed declaration` linting error in my C files, how can I fix it?](#shadowed-declaration)
35
34
-[I am facing a `Uninitialized variable` linting error in my C files, how can I fix it?](#uninitialized-variable)
36
35
-[I have the required packages in the expected paths, but I am still encountering an error like this while compiling the native add-on.](#compilation-error)
37
36
-[When should I use decimals in examples, benchmarks, and documentation, and when should I avoid them?](#decimal-usage)
@@ -145,23 +144,6 @@ Consider joining our [Gitter channel][stdlib-gitter]! We are proud to have a ver
145
144
146
145
Tests are a crucial part of any standard library package. We take our goal of achieving 100% test coverage very seriously and expect your work to be backed by tests. Often, you may need to generate fixtures to validate your implementation against an existing reliable source. You can use Julia, R, Python, or other languages to generate fixtures. To see how we do this, refer to these example scripts: [Python fixture script][python-fixtures], [Julia fixture script][julia-fixtures].
147
146
148
-
<aname="shadowed-declaration"></a>
149
-
150
-
## I am facing a `Shadowed declaration` linting error in my C files, how can I fix it?
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/stats/base/meanpn/README.md
+20-35Lines changed: 20 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
@license Apache-2.0
4
4
5
-
Copyright (c) 2020 The Stdlib Authors.
5
+
Copyright (c) 2025 The Stdlib Authors.
6
6
7
7
Licensed under the Apache License, Version 2.0 (the "License");
8
8
you may not use this file except in compliance with the License.
@@ -51,33 +51,28 @@ The [arithmetic mean][arithmetic-mean] is defined as
51
51
var meanpn =require( '@stdlib/stats/base/meanpn' );
52
52
```
53
53
54
-
#### meanpn( N, x, stride )
54
+
#### meanpn( N, x, strideX )
55
55
56
-
Computes the [arithmetic mean][arithmetic-mean] of a strided array `x`using a two-pass error correction algorithm.
56
+
Computes the [arithmetic mean][arithmetic-mean] of a strided array using a two-pass error correction algorithm.
57
57
58
58
```javascript
59
59
var x = [ 1.0, -2.0, 2.0 ];
60
-
varN=x.length;
61
60
62
-
var v =meanpn( N, x, 1 );
61
+
var v =meanpn( x.length, x, 1 );
63
62
// returns ~0.3333
64
63
```
65
64
66
65
The function has the following parameters:
67
66
68
67
-**N**: number of indexed elements.
69
68
-**x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
70
-
-**stride**: index increment for `x`.
69
+
-**strideX**: stride length for `x`.
71
70
72
-
The `N` and `stride` parameters determine which elements in `x`are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`,
71
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in the input array
73
72
74
73
```javascript
75
-
var floor =require( '@stdlib/math/base/special/floor' );
76
-
77
74
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ];
78
-
varN=floor( x.length/2 );
79
-
80
-
var v =meanpn( N, x, 2 );
75
+
var v =meanpn( 4, x, 2 );
81
76
// returns 1.25
82
77
```
83
78
@@ -87,42 +82,35 @@ Note that indexing is relative to the first index. To introduce an offset, use [
var x1 =newFloat64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
94
88
95
-
varN=floor( x0.length/2 );
96
-
97
-
var v =meanpn( N, x1, 2 );
89
+
var v =meanpn( 4, x1, 2 );
98
90
// returns 1.25
99
91
```
100
92
101
-
#### meanpn.ndarray( N, x, stride, offset )
93
+
#### meanpn.ndarray( N, x, strideX, offsetX )
102
94
103
95
Computes the [arithmetic mean][arithmetic-mean] of a strided array using a two-pass error correction algorithm and alternative indexing semantics.
104
96
105
97
```javascript
106
98
var x = [ 1.0, -2.0, 2.0 ];
107
-
varN=x.length;
108
99
109
-
var v =meanpn.ndarray( N, x, 1, 0 );
100
+
var v =meanpn.ndarray( x.length, x, 1, 0 );
110
101
// returns ~0.33333
111
102
```
112
103
113
104
The function has the following additional parameters:
114
105
115
-
-**offset**: starting index for `x`.
106
+
-**offsetX**: starting index for `x`.
116
107
117
-
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 [arithmetic mean][arithmetic-mean] for every other value in `x`starting from the second value
108
+
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 [arithmetic mean][arithmetic-mean] for every other element in the strided array starting from the second element
118
109
119
110
```javascript
120
-
var floor =require( '@stdlib/math/base/special/floor' );
121
-
122
111
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];
123
-
varN=floor( x.length/2 );
124
112
125
-
var v =meanpn.ndarray( N, x, 2, 1 );
113
+
var v =meanpn.ndarray( 4, x, 2, 1 );
126
114
// returns 1.25
127
115
```
128
116
@@ -135,6 +123,7 @@ var v = meanpn.ndarray( N, x, 2, 1 );
135
123
## Notes
136
124
137
125
- If `N <= 0`, both functions return `NaN`.
126
+
- 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]).
138
127
- Depending on the environment, the typed versions ([`dmeanpn`][@stdlib/stats/base/dmeanpn], [`smeanpn`][@stdlib/stats/base/smeanpn], etc.) are likely to be significantly more performant.
139
128
140
129
</section>
@@ -148,18 +137,12 @@ var v = meanpn.ndarray( N, x, 2, 1 );
148
137
<!-- eslint no-undef: "error" -->
149
138
150
139
```javascript
151
-
var randu =require( '@stdlib/random/base/randu' );
152
-
var round =require( '@stdlib/math/base/special/round' );
0 commit comments