fit_base.mcgf_rs {mcgf} | R Documentation |
Parameter estimation for symmetric correlation functions for an mcgf_rs
object.
Description
Parameter estimation for symmetric correlation functions for an mcgf_rs
object.
Usage
## S3 method for class 'mcgf_rs'
fit_base(
x,
lag_ls,
horizon = 1,
model_ls,
method_ls = "wls",
optim_fn_ls = "nlminb",
par_fixed_ls = list(NULL),
par_init_ls,
lower_ls = list(NULL),
upper_ls = list(NULL),
other_optim_fn_ls = list(NULL),
dists_base_ls = list(NULL),
scale_time = 1,
rs = TRUE,
...
)
Arguments
x |
An |
lag_ls |
List of integer time lags. |
horizon |
Integer forecast horizon. |
model_ls |
List of base models, each element must be one of |
method_ls |
List of parameter estimation methods, weighted least square
( |
optim_fn_ls |
List of optimization functions, each element must be one
of |
par_fixed_ls |
List of fixed parameters. |
par_init_ls |
List of initial values for parameters to be optimized. |
lower_ls |
Optional; list of lower bounds of parameters. |
upper_ls |
Optional: list of upper bounds of parameters. |
other_optim_fn_ls |
Optional, list of other optimization functions. The
first two arguments must be initial values for the parameters and a function
to be minimized respectively (same as that of |
dists_base_ls |
List of lists of distance matrices. If NULL, |
scale_time |
Scale of time unit, default is 1. |
rs |
Logical; if TRUE |
... |
Additional arguments passed to all |
Details
This functions is the regime-switching variant of fit_base.mcgf()
.
Arguments are in lists. The length of arguments that end in _ls
must be 1
or the same as the number of regimes in x
. If the length of an argument is
1, then it is set the same for all regimes. Refer to fit_base.mcgf()
for
more details of the arguments.
Note that both wls
and mle
are heuristic approaches when x
contains
observations from a subset of the discrete spatial domain, though estimation
results are close to that using the full spatial domain for large sample
sizes.
Value
A list containing outputs from optimization functions of optim_fn
for each regime.
See Also
Other functions on fitting an mcgf_rs:
add_base.mcgf_rs()
,
add_lagr.mcgf_rs()
,
fit_lagr.mcgf_rs()
,
krige.mcgf_rs()
,
krige_new.mcgf_rs()
Examples
data(sim2)
sim2_mcgf <- mcgf_rs(sim2$data, dists = sim2$dists, label = sim2$label)
sim2_mcgf <- add_acfs(sim2_mcgf, lag_max = 5)
sim2_mcgf <- add_ccfs(sim2_mcgf, lag_max = 5)
# Fit a regime-switching pure spatial model
fit_spatial <-
fit_base(
sim2_mcgf,
lag_ls = 5,
model_ls = "spatial",
par_init_ls = list(c(c = 0.00005, gamma = 0.5)),
par_fixed_ls = list(c(nugget = 0))
)
lapply(fit_spatial[1:2], function(x) x$fit)
# Fit a regime-switching pure temporal model
fit_temporal <-
fit_base(
sim2_mcgf,
lag_ls = 5,
model_ls = "temporal",
par_init_ls = list(
list(a = 0.8, alpha = 0.8),
list(a = 0.1, alpha = 0.1)
)
)
lapply(fit_temporal[1:2], function(x) x$fit)
# Fit a regime-switching separable model
fit_sep <- fit_base(
sim2_mcgf,
lag_ls = 5,
model_ls = "sep",
par_init_ls = list(list(
c = 0.00005,
gamma = 0.5,
a = 0.5,
alpha = 0.5
)),
par_fixed_ls = list(c(nugget = 0))
)
lapply(fit_sep[1:2], function(x) x$fit)