Trend R6 class
Trend R6 class
Value
Object of R6Class with methods for fitting GP model.
Public fields
m
Trend parameters
m_lower
m lower bound
m_upper
m upper bound
m_est
Should m be estimated?
b
trend parameter
b_lower
trend lower bounds
b_upper
trend upper bounds
b_est
Should b be estimated?
Methods
Method new()
Initialize trend object
Usage
trend_LM$new(
D,
m = rep(0, D),
m_lower = rep(-Inf, D),
m_upper = rep(Inf, D),
m_est = rep(TRUE, D),
b = 0,
b_lower = -Inf,
b_upper = Inf,
b_est = TRUE
)
Arguments
D
Number of input dimensions of data
m
trend initial parameters
m_lower
trend lower bounds
m_upper
trend upper bounds
m_est
Logical of whether each param should be estimated
b
trend parameter
b_lower
trend lower bounds
b_upper
trend upper bounds
b_est
Should b be estimated?
Method Z()
Get trend value for given matrix X
Usage
trend_LM$Z(X, m = self$m, b = self$b, params = NULL)
Arguments
X
matrix of points
m
trend parameters
b
trend parameters (slopes)
params
trend parameters
Method dZ_dparams()
Derivative of trend with respect to trend parameters
Usage
trend_LM$dZ_dparams(X, m = self$m_est, b = self$b_est, params = NULL)
Arguments
X
matrix of points
m
trend values
b
trend intercept
params
overrides m
Method dZ_dx()
Derivative of trend with respect to X
Usage
trend_LM$dZ_dx(X, m = self$m, params = NULL)
Arguments
X
matrix of points
m
trend values
params
overrides m
Method param_optim_start()
Get parameter initial point for optimization
Usage
trend_LM$param_optim_start(
jitter = FALSE,
b_est = self$b_est,
m_est = self$m_est
)
Arguments
jitter
Not used
b_est
If the mean should be estimated.
m_est
If the linear terms should be estimated.
Method param_optim_start0()
Get parameter initial point for optimization
Usage
trend_LM$param_optim_start0(
jitter = FALSE,
b_est = self$b_est,
m_est = self$m_est
)
Arguments
jitter
Not used
b_est
If the mean should be estimated.
m_est
If the linear terms should be estimated.
Method param_optim_lower()
Get parameter lower bounds for optimization
Usage
trend_LM$param_optim_lower(b_est = self$b_est, m_est = self$m_est)
Arguments
b_est
If the mean should be estimated.
m_est
If the linear terms should be estimated.
Method param_optim_upper()
Get parameter upper bounds for optimization
Usage
trend_LM$param_optim_upper(b_est = self$b_est, m_est = self$m_est)
Arguments
b_est
If the mean should be estimated.
m_est
If the linear terms should be estimated.
Method set_params_from_optim()
Set parameters after optimization
Usage
trend_LM$set_params_from_optim(optim_out)
Arguments
optim_out
Output from optim
Method clone()
The objects of this class are cloneable with this method.
Usage
trend_LM$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.