Description Usage Arguments Details Value Author(s) References See Also Examples
Changes the correlation parameter values or the (optional) variance
parameter and recalculates the prior
variances of the coefficients using calc.variances.gp
.
1 2 3 | ## S3 method for class 'gp'
change.param(object,new.specdens.param=NULL,
new.variance.param=NULL,...)
|
object |
A GP object, created by |
new.specdens.param |
A vector of new parameter values, matching the length of the original parameter vector. |
new.variance.param |
The new variance parameter value. |
... |
Other arguments. |
This function allows the user to change the parameter values of the spectral GP object and recalculate the prior variances for the coefficients. This is particularly useful for implementing MCMC with the spectral GP.
The function modifies the GP object, which is essentially a pointer (an R environment in this case), so NULL is returned.
Christopher Paciorek paciorek@alumni.cmu.edu
Type 'citation("spectralGP")' for references.
gp
, calc.variances.gp
, logdensity.gp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(spectralGP)
rho=1
gp1=gp(128,matern.specdens,c(rho,4))
gp2=gp(c(64,64),matern.specdens,c(rho,4),0.5)
propose.coeff(gp1)
propose.coeff(gp2)
print(logdensity(gp1))
print(logdensity(gp2))
rho=2
sigma=2.5
change.param(gp1,c(rho,4)) # change parameter values of correlation function
change.param(gp2,c(rho,4),sigma)
print(logdensity(gp1))
print(logdensity(gp2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.