@@ -160,7 +160,7 @@ def prior(self, name, X, reparameterize=True, jitter=JITTER_DEFAULT, **kwargs):
160
160
variable by the Cholesky factor of the covariance matrix.
161
161
jitter: scalar
162
162
A small correction added to the diagonal of positive semi-definite
163
- covariance matrices to ensure numerical stability. Default value is 1e-6.
163
+ covariance matrices to ensure numerical stability.
164
164
**kwargs
165
165
Extra keyword arguments that are passed to distribution constructor.
166
166
"""
@@ -196,7 +196,7 @@ def _build_conditional(self, Xnew, X, f, cov_total, mean_total, jitter):
196
196
cov = Kss - at .dot (at .transpose (A ), A )
197
197
return mu , cov
198
198
199
- def conditional (self , name , Xnew , given = None , jitter = 0.0 , ** kwargs ):
199
+ def conditional (self , name , Xnew , given = None , jitter = JITTER_DEFAULT , ** kwargs ):
200
200
R"""
201
201
Returns the conditional distribution evaluated over new input
202
202
locations `Xnew`.
@@ -223,8 +223,7 @@ def conditional(self, name, Xnew, given=None, jitter=0.0, **kwargs):
223
223
models in PyMC for more information.
224
224
jitter: scalar
225
225
A small correction added to the diagonal of positive semi-definite
226
- covariance matrices to ensure numerical stability. For conditionals
227
- the default value is 0.0.
226
+ covariance matrices to ensure numerical stability.
228
227
**kwargs
229
228
Extra keyword arguments that are passed to `MvNormal` distribution
230
229
constructor.
@@ -324,7 +323,7 @@ def _build_conditional(self, Xnew, X, f, jitter):
324
323
covT = (self .nu + beta - 2 ) / (nu2 - 2 ) * cov
325
324
return nu2 , mu , covT
326
325
327
- def conditional (self , name , Xnew , jitter = 0.0 , ** kwargs ):
326
+ def conditional (self , name , Xnew , jitter = JITTER_DEFAULT , ** kwargs ):
328
327
R"""
329
328
Returns the conditional distribution evaluated over new input
330
329
locations `Xnew`.
@@ -341,8 +340,7 @@ def conditional(self, name, Xnew, jitter=0.0, **kwargs):
341
340
Function input values.
342
341
jitter: scalar
343
342
A small correction added to the diagonal of positive semi-definite
344
- covariance matrices to ensure numerical stability. For conditionals
345
- the default value is 0.0.
343
+ covariance matrices to ensure numerical stability.
346
344
**kwargs
347
345
Extra keyword arguments that are passed to `MvNormal` distribution
348
346
constructor.
@@ -407,7 +405,9 @@ def _build_marginal_likelihood(self, X, noise, jitter):
407
405
cov = Kxx + Knx
408
406
return mu , stabilize (cov , jitter )
409
407
410
- def marginal_likelihood (self , name , X , y , noise , jitter = 0.0 , is_observed = True , ** kwargs ):
408
+ def marginal_likelihood (
409
+ self , name , X , y , noise , jitter = JITTER_DEFAULT , is_observed = True , ** kwargs
410
+ ):
411
411
R"""
412
412
Returns the marginal likelihood distribution, given the input
413
413
locations `X` and the data `y`.
@@ -433,7 +433,7 @@ def marginal_likelihood(self, name, X, y, noise, jitter=0.0, is_observed=True, *
433
433
non-white noise.
434
434
jitter: scalar
435
435
A small correction added to the diagonal of positive semi-definite
436
- covariance matrices to ensure numerical stability. Default value is 0.0.
436
+ covariance matrices to ensure numerical stability.
437
437
**kwargs
438
438
Extra keyword arguments that are passed to `MvNormal` distribution
439
439
constructor.
@@ -497,7 +497,9 @@ def _build_conditional(
497
497
cov += noise (Xnew )
498
498
return mu , cov if pred_noise else stabilize (cov , jitter )
499
499
500
- def conditional (self , name , Xnew , pred_noise = False , given = None , jitter = 0.0 , ** kwargs ):
500
+ def conditional (
501
+ self , name , Xnew , pred_noise = False , given = None , jitter = JITTER_DEFAULT , ** kwargs
502
+ ):
501
503
R"""
502
504
Returns the conditional distribution evaluated over new input
503
505
locations `Xnew`.
@@ -527,8 +529,7 @@ def conditional(self, name, Xnew, pred_noise=False, given=None, jitter=0.0, **kw
527
529
models in PyMC for more information.
528
530
jitter: scalar
529
531
A small correction added to the diagonal of positive semi-definite
530
- covariance matrices to ensure numerical stability. For conditionals
531
- the default value is 0.0.
532
+ covariance matrices to ensure numerical stability.
532
533
**kwargs
533
534
Extra keyword arguments that are passed to `MvNormal` distribution
534
535
constructor.
@@ -539,7 +540,14 @@ def conditional(self, name, Xnew, pred_noise=False, given=None, jitter=0.0, **kw
539
540
return pm .MvNormal (name , mu = mu , cov = cov , ** kwargs )
540
541
541
542
def predict (
542
- self , Xnew , point = None , diag = False , pred_noise = False , given = None , jitter = 0.0 , model = None
543
+ self ,
544
+ Xnew ,
545
+ point = None ,
546
+ diag = False ,
547
+ pred_noise = False ,
548
+ given = None ,
549
+ jitter = JITTER_DEFAULT ,
550
+ model = None ,
543
551
):
544
552
R"""
545
553
Return the mean vector and covariance matrix of the conditional
@@ -563,15 +571,14 @@ def predict(
563
571
Same as `conditional` method.
564
572
jitter: scalar
565
573
A small correction added to the diagonal of positive semi-definite
566
- covariance matrices to ensure numerical stability. For conditionals
567
- the default value is 0.0.
574
+ covariance matrices to ensure numerical stability.
568
575
"""
569
576
if given is None :
570
577
given = {}
571
578
mu , cov = self ._predict_at (Xnew , diag , pred_noise , given , jitter )
572
579
return replace_with_values ([mu , cov ], replacements = point , model = model )
573
580
574
- def _predict_at (self , Xnew , diag = False , pred_noise = False , given = None , jitter = 0.0 ):
581
+ def _predict_at (self , Xnew , diag = False , pred_noise = False , given = None , jitter = JITTER_DEFAULT ):
575
582
R"""
576
583
Return the mean vector and covariance matrix of the conditional
577
584
distribution as symbolic variables.
@@ -712,7 +719,7 @@ def _build_marginal_likelihood_logp(self, y, X, Xu, sigma, jitter):
712
719
return - 1.0 * (constant + logdet + quadratic + trace )
713
720
714
721
def marginal_likelihood (
715
- self , name , X , Xu , y , noise = None , is_observed = True , jitter = 0.0 , ** kwargs
722
+ self , name , X , Xu , y , noise = None , is_observed = True , jitter = JITTER_DEFAULT , ** kwargs
716
723
):
717
724
R"""
718
725
Returns the approximate marginal likelihood distribution, given the input
@@ -738,7 +745,7 @@ def marginal_likelihood(
738
745
Default is `True`.
739
746
jitter: scalar
740
747
A small correction added to the diagonal of positive semi-definite
741
- covariance matrices to ensure numerical stability. Default value is 0.0.
748
+ covariance matrices to ensure numerical stability.
742
749
**kwargs
743
750
Extra keyword arguments that are passed to `MvNormal` distribution
744
751
constructor.
@@ -836,7 +843,9 @@ def _get_given_vals(self, given):
836
843
X , Xu , y , sigma = self .X , self .Xu , self .y , self .sigma
837
844
return X , Xu , y , sigma , cov_total , mean_total
838
845
839
- def conditional (self , name , Xnew , pred_noise = False , given = None , jitter = 0.0 , ** kwargs ):
846
+ def conditional (
847
+ self , name , Xnew , pred_noise = False , given = None , jitter = JITTER_DEFAULT , ** kwargs
848
+ ):
840
849
R"""
841
850
Returns the approximate conditional distribution of the GP evaluated over
842
851
new input locations `Xnew`.
@@ -857,8 +866,7 @@ def conditional(self, name, Xnew, pred_noise=False, given=None, jitter=0.0, **kw
857
866
models in PyMC for more information.
858
867
jitter: scalar
859
868
A small correction added to the diagonal of positive semi-definite
860
- covariance matrices to ensure numerical stability. For conditionals
861
- the default value is 0.0.
869
+ covariance matrices to ensure numerical stability.
862
870
**kwargs
863
871
Extra keyword arguments that are passed to `MvNormal` distribution
864
872
constructor.
@@ -968,7 +976,7 @@ def prior(self, name, Xs, jitter=JITTER_DEFAULT, **kwargs):
968
976
`cartesian(*Xs)`.
969
977
jitter: scalar
970
978
A small correction added to the diagonal of positive semi-definite
971
- covariance matrices to ensure numerical stability. Default value is 1e-6.
979
+ covariance matrices to ensure numerical stability.
972
980
**kwargs
973
981
Extra keyword arguments that are passed to the `KroneckerNormal`
974
982
distribution constructor.
@@ -998,7 +1006,7 @@ def _build_conditional(self, Xnew, jitter):
998
1006
cov = stabilize (Kss - at .dot (at .transpose (A ), A ), jitter )
999
1007
return mu , cov
1000
1008
1001
- def conditional (self , name , Xnew , jitter = 0.0 , ** kwargs ):
1009
+ def conditional (self , name , Xnew , jitter = JITTER_DEFAULT , ** kwargs ):
1002
1010
"""
1003
1011
Returns the conditional distribution evaluated over new input
1004
1012
locations `Xnew`.
@@ -1027,8 +1035,7 @@ def conditional(self, name, Xnew, jitter=0.0, **kwargs):
1027
1035
vector with shape `(n, 1)`.
1028
1036
jitter: scalar
1029
1037
A small correction added to the diagonal of positive semi-definite
1030
- covariance matrices to ensure numerical stability. For conditionals
1031
- the default value is 0.0.
1038
+ covariance matrices to ensure numerical stability.
1032
1039
**kwargs
1033
1040
Extra keyword arguments that are passed to `MvNormal` distribution
1034
1041
constructor.
0 commit comments