@@ -55,9 +55,8 @@ jStat.extend( jStat.beta, {
55
55
// extend the beta objects prototype
56
56
( function ( vals ) {
57
57
for ( var item in vals ) ( function ( item ) {
58
- jStat . beta . prototype [ item ] = function ( min , max , len ) {
59
- var alpha = this . alpha , beta = this . beta ;
60
- return jStat . seq ( min , max , len , function ( x ) { return jStat . beta [ item ] ( x , alpha , beta ) ; } ) ;
58
+ jStat . beta . prototype [ item ] = function ( x ) {
59
+ return jStat . beta [ item ] ( x , this . alpha , this . beta ) ;
61
60
} ;
62
61
} ) ( vals [ item ] ) ;
63
62
} ) ( 'pdf cdf inv' . split ( ' ' ) ) ;
@@ -122,9 +121,8 @@ jStat.extend( jStat.cauchy, {
122
121
// extend the cauchy objects prototype
123
122
( function ( vals ) {
124
123
for ( var item in vals ) ( function ( item ) {
125
- jStat . cauchy . prototype [ item ] = function ( min , max , len ) {
126
- var local = this . local , scale = this . scale ;
127
- return jStat . seq ( min , max , len , function ( x ) { return jStat . cauchy [ item ] ( x , local , scale ) ; } ) ;
124
+ jStat . cauchy . prototype [ item ] = function ( x ) {
125
+ return jStat . cauchy [ item ] ( x , this . local , this . scale ) ;
128
126
} ;
129
127
} ) ( vals [ item ] ) ;
130
128
} ) ( 'pdf cdf inv' . split ( ' ' ) ) ;
@@ -191,9 +189,8 @@ jStat.extend( jStat.chisquare, {
191
189
// extend the chisquare objects prototype
192
190
( function ( vals ) {
193
191
for ( var item in vals ) ( function ( item ) {
194
- jStat . chisquare . prototype [ item ] = function ( min , max , len ) {
195
- var dof = this . dof ;
196
- return jStat . seq ( min , max , len , function ( x ) { return jStat . chisquare [ item ] ( x , dof ) ; } ) ;
192
+ jStat . chisquare . prototype [ item ] = function ( x ) {
193
+ return jStat . chisquare [ item ] ( x , this . dof ) ;
197
194
} ;
198
195
} ) ( vals [ item ] ) ;
199
196
} ) ( 'pdf cdf inv' . split ( ' ' ) ) ;
@@ -257,9 +254,8 @@ jStat.extend( jStat.exponential, {
257
254
// extend the exponential objects prototype
258
255
( function ( vals ) {
259
256
for ( var item in vals ) ( function ( item ) {
260
- jStat . exponential . prototype [ item ] = function ( min , max , len ) {
261
- var rate = this . rate ;
262
- return jStat . seq ( min , max , len , function ( x ) { return jStat . exponential [ item ] ( x , rate ) ; } ) ;
257
+ jStat . exponential . prototype [ item ] = function ( x ) {
258
+ return jStat . exponential [ item ] ( x , this . rate ) ;
263
259
} ;
264
260
} ) ( vals [ item ] ) ;
265
261
} ) ( 'pdf cdf inv' . split ( ' ' ) ) ;
@@ -323,9 +319,8 @@ jStat.extend( jStat.gamma, {
323
319
// extend the gamma objects prototype
324
320
( function ( vals ) {
325
321
for ( var item in vals ) ( function ( item ) {
326
- jStat . gamma . prototype [ item ] = function ( min , max , len ) {
327
- var shape = this . shape , scale = this . scale ;
328
- return jStat . seq ( min , max , len , function ( x ) { return jStat . gamma [ item ] ( x , shape , scale ) ; } ) ;
322
+ jStat . gamma . prototype [ item ] = function ( x ) {
323
+ return jStat . gamma [ item ] ( x , this . shape , this . scale ) ;
329
324
} ;
330
325
} ) ( vals [ item ] ) ;
331
326
} ) ( 'pdf cdf inv' . split ( ' ' ) ) ;
@@ -375,9 +370,8 @@ jStat.extend( jStat.kumaraswamy, {
375
370
// extend the kumaraswamy objects prototype
376
371
( function ( vals ) {
377
372
for ( var item in vals ) ( function ( item ) {
378
- jStat . kumaraswamy . prototype [ item ] = function ( min , max , len ) {
379
- var alpha = this . alpha , beta = this . beta ;
380
- return jStat . seq ( min , max , len , function ( x ) { return jStat . kumaraswamy [ item ] ( x , alpha , beta ) ; } ) ;
373
+ jStat . kumaraswamy . prototype [ item ] = function ( x ) {
374
+ return jStat . kumaraswamy [ item ] ( x , this . alpha , this . beta ) ;
381
375
} ;
382
376
} ) ( vals [ item ] ) ;
383
377
} ) ( 'pdf cdf' . split ( ' ' ) ) ;
@@ -442,9 +436,8 @@ jStat.extend( jStat.lognormal, {
442
436
// extend the lognormal objects prototype
443
437
( function ( vals ) {
444
438
for ( var item in vals ) ( function ( item ) {
445
- jStat . lognormal . prototype [ item ] = function ( min , max , len ) {
446
- var mu = this . mu , sigma = this . sigma ;
447
- return jStat . seq ( min , max , len , function ( x ) { return jStat . lognormal [ item ] ( x , mu , sigma ) ; } ) ;
439
+ jStat . lognormal . prototype [ item ] = function ( x ) {
440
+ return jStat . lognormal [ item ] ( x , this . mu , this . sigma ) ;
448
441
} ;
449
442
} ) ( vals [ item ] ) ;
450
443
} ) ( 'pdf cdf inv' . split ( ' ' ) ) ;
@@ -511,9 +504,8 @@ jStat.extend( jStat.normal, {
511
504
// extend the normal objects prototype
512
505
( function ( vals ) {
513
506
for ( var item in vals ) ( function ( item ) {
514
- jStat . normal . prototype [ item ] = function ( min , max , len ) {
515
- var mean = this . mean , std = this . std ;
516
- return jStat . seq ( min , max , len , function ( x ) { return jStat . normal [ item ] ( x , mean , std ) ; } ) ;
507
+ jStat . normal . prototype [ item ] = function ( x ) {
508
+ return jStat . normal [ item ] ( x , this . mean , this . std ) ;
517
509
} ;
518
510
} ) ( vals [ item ] ) ;
519
511
} ) ( 'pdf cdf inv' . split ( ' ' ) ) ;
@@ -564,9 +556,8 @@ jStat.extend( jStat.pareto, {
564
556
// extend the pareto objects prototype
565
557
( function ( vals ) {
566
558
for ( var item in vals ) ( function ( item ) {
567
- jStat . pareto . prototype [ item ] = function ( min , max , len ) {
568
- var shape = this . shape , scale = this . scale ;
569
- return jStat . seq ( min , max , len , function ( x ) { return jStat . pareto [ item ] ( x , scale , shape ) ; } ) ;
559
+ jStat . pareto . prototype [ item ] = function ( x ) {
560
+ return jStat . pareto [ item ] ( x , this . shape , this . scale ) ;
570
561
} ;
571
562
} ) ( vals [ item ] ) ;
572
563
} ) ( 'pdf cdf' . split ( ' ' ) ) ;
@@ -634,9 +625,8 @@ jStat.extend( jStat.studentt, {
634
625
// extend the studentt objects prototype
635
626
( function ( vals ) {
636
627
for ( var item in vals ) ( function ( item ) {
637
- jStat . studentt . prototype [ item ] = function ( min , max , len ) {
638
- var dof = this . dof ;
639
- return jStat . seq ( min , max , len , function ( x ) { return jStat . studentt [ item ] ( x , dof ) ; } ) ;
628
+ jStat . studentt . prototype [ item ] = function ( x ) {
629
+ return jStat . studentt [ item ] ( x , this . dof ) ;
640
630
} ;
641
631
} ) ( vals [ item ] ) ;
642
632
} ) ( 'pdf cdf inv' . split ( ' ' ) ) ;
@@ -701,9 +691,8 @@ jStat.extend( jStat.weibull, {
701
691
// extend the weibull objects prototype
702
692
( function ( vals ) {
703
693
for ( var item in vals ) ( function ( item ) {
704
- jStat . weibull . prototype [ item ] = function ( min , max , len ) {
705
- var scale = this . scale , shape = this . shape ;
706
- return jStat . seq ( min , max , len , function ( x ) { return jStat . weibull [ item ] ( x , scale , shape ) ; } ) ;
694
+ jStat . weibull . prototype [ item ] = function ( x ) {
695
+ return jStat . weinbull [ item ] ( x , this . scale , this . shape ) ;
707
696
} ;
708
697
} ) ( vals [ item ] ) ;
709
698
} ) ( 'pdf cdf inv' . split ( ' ' ) ) ;
@@ -769,9 +758,8 @@ jStat.extend( jStat.uniform, {
769
758
// extend the uniform objects prototype
770
759
( function ( vals ) {
771
760
for ( var item in vals ) ( function ( item ) {
772
- jStat . uniform . prototype [ item ] = function ( min , max , len ) {
773
- var a = this . a , b = this . b ;
774
- return jStat . seq ( min , max , len , function ( x ) { return jStat . uniform [ item ] ( x , a , b ) ; } ) ;
761
+ jStat . uniform . prototype [ item ] = function ( x ) {
762
+ return jStat . uniform [ item ] ( x , this . a , this . b ) ;
775
763
} ;
776
764
} ) ( vals [ item ] ) ;
777
765
} ) ( 'pdf cdf inv' . split ( ' ' ) ) ;
@@ -791,10 +779,6 @@ jStat.extend( jStat.uniform, {
791
779
// all these still need to be implemented as their own instance methods
792
780
jStat . extend ( {
793
781
794
- // Discrete distributions //
795
-
796
- // TODO: update these with proper notations.
797
-
798
782
// uniform distribution in terms of mean and standard dev
799
783
uniformmv : {
800
784
pdf : function ( x , m , s ) {
0 commit comments