39
39
__all__ = ["TP" , "Latent" , "LatentKron" , "Marginal" , "MarginalApprox" , "MarginalKron" ]
40
40
41
41
42
- _noise_deprecation_warning = (
43
- "The 'noise' parameter has been been changed to 'sigma' "
44
- "in order to standardize the GP API and will be "
45
- "deprecated in future releases."
46
- )
47
-
48
-
49
- def _handle_sigma_noise_parameters (sigma , noise ):
50
- """Help transition of 'noise' parameter to be named 'sigma'."""
51
- if (sigma is None and noise is None ) or (sigma is not None and noise is not None ):
52
- raise ValueError ("'sigma' argument must be specified." )
53
-
54
- if sigma is None :
55
- warnings .warn (_noise_deprecation_warning , FutureWarning )
56
- return noise
57
-
58
- return sigma
59
-
60
-
61
42
class Base :
62
43
"""Base class."""
63
44
@@ -477,8 +458,7 @@ def marginal_likelihood(
477
458
name ,
478
459
X ,
479
460
y ,
480
- sigma = None ,
481
- noise = None ,
461
+ sigma ,
482
462
jitter = JITTER_DEFAULT ,
483
463
is_observed = True ,
484
464
** kwargs ,
@@ -505,8 +485,6 @@ def marginal_likelihood(
505
485
sigma : float, Variable, or Covariance, default ~pymc.gp.cov.WhiteNoise
506
486
Standard deviation of the Gaussian noise. Can also be a Covariance for
507
487
non-white noise.
508
- noise : float, Variable, or Covariance, optional
509
- Deprecated. Previous parameterization of `sigma`.
510
488
jitter : float, default 1e-6
511
489
A small correction added to the diagonal of positive semi-definite
512
490
covariance matrices to ensure numerical stability.
@@ -516,8 +494,6 @@ def marginal_likelihood(
516
494
Extra keyword arguments that are passed to :class:`~pymc.MvNormal` distribution
517
495
constructor.
518
496
"""
519
- sigma = _handle_sigma_noise_parameters (sigma = sigma , noise = noise )
520
-
521
497
noise_func = sigma if isinstance (sigma , BaseCovariance ) else pm .gp .cov .WhiteNoise (sigma )
522
498
mu , cov = self ._build_marginal_likelihood (X = X , noise_func = noise_func , jitter = jitter )
523
499
self .X = X
@@ -544,10 +520,6 @@ def _get_given_vals(self, given):
544
520
cov_total = self .cov_func
545
521
mean_total = self .mean_func
546
522
547
- if "noise" in given :
548
- warnings .warn (_noise_deprecation_warning , FutureWarning )
549
- given ["sigma" ] = given ["noise" ]
550
-
551
523
if all (val in given for val in ["X" , "y" , "sigma" ]):
552
524
X , y , sigma = given ["X" ], given ["y" ], given ["sigma" ]
553
525
noise_func = sigma if isinstance (sigma , BaseCovariance ) else pm .gp .cov .WhiteNoise (sigma )
@@ -804,9 +776,7 @@ def _build_marginal_likelihood_loglik(self, y, X, Xu, sigma, jitter):
804
776
quadratic = 0.5 * (pt .dot (r , r_l ) - pt .dot (c , c ))
805
777
return - 1.0 * (constant + logdet + quadratic + trace )
806
778
807
- def marginal_likelihood (
808
- self , name , X , Xu , y , sigma = None , noise = None , jitter = JITTER_DEFAULT , ** kwargs
809
- ):
779
+ def marginal_likelihood (self , name , X , Xu , y , sigma , jitter = JITTER_DEFAULT , ** kwargs ):
810
780
R"""
811
781
Return the approximate marginal likelihood distribution.
812
782
@@ -827,8 +797,6 @@ def marginal_likelihood(
827
797
noise. Must have shape `(n, )`.
828
798
sigma : float, Variable
829
799
Standard deviation of the Gaussian noise.
830
- noise : float, Variable, optional
831
- Previous parameterization of `sigma`.
832
800
jitter : float, default 1e-6
833
801
A small correction added to the diagonal of positive semi-definite
834
802
covariance matrices to ensure numerical stability.
@@ -840,7 +808,7 @@ def marginal_likelihood(
840
808
self .Xu = Xu
841
809
self .y = y
842
810
843
- self .sigma = _handle_sigma_noise_parameters ( sigma = sigma , noise = noise )
811
+ self .sigma = sigma
844
812
845
813
approx_loglik = self ._build_marginal_likelihood_loglik (
846
814
y = self .y , X = self .X , Xu = self .Xu , sigma = self .sigma , jitter = jitter
0 commit comments