change.param.gp {spectralGP} | R Documentation |
Changes the correlation parameter values or the (optional) variance
parameter and recalculates the prior
variances of the coefficients using calc.variances.gp
.
change.param.gp(object,new.specdens.param=NULL,new.variance.param=NULL,...)
object |
A GP object, created by gp . |
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
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. 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))