Skip to content

Commit 9cd6feb

Browse files
committed
docs: update README with C API documentation
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 5cf144f commit 9cd6feb

File tree

1 file changed

+102
-0
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/hypergeometric/kurtosis

1 file changed

+102
-0
lines changed

lib/node_modules/@stdlib/stats/base/dists/hypergeometric/kurtosis/README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,108 @@ for ( i = 0; i < 10; i++ ) {
147147

148148
<!-- /.examples -->
149149

150+
<!-- C interface documentation. -->
151+
152+
* * *
153+
154+
<section class="c">
155+
156+
## C APIs
157+
158+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
159+
160+
<section class="intro">
161+
162+
</section>
163+
164+
<!-- /.intro -->
165+
166+
<!-- C usage documentation. -->
167+
168+
<section class="usage">
169+
170+
### Usage
171+
172+
```c
173+
#include "stdlib/stats/base/dists/hypergeometric/kurtosis.h"
174+
```
175+
176+
#### stdlib_base_dists_hypergeometric_kurtosis( N, K, n )
177+
178+
Returns the excess kurtosis of a hypergeometric distribution.
179+
180+
```c
181+
double out = stdlib_base_dists_hypergeometric_kurtosis( 16, 11, 4 );
182+
// returns ~-0.326
183+
```
184+
185+
The function accepts the following arguments:
186+
187+
- **N**: `[in] double` population size.
188+
- **K**: `[in] double` subpopulation size.
189+
- **n**: `[in] double` number of draws.
190+
191+
```c
192+
double stdlib_base_dists_hypergeometric_kurtosis( const double N, const double K, const double n );
193+
```
194+
195+
</section>
196+
197+
<!-- /.usage -->
198+
199+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
200+
201+
<section class="notes">
202+
203+
</section>
204+
205+
<!-- /.notes -->
206+
207+
<!-- C API usage examples. -->
208+
209+
<section class="examples">
210+
211+
### Examples
212+
213+
```c
214+
#include "stdlib/stats/base/dists/hypergeometric/kurtosis.h"
215+
#include "stdlib/math/base/special/round.h"
216+
#include <stdlib.h>
217+
#include <stdio.h>
218+
219+
static double random_uniform( const double min, const double max ) {
220+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
221+
return min + ( v*(max-min) );
222+
}
223+
224+
int main( void ) {
225+
double N;
226+
double K;
227+
double n;
228+
double kurtosis;
229+
int i;
230+
231+
for ( i = 0; i < 10; i++ ) {
232+
N = stdlib_base_round(random_uniform(0.0, 20.0));
233+
K = stdlib_base_round(random_uniform(0.0, N));
234+
n = stdlib_base_round(random_uniform(0.0, K));
235+
kurtosis = stdlib_base_dists_hypergeometric_kurtosis( N, K, n );
236+
237+
printf( "N: %lf, K: %lf, n: %lf, Kurtosis: %lf\n", N, K, n, kurtosis );
238+
}
239+
240+
return 0;
241+
}
242+
```
243+
244+
</section>
245+
246+
<!-- /.examples -->
247+
248+
</section>
249+
250+
<!-- /.c -->
251+
150252
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
151253

152254
<section class="references">

0 commit comments

Comments
 (0)