@@ -5,6 +5,8 @@ jStat.beta = function( alpha, beta ) {
5
5
if ( ! ( this instanceof arguments . callee ) ) return new jStat . beta ( alpha , beta ) ;
6
6
this . alpha = alpha ;
7
7
this . beta = beta ;
8
+
9
+ for ( var i in jStat . beta . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
8
10
} ;
9
11
10
12
// extend beta function with static methods
@@ -76,6 +78,8 @@ jStat.cauchy = function( local, scale ) {
76
78
if ( ! ( this instanceof arguments . callee ) ) return new jStat . cauchy ( local , scale ) ;
77
79
this . local = local ;
78
80
this . scale = scale ;
81
+
82
+ for ( var i in jStat . cauchy . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
79
83
} ;
80
84
81
85
// extend cauchy function with static methods
@@ -144,6 +148,8 @@ jStat.cauchy.prototype.sample = function( arr ) {
144
148
jStat . chisquare = function ( dof ) {
145
149
if ( ! ( this instanceof arguments . callee ) ) return new jStat . chisquare ( dof ) ;
146
150
this . dof = dof ;
151
+
152
+ for ( var i in jStat . chisquare . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
147
153
} ;
148
154
149
155
// extend chisquare function with static methods
@@ -213,6 +219,8 @@ jStat.chisquare.prototype.sample = function( arr ) {
213
219
jStat . exponential = function ( rate ) {
214
220
if ( ! ( this instanceof arguments . callee ) ) return new jStat . exponential ( rate ) ;
215
221
this . rate = rate ;
222
+
223
+ for ( var i in jStat . exponential . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
216
224
} ;
217
225
218
226
// extend exponential function with static methods
@@ -282,6 +290,8 @@ jStat.gamma = function( shape, scale ) {
282
290
if ( ! ( this instanceof arguments . callee ) ) return new jStat . gamma ( shape , scale ) ;
283
291
this . shape = shape ;
284
292
this . scale = scale ;
293
+
294
+ for ( var i in jStat . gamma . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
285
295
} ;
286
296
287
297
// extend gamma function with static methods
@@ -348,6 +358,8 @@ jStat.kumaraswamy = function( alpha, beta ) {
348
358
if ( ! ( this instanceof arguments . callee ) ) return new jStat . kumaraswamy ( alpha , beta ) ;
349
359
this . alpha = alpha ;
350
360
this . beta = beta ;
361
+
362
+ for ( var i in jStat . kumaraswamy . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
351
363
} ;
352
364
353
365
// extend kumaraswamy function with static methods
@@ -399,6 +411,8 @@ jStat.lognormal = function( mu, sigma ) {
399
411
if ( ! ( this instanceof arguments . callee ) ) return new jStat . lognormal ( mu , sigma ) ;
400
412
this . mu = mu ;
401
413
this . sigma = sigma ;
414
+
415
+ for ( var i in jStat . lognormal . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
402
416
} ;
403
417
404
418
// extend lognormal function with static methods
@@ -468,6 +482,8 @@ jStat.normal = function( mean, std ) {
468
482
if ( ! ( this instanceof arguments . callee ) ) return new jStat . normal ( mean , std ) ;
469
483
this . mean = mean ;
470
484
this . std = std ;
485
+
486
+ for ( var i in jStat . normal . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
471
487
} ;
472
488
473
489
// extend normal function with static methods
@@ -537,6 +553,8 @@ jStat.pareto = function( scale, shape ) {
537
553
if ( ! ( this instanceof arguments . callee ) ) return new jStat . pareto ( scale , shape ) ;
538
554
this . scale = scale ;
539
555
this . shape = shape ;
556
+
557
+ for ( var i in jStat . pareto . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
540
558
} ;
541
559
542
560
// extend pareto function with static methods
@@ -588,6 +606,8 @@ jStat.extend( jStat.pareto, {
588
606
jStat . studentt = function ( dof ) {
589
607
if ( ! ( this instanceof arguments . callee ) ) return new jStat . studentt ( dof ) ;
590
608
this . dof = dof ;
609
+
610
+ for ( var i in jStat . studentt . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
591
611
} ;
592
612
593
613
// extend studentt function with static methods
@@ -660,6 +680,8 @@ jStat.weibull = function( scale, shape ) {
660
680
if ( ! ( this instanceof arguments . callee ) ) return new jStat . weibull ( scale , shape ) ;
661
681
this . scale = scale ;
662
682
this . shape = shape ;
683
+
684
+ for ( var i in jStat . weibull . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
663
685
} ;
664
686
665
687
// extend weibull function with static methods
@@ -729,6 +751,8 @@ jStat.uniform = function( a, b ) {
729
751
if ( ! ( this instanceof arguments . callee ) ) return new jStat . uniform ( a , b ) ;
730
752
this . a = a ;
731
753
this . b = b ;
754
+
755
+ for ( var i in jStat . uniform . prototype ) this [ i ] = this [ i ] . bind ( this ) ;
732
756
} ;
733
757
734
758
// extend uniform function with static methods
0 commit comments