| Periodic | R Documentation |
Periodic Kernel R6 class
Periodic Kernel R6 class
k_Periodic(
p,
alpha = 1,
s2 = 1,
D,
p_lower = 0,
p_upper = 100,
p_est = TRUE,
alpha_lower = 0,
alpha_upper = 100,
alpha_est = TRUE,
s2_lower = 1e-08,
s2_upper = 1e+08,
s2_est = TRUE,
useC = TRUE
)
p |
Periodic parameter |
alpha |
Periodic parameter |
s2 |
Initial variance |
D |
Number of input dimensions of data |
p_lower |
Lower bound for p |
p_upper |
Upper bound for p |
p_est |
Should p be estimated? |
alpha_lower |
Lower bound for alpha |
alpha_upper |
Upper bound for alpha |
alpha_est |
Should alpha 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 if implemented. |
R6Class object.
p is the period for each dimension, a is a single number for scaling
k(x, y) = s2 * exp(-sum(alpha*sin(p * (x-y))^2))
k(x, y) = \sigma^2 * \exp(-\sum(\alpha_i*sin(p * (x_i-y_i))^2))
Object of R6Class with methods for fitting GP model.
GauPro::GauPro_kernel -> GauPro_kernel_Periodic
pParameter for correlation
p_estShould p be estimated?
logpLog of p
logp_lowerLower bound of logp
logp_upperUpper bound of logp
p_lengthlength of p
alphaParameter for correlation
alpha_estShould alpha be estimated?
logalphaLog of alpha
logalpha_lowerLower bound of logalpha
logalpha_upperUpper bound of logalpha
s2variance
s2_estIs s2 estimated?
logs2Log of s2
logs2_lowerLower bound of logs2
logs2_upperUpper bound of logs2
new()Initialize kernel object
Periodic$new( p, alpha = 1, s2 = 1, D, p_lower = 0, p_upper = 100, p_est = TRUE, alpha_lower = 0, alpha_upper = 100, alpha_est = TRUE, s2_lower = 1e-08, s2_upper = 1e+08, s2_est = TRUE, useC = TRUE )
pPeriodic parameter
alphaPeriodic parameter
s2Initial variance
DNumber of input dimensions of data
p_lowerLower bound for p
p_upperUpper bound for p
p_estShould p be estimated?
alpha_lowerLower bound for alpha
alpha_upperUpper bound for alpha
alpha_estShould alpha be estimated?
s2_lowerLower bound for s2
s2_upperUpper bound for s2
s2_estShould s2 be estimated?
useCShould C code used? Much faster if implemented.
k()Calculate covariance between two points
Periodic$k( x, y = NULL, logp = self$logp, logalpha = self$logalpha, s2 = self$s2, params = NULL )
xvector.
yvector, optional. If excluded, find correlation of x with itself.
logpCorrelation parameters.
logalphaCorrelation parameters.
s2Variance parameter.
paramsparameters to use instead of beta and s2.
kone()Find covariance of two points
Periodic$kone(x, y, logp, p, alpha, s2)
xvector
yvector
logpcorrelation parameters on log scale
pcorrelation parameters on regular scale
alphacorrelation parameter
s2Variance parameter
dC_dparams()Derivative of covariance with respect to parameters
Periodic$dC_dparams(params = NULL, X, C_nonug, C, nug)
paramsKernel parameters
Xmatrix of points in rows
C_nonugCovariance without nugget added to diagonal
CCovariance with nugget
nugValue of nugget
C_dC_dparams()Calculate covariance matrix and its derivative with respect to parameters
Periodic$C_dC_dparams(params = NULL, X, nug)
paramsKernel parameters
Xmatrix of points in rows
nugValue of nugget
dC_dx()Derivative of covariance with respect to X
Periodic$dC_dx(XX, X, logp = self$logp, logalpha = self$logalpha, s2 = self$s2)
XXmatrix of points
Xmatrix of points to take derivative with respect to
logplog of p
logalphalog of alpha
s2Variance parameter
param_optim_start()Starting point for parameters for optimization
Periodic$param_optim_start( jitter = F, y, p_est = self$p_est, alpha_est = self$alpha_est, s2_est = self$s2_est )
jitterShould there be a jitter?
yOutput
p_estIs p being estimated?
alpha_estIs alpha being estimated?
s2_estIs s2 being estimated?
param_optim_start0()Starting point for parameters for optimization
Periodic$param_optim_start0( jitter = F, y, p_est = self$p_est, alpha_est = self$alpha_est, s2_est = self$s2_est )
jitterShould there be a jitter?
yOutput
p_estIs p being estimated?
alpha_estIs alpha being estimated?
s2_estIs s2 being estimated?
param_optim_lower()Lower bounds of parameters for optimization
Periodic$param_optim_lower( p_est = self$p_est, alpha_est = self$alpha_est, s2_est = self$s2_est )
p_estIs p being estimated?
alpha_estIs alpha being estimated?
s2_estIs s2 being estimated?
param_optim_upper()Upper bounds of parameters for optimization
Periodic$param_optim_upper( p_est = self$p_est, alpha_est = self$alpha_est, s2_est = self$s2_est )
p_estIs p being estimated?
alpha_estIs alpha being estimated?
s2_estIs s2 being estimated?
set_params_from_optim()Set parameters from optimization output
Periodic$set_params_from_optim( optim_out, p_est = self$p_est, alpha_est = self$alpha_est, s2_est = self$s2_est )
optim_outOutput from optimization
p_estIs p being estimated?
alpha_estIs alpha being estimated?
s2_estIs s2 being estimated?
s2_from_params()Get s2 from params vector
Periodic$s2_from_params(params, s2_est = self$s2_est)
paramsparameter vector
s2_estIs s2 being estimated?
print()Print this object
Periodic$print()
clone()The objects of this class are cloneable with this method.
Periodic$clone(deep = FALSE)
deepWhether to make a deep clone.
k1 <- Periodic$new(p=1, alpha=1)
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=Periodic$new(D=1),
parallel=FALSE)
gp$predict(.454)
gp$plot1D()
gp$cool1Dplot()
plot(gp$kernel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.