|
1 | 1 | $(function() {
|
2 | 2 | var betaInst = jStat.beta( 3, 4 );
|
3 |
| - $.plot( '#betadiv', [ |
4 |
| - { |
5 |
| - data : jStat.seq( 0, 1, 101, function( x ) { return [ x, betaInst.pdf( x )];}), |
6 |
| - label : 'PDF' |
7 |
| - },{ |
8 |
| - data : jStat.seq( 0, 1, 101, function( x ) { return [ x, betaInst.cdf( x )];}), |
9 |
| - label : 'CDF', |
10 |
| - yaxis : 2 |
11 |
| - }],{ |
| 3 | + j$.plot( '#betadiv', [{ |
| 4 | + data : betaInst.pdf, |
| 5 | + label : 'PDF' |
| 6 | + },{ |
| 7 | + data : betaInst.cdf, |
| 8 | + label : 'CDF', |
| 9 | + yaxis : 2 |
| 10 | + }],{ |
| 11 | + flotopts : { |
12 | 12 | yaxes : [{}, { position : 'right' }]
|
| 13 | + } |
13 | 14 | });
|
14 | 15 |
|
15 | 16 | var cauchyInst = jStat.cauchy( 3, 4 );
|
16 |
| - $.plot( '#cauchydiv', [ |
17 |
| - { |
18 |
| - data : jStat.seq( -20, 20, 101, function( x ) { return [ x, cauchyInst.pdf( x )];}), |
19 |
| - label : 'PDF' |
20 |
| - },{ |
21 |
| - data : jStat.seq( -20, 20, 101, function( x ) { return [ x, cauchyInst.cdf( x )];}), |
22 |
| - label : 'CDF', |
23 |
| - yaxis : 2 |
24 |
| - }],{ |
| 17 | + j$.plot( '#cauchydiv', [{ |
| 18 | + data : cauchyInst.pdf, |
| 19 | + label : 'PDF' |
| 20 | + },{ |
| 21 | + data : cauchyInst.cdf, |
| 22 | + label : 'CDF', |
| 23 | + yaxis : 2 |
| 24 | + }],{ |
| 25 | + start : -20, |
| 26 | + stop : 20, |
| 27 | + flotopts : { |
25 | 28 | yaxes : [{}, { position : 'right' }]
|
| 29 | + } |
26 | 30 | });
|
27 | 31 |
|
28 | 32 | var stInst = jStat.studentt( 4 );
|
29 |
| - $.plot( '#studenttdiv', [ |
30 |
| - { |
31 |
| - data : jStat.seq( -6, 6, 101, function( x ) { return [ x, stInst.pdf( x, 4 )];}), |
32 |
| - label : 'PDF' |
33 |
| - },{ |
34 |
| - data : jStat.seq( -6, 6, 101, function( x ) { return [ x, stInst.cdf( x, 4 )];}), |
35 |
| - label : 'CDF', |
36 |
| - yaxis : 2 |
37 |
| - }],{ |
| 33 | + j$.plot( '#studenttdiv', [{ |
| 34 | + data : stInst.pdf, |
| 35 | + label : 'PDF' |
| 36 | + },{ |
| 37 | + data : stInst.cdf, |
| 38 | + label : 'CDF', |
| 39 | + yaxis : 2 |
| 40 | + }],{ |
| 41 | + start : -6, |
| 42 | + stop : 6, |
| 43 | + flotopts : { |
38 | 44 | yaxes : [{}, { position : 'right' }]
|
| 45 | + } |
39 | 46 | });
|
40 | 47 | });
|
0 commit comments