File tree 2 files changed +30
-4
lines changed
lib/node_modules/@stdlib/stats/base/dists/t
2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -108,10 +108,23 @@ var y = dist.cdf( 0.5 );
108
108
<!-- eslint no-undef: "error" -->
109
109
110
110
``` javascript
111
- var objectKeys = require ( ' @stdlib/utils/keys' );
112
111
var t = require ( ' @stdlib/stats/base/dists/t' );
113
112
114
- console .log ( objectKeys ( t ) );
113
+ var dof = 3 ;
114
+ var x = 1.5 ;
115
+
116
+ // Evaluate the probability density function (PDF) at a specific value:
117
+ var res = t .pdf ( x, dof );
118
+ console .log ( ' PDF at x = ' + x + ' : ' + res );
119
+
120
+ // Evaluate the cumulative distribution function (CDF) at a specific value:
121
+ res = t .cdf ( x, dof );
122
+ console .log ( ' CDF at x = ' + x + ' : ' + res );
123
+
124
+ // Get the mean and variance of the t distribution:
125
+ var mu = t .mean ( dof );
126
+ var v = t .variance ( dof );
127
+ console .log ( ' Mean: ' + mu + ' , Variance: ' + v );
115
128
```
116
129
117
130
</section >
Original file line number Diff line number Diff line change 18
18
19
19
'use strict' ;
20
20
21
- var objectKeys = require ( '@stdlib/utils/keys' ) ;
22
21
var t = require ( './../lib' ) ;
23
22
24
- console . log ( objectKeys ( t ) ) ;
23
+ var dof = 3 ;
24
+ var x = 1.5 ;
25
+
26
+ // Evaluate the probability density function (PDF) at a specific value:
27
+ var res = t . pdf ( x , dof ) ;
28
+ console . log ( 'PDF at x = ' + x + ': ' + res ) ;
29
+
30
+ // Evaluate the cumulative distribution function (CDF) at a specific value:
31
+ res = t . cdf ( x , dof ) ;
32
+ console . log ( 'CDF at x = ' + x + ': ' + res ) ;
33
+
34
+ // Get the mean and variance of the t distribution:
35
+ var mu = t . mean ( dof ) ;
36
+ var v = t . variance ( dof ) ;
37
+ console . log ( 'Mean: ' + mu + ', Variance: ' + v ) ;
You can’t perform that action at this time.
0 commit comments