Matern52 {GauPro} | R Documentation |
Matern 5/2 Kernel R6 class
Description
Matern 5/2 Kernel R6 class
Matern 5/2 Kernel R6 class
Usage
k_Matern52(
beta,
s2 = 1,
D,
beta_lower = -8,
beta_upper = 6,
beta_est = TRUE,
s2_lower = 1e-08,
s2_upper = 1e+08,
s2_est = TRUE,
useC = TRUE
)
Arguments
beta |
Initial beta value |
s2 |
Initial variance |
D |
Number of input dimensions of data |
beta_lower |
Lower bound for beta |
beta_upper |
Upper bound for beta |
beta_est |
Should beta be estimated? |
s2_lower |
Lower bound for s2 |
s2_upper |
Upper bound for s2 |
s2_est |
Should s2 be estimated? |
useC |
Should C code used? Much faster. |
Format
R6Class
object.
Details
k(x, y) = s2 * (1 + t1 + t1^2 / 3) * exp(-t1)
where
t1 = sqrt(5) * sqrt(sum(theta * (x-y)^2))
Value
Object of R6Class
with methods for fitting GP model.
Super classes
GauPro::GauPro_kernel
-> GauPro::GauPro_kernel_beta
-> GauPro_kernel_Matern52
Public fields
sqrt5
Saved value of square root of 5
Methods
Public methods
Inherited methods
GauPro::GauPro_kernel$plot()
GauPro::GauPro_kernel_beta$C_dC_dparams()
GauPro::GauPro_kernel_beta$initialize()
GauPro::GauPro_kernel_beta$param_optim_lower()
GauPro::GauPro_kernel_beta$param_optim_start()
GauPro::GauPro_kernel_beta$param_optim_start0()
GauPro::GauPro_kernel_beta$param_optim_upper()
GauPro::GauPro_kernel_beta$s2_from_params()
GauPro::GauPro_kernel_beta$set_params_from_optim()
Method k()
Calculate covariance between two points
Usage
Matern52$k(x, y = NULL, beta = self$beta, s2 = self$s2, params = NULL)
Arguments
x
vector.
y
vector, optional. If excluded, find correlation of x with itself.
beta
Correlation parameters.
s2
Variance parameter.
params
parameters to use instead of beta and s2.
Method kone()
Find covariance of two points
Usage
Matern52$kone(x, y, beta, theta, s2)
Arguments
x
vector
y
vector
beta
correlation parameters on log scale
theta
correlation parameters on regular scale
s2
Variance parameter
Method dC_dparams()
Derivative of covariance with respect to parameters
Usage
Matern52$dC_dparams(params = NULL, X, C_nonug, C, nug)
Arguments
params
Kernel parameters
X
matrix of points in rows
C_nonug
Covariance without nugget added to diagonal
C
Covariance with nugget
nug
Value of nugget
Method dC_dx()
Derivative of covariance with respect to X
Usage
Matern52$dC_dx(XX, X, theta, beta = self$beta, s2 = self$s2)
Arguments
XX
matrix of points
X
matrix of points to take derivative with respect to
theta
Correlation parameters
beta
log of theta
s2
Variance parameter
Method print()
Print this object
Usage
Matern52$print()
Method clone()
The objects of this class are cloneable with this method.
Usage
Matern52$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
k1 <- Matern52$new(beta=0)
plot(k1)
n <- 12
x <- matrix(seq(0,1,length.out = n), ncol=1)
y <- sin(2*pi*x) + rnorm(n,0,1e-1)
gp <- GauPro_kernel_model$new(X=x, Z=y, kernel=Matern52$new(1),
parallel=FALSE)
gp$predict(.454)
gp$plot1D()
gp$cool1Dplot()