View source: R/B_splines_est.R
| splines_est | R Documentation |
Compute the estimated covariance function by using the method from Choi, Li & Wang (2013, pp. 614-617).
C(\tau) = \sum_{j = 1}^{m + p} \beta_{j} f_{j}^{(p-1)}(\tau^{2}),
where m is the number of nonboundary knots, p is the order of the splines, \tau is the isotropic distance, \beta_{j} are nonnegative weights and f_{j}^{(p)} are basis functions of order p.
For optimisation, the Nelder-Mead and L-BFGS-B methods are used, the one which selects parameters which minimises the objective function is chosen.
splines_est(
X,
x,
estCov,
p,
m,
maxLag = length(X) - 1,
type = c("autocovariance", "autocorrelation"),
initial_pars = c(),
control = list(maxit = 1000)
)
## S3 method for class 'CovEsts'
splines_est(
X,
x,
estCov,
p,
m,
maxLag = length(X) - 1,
type = c("autocovariance", "autocorrelation"),
initial_pars = c(),
control = list(maxit = 1000)
)
## Default S3 method:
splines_est(
X,
x,
estCov,
p,
m,
maxLag = length(X) - 1,
type = c("autocovariance", "autocorrelation"),
initial_pars = c(),
control = list(maxit = 1000)
)
X |
A vector representing observed values of the time series. |
x |
A vector of lag indices. |
estCov |
An estimated autocovariance function to fit to (a vector). |
p |
The order of the splines. |
m |
The number of nonboundary knots. |
maxLag |
An optional parameter that determines the maximum lag to compute the estimated autocovariance function at. Defaults to |
type |
Compute either the 'autocovariance' or 'autocorrelation'. Defaults to 'autocovariance'. |
initial_pars |
An optional vector of parameters - can be used to fine tune the fit. By default, it is a vector of 0.5 whose length is |
control |
An optional list of optimisation parameters used in the optimisation process, see |
Due to the weighting scheme, the autocovariance at lag zero cannot be 1,
w_{i} = \frac{N - i}{1 - C(i)}
A vector whose values are the spline autocovariance estimates or a CovEsts S3 object (list) with the following values
acfA numeric vector containing the autocovariance/autocorrelation estimates.
lagsA numeric vector containing the lag indices used to compute the estimates on.
est_typeThe type of estimate, namely 'autocorrelation' or 'autocovariance', this depends on the type parameter.
est_usedThe estimator function used, in this case, 'splines_est'.
If a numeric vector is given for the argument estCov, then a numeric vector output is given, and if a CovEsts S3 object is given, a CovEsts object is given as output.
splines_est(CovEsts): Method for 'CovEsts' objects.
splines_est(default): Method for numeric vectors.
Choi, I., Li, B. & Wang, X. (2013). Nonparametric Estimation of Spatial and Space-Time Covariance Function. JABES 18, 611-630. https://doi.org/10.1007/s13253-013-0152-z
X <- rnorm(100)
x <- seq(0, 5, by = 0.25)
maxLag <- 5
estCov <- standard_est(X, maxLag = maxLag)
estimated <- splines_est(X, x, estCov, 3, 2, maxLag = maxLag)
estimated
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.