change.param.gp: Changes correlation function parameter values of a spectral...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Changes the correlation parameter values or the (optional) variance parameter and recalculates the prior variances of the coefficients using calc.variances.gp.

Usage

1
2
3
## S3 method for class 'gp'
change.param(object,new.specdens.param=NULL,
  new.variance.param=NULL,...)

Arguments

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.

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

 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))

spectralGP documentation built on May 2, 2019, 2:40 a.m.