SVC_mle
Function to set up control parameters for SVC_mle
.
In the following, we assume the GP-based SVC model to have \(q\) GPs which
model the SVCs and \(p\) fixed effects.
SVC_mle_control(...)# S3 method for default
SVC_mle_control(
cov.name = c("exp", "sph", "mat32", "mat52", "wend1", "wend2"),
tapering = NULL,
parallel = NULL,
init = NULL,
lower = NULL,
upper = NULL,
save.fitted = TRUE,
profileLik = FALSE,
mean.est = c("GLS", "OLS"),
pc.prior = NULL,
extract_fun = FALSE,
hessian = TRUE,
dist = list(method = "euclidean"),
parscale = TRUE,
...
)
# S3 method for SVC_mle
SVC_mle_control(object, ...)
A list with which SVC_mle
can be controlled.
Further Arguments yet to be implemented
(character(1)
)
Name of the covariance function of the GPs. Currently, the following are
implemented: "exp"
for the exponential, "sph"
for
spherical, "mat32"
and "mat52"
for Matern class covariance
functions with smoothness 3/2 or 5/2, as well as "wend1"
and
"wend2"
for Wendland class covariance functions with kappa 1 or 2.
(NULL
or numeric(1)
)
If NULL
, no tapering is applied. If a scalar is given, covariance
tapering with this taper range is applied, for all Gaussian processes
modeling the SVC. Only defined for Matern class covariance functions,
i.e., set cov.name
either to "exp"
, "mat32"
, or
"mat52"
.
(NULL
or list
)
If NULL
, no parallelization is applied. If cluster has been
established, define arguments for parallelization with a list, see
documentation of optimParallel
. See Examples.
(NULL
or numeric(2q+1+p*as.numeric(profileLik))
)
Initial values for optimization procedure. If NULL
is given, an
initial vector is calculated (see Details). Otherwise, the vector is
assumed to consist of q-times (alternating) range and variance,
the nugget variance and if profileLik = TRUE
p mean effects.
(NULL
or numeric(2q+1+p*as.numeric(profileLik))
)
Lower bound for init
in optim
. Default NULL
calculates
the lower bounds (see Details).
(NULL
or numeric(2q+1+p*as.numeric(profileLik))
)
Upper bound for init
in optim
. Default NULL
calculates
the upper bounds (see Details).
(logical(1)
)
If TRUE
, calculates the fitted values and residuals after MLE and
stores them. This is necessary to call residuals
and
fitted
methods afterwards.
(logical(1)
)
If TRUE
, MLE is done over profile Likelihood of covariance
parameters.
(character(1)
)
If profileLik = TRUE
, the means have to be estimated seperately for
each step. "GLS"
uses the generalized least square estimate while
"OLS"
uses the ordinary least squares estimate.
(NULL
or numeric(4)
)
If numeric vector is given, penalized complexity priors are applied. The
order is \(\rho_0, \alpha_\rho, \sigma_0, \alpha_\sigma\) to give some
prior believes for the range and the standard deviation of GPs, such that
\(P(\rho < \rho_0) = \alpha_\rho, P(\sigma > \sigma_0) = \alpha_\sigma\).
This regulates the optimization process. Currently, only supported for
GPs with of Matérn class covariance functions. Based on the idea by
Fulgstad et al. (2018) tools:::Rd_expr_doi("10.1080/01621459.2017.1415907").
(logical(1)
)
If TRUE
, the function call of SVC_mle
stops before
the MLE and gives back the objective function of the MLE as well as all
used arguments. If FALSE
, regular MLE is conducted.
(logical(1)
)
If TRUE
, Hessian matrix is computed, see optim. This
required to give the standard errors for covariance parameters and to do
a Wald test on the variances, see summary.SVC_mle
.
(list
)
List containing the arguments of dist or
nearest.dist. This controls
the method of how the distances and therefore dependency structures are
calculated. The default gives Euclidean distances in a \(d\)-dimensional
space. Further editable arguments are p, miles, R
, see respective
help files of dist or nearest.dist.
(logical(1)
)
Triggers parameter scaling within the optimization in optim.
If TRUE
, the optional parameter scaling in optim.control
in
function SVC_mle
is overwritten by the initial value used in
the numeric optimization. The initial value is either computed from the
data or provided by the user, see init
argument above or Details
below. Note that we check whether the initial values are unequal to zero.
If they are zero, the corresponding scaling factor is 0.001. If
FALSE
, the parscale
argument in optim.control
is let
unchanged.
(SVC_mle
)
The function then extracts the control settings from the function call
used to compute in the given SVC_mle
object.
Jakob Dambon
If not provided, the initial values as well as the lower and upper
bounds are calculated given the provided data. In particular, we require
the median distance between observations, the variance of the response and,
the ordinary least square (OLS) estimates, see init_bounds_optim
.
The argument extract_fun
is useful, when one wants to modify
the objective function. Further, when trying to parallelize the
optimization, it is useful to check whether a single evaluation of the
objective function takes longer than 0.05 seconds to evaluate,
cf. Gerber and Furrer (2019) tools:::Rd_expr_doi("10.32614/RJ-2019-030"). Platform specific
issues can be sorted out by the user by setting up their own optimization.
SVC_mle
control <- SVC_mle_control(init = rep(0.3, 10))
# or
control <- SVC_mle_control()
control$init <- rep(0.3, 10)
# \donttest{
# Code for setting up parallel computing
require(parallel)
# exchange number of nodes (1) for detectCores()-1 or appropriate number
cl <- makeCluster(1, setup_strategy = "sequential")
clusterEvalQ(
cl = cl,
{
library(spam)
library(varycoef)
})
# use this list for parallel argument in SVC_mle_control
parallel.control <- list(cl = cl, forward = TRUE, loginfo = TRUE)
# SVC_mle goes here ...
# DO NOT FORGET TO STOP THE CLUSTER!
stopCluster(cl); rm(cl)
# }
Run the code above in your browser using DataLab