change.param.gp {spectralGP} | R Documentation |
Changes correlation function parameter values of a spectral GP object
Description
Changes the correlation parameter values or the (optional) variance
parameter and recalculates the prior
variances of the coefficients using calc.variances.gp
.
Usage
## S3 method for class 'gp'
change.param(object,new.specdens.param=NULL,
new.variance.param=NULL,...)
Arguments
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. |
Details
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.
Value
The function modifies the GP object, which is essentially a pointer (an R environment in this case), so NULL is returned.
Author(s)
Christopher Paciorek paciorek@alumni.cmu.edu
References
Type 'citation("spectralGP")' for references.
See Also
gp
, calc.variances.gp
, logdensity.gp
Examples
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))