Title: | Nonparametric Regression and Bandwidth Selection for Spatial Models |
---|---|
Description: | Nonparametric smoothing techniques for data on a lattice and functional time series. Smoothing is done via kernel regression or local polynomial regression, a bandwidth selection procedure based on an iterative plug-in algorithm is implemented. This package allows for modeling a dependency structure of the error terms of the nonparametric regression model. Methods used in this paper are described in Feng/Schaefer (2021) <https://ideas.repec.org/p/pdn/ciepap/144.html>, Schaefer/Feng (2021) <https://ideas.repec.org/p/pdn/ciepap/143.html>. |
Authors: | Bastian Schaefer [aut, cre], Sebastian Letmathe [ctb], Yuanhua Feng [ths] |
Maintainer: | Bastian Schaefer <[email protected]> |
License: | GPL-3 |
Version: | 1.1.2 |
Built: | 2024-11-04 19:57:27 UTC |
Source: | CRAN |
Nonparametric smoothing techniques for data on a lattice and functional time series. Smoothing is done via kernel regression or local polynomial regression, a bandwidth selection procedure based on an iterative plug-in algorithm is implemented. This package allows for modeling a dependency structure of the error terms of the nonparametric regression model. Methods used in this paper are described in Feng/Schaefer (2021) <https://ideas.repec.org/p/pdn/ciepap/144.html>, Schaefer/Feng (2021) <https://ideas.repec.org/p/pdn/ciepap/143.html>.
Index of help topics:
DCSmooth-package Nonparametric Regression and Bandwidth Selection for Spatial Models dcs Nonparametric Double Conditional Smoothing for 2D Surfaces kernel.assign Assign a Kernel Function kernel.list Print a list of available kernels in the DCSmooth package plot.dcs Contour Plot for the Double Conditional Smoothing print.dcs Summarize Results from Double Conditional Smoothing print.dcs_options Print and Summarize Options for Double Conditional Smoothing print.summary_dcs Print the Summary of a DCS estimation print.summary_sarma Print the Summary of a "sarma"/"sfarima" object residuals.dcs Residuals of "dcs"-object returns.alv Returns of Allianz SE sarma.est Estimation of an SARMA-process sarma.sim Simulation of a SARMA(p, q)-process set.options Set Options for the DCS procedure sfarima.est Estimation of a SFARIMA-process sfarima.sim Simulation of a SFARIMA(p, q, d)-process summary.dcs Summarizing Results from Double Conditional Smoothing summary.dcs_options Print and Summarize Options for Double Conditional Smoothing summary.sarma Summarizing SARMA/SFARIMA Estimation or Simulation surface.dcs 3D Surface Plot of "dcs"-object or numeric matrix temp.nunn Temperatures from Nunn, CO temp.yuma Temperatures from Yuma, AZ volumes.alv Volumes of Allianz SE wind.nunn Wind Speed from Nunn, CO wind.yuma Wind Speed from Yuma, AZ y.norm1 Single Gaussian Peak y.norm2 Double Gaussian Peak y.norm3 Double Gaussian Ridges
Further information is available in the following vignettes:
DCSmooth |
DCSmooth (source, pdf) |
Bastian Schaefer <[email protected]>
Bastian Schaefer [aut, cre], Sebastian Letmathe [ctb], Yuanhua Feng [ths]
dcs
provides a double conditional nonparametric smoothing of the
expectation surface of a functional time series or a random field on a
lattice. Bandwidth selection is done via an iterative plug-in method.
dcs(Y, dcs_options = set.options(), h = "auto", parallel = FALSE, ...)
dcs(Y, dcs_options = set.options(), h = "auto", parallel = FALSE, ...)
Y |
A numeric matrix that contains the observations of the random field or functional time-series. |
dcs_options |
An object of class |
h |
Bandwidth for smoothing the observations in |
parallel |
A logical value indicating if parallel computing should be
used for faster computation. Default value is |
... |
Additional arguments passed to |
dcs
returns an object of class "dcs", including
Y |
matrix of original observations. |
X, T |
vectors of covariates over rows (X ) and columns
(T ). |
M |
resulting matrix of smoothed values. |
R |
matrix of residuals of estimation, . |
h |
optimized or given bandwidths. |
c_f |
estimated variance coefficient. |
var_est |
estimated variance model. If the variance function is
modeled by an SARMA/SFARIMA, var_est is an object of class "sarma"/
"sfarima". |
dcs_options |
an object of class cds_options containing the
initial options of the dcs procedure. |
iterations |
number of iterations of the IPI-procedure. |
time_used |
time spend searching for optimal bandwidths (not overall runtime of the function). |
See the vignette for a more detailed description of the function.
Schäfer, B. and Feng, Y. (2021). Fast Computation and Bandwidth Selection Algorithms for Smoothing Functional Time Series. Working Papers CIE 143, Paderborn University.
# See vignette("DCSmooth") for examples and explanation y <- y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs(y)
# See vignette("DCSmooth") for examples and explanation y <- y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs(y)
Assign a Kernel Function
kernel.assign(kernel_id)
kernel.assign(kernel_id)
kernel_id |
a string specifying the kernel identifier as given in the details. |
kernel.assign
returns an object of class "function". This
function takes two arguments, a numeric vector in the first argument and a
single number in the second. The function itself will return a matrix with
one column and the same number of rows as the input vector.
kernel.assign
sets a pointer to a specified kernel function available
in the DCSmooth package. The kernels are boundary kernels of the form
, where
and
q = [0, 1]. Kernels are of the Müller-Wang type ("MW"), Müller type ("M")
or truncated kernels ("TR").
Müller, H.-G. and Wang, J.-L. (1994). Hazard rate estimation under random censoring with varying kernels and bandwidths. Biometrics, 50:61-76.
Müller, H.-G. (1991). Smooth optimum kernel estimators near endpoints. Biometrika, 78:521-530.
Feng, Y. and Schäfer B. (2021). Boundary Modification in Local Regression. Working Papers CIE 144, Paderborn University.
# See vignette("DCSmooth") for further examples and explanation u <- seq(from = -1, to = 0.5, length.out = 151) kern_MW220 <- kernel.assign("MW_220") k <- kern_MW220(u, 0.5) plot(u, k, type = "l")
# See vignette("DCSmooth") for further examples and explanation u <- seq(from = -1, to = 0.5, length.out = 151) kern_MW220 <- kernel.assign("MW_220") k <- kern_MW220(u, 0.5) plot(u, k, type = "l")
Print a list of available kernels in the DCSmooth package
kernel.list(print = TRUE)
kernel.list(print = TRUE)
print |
Logical value. Should the list be printed to the console? If
|
If print = FALSE
, a list is returned containing the kernel
identifiers
kernel.list
is used to get a list of available kernels in the DCSmooth
package.
kernel.list
prints a list of identifiers kernel_id
of available
kernels in the DCSmooth package. The available kernel types are "T":
truncated, "MW": Müller-Wang boundary correction, "M": Müller boundary
correction.
Müller, H.-G. and Wang, J.-L. (1994). Hazard rate estimation under random censoring with varying kernels and bandwidths. Biometrics, 50:61-76.
Müller, H.-G. (1991). Smooth optimum kernel estimators near endpoints. Biometrika, 78:521-530.
Feng, Y. and Schäfer B. (2021). Boundary Modification in Local Regression. Working Papers CIE 144, Paderborn University.
# See vignette("DCSmooth") for further examples and explanation kernel.list()
# See vignette("DCSmooth") for further examples and explanation kernel.list()
plot
method for class "dcs"
## S3 method for class 'dcs' plot(x, ...)
## S3 method for class 'dcs' plot(x, ...)
x |
an object of class "dcs_options", usually, a result of a call to
|
... |
Additional arguments passed to |
No return value.
plot.dcs
provides a contour plot of either the original data (1),
smoothed surface (2) or residuals (3).
surface.dcs
to plot the surface.
## Contour plot of smoothed surface y <- y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs_object <- dcs(y) plot(dcs_object, plot_choice = 2)
## Contour plot of smoothed surface y <- y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs_object <- dcs(y) plot(dcs_object, plot_choice = 2)
print
method for class "dcs"
## S3 method for class 'dcs' print(x, ...)
## S3 method for class 'dcs' print(x, ...)
x |
an object of class "dcs", usually, a result of a call to
|
... |
Additional arguments passed to |
No return value.
print.dcs
prints a short summary of an object of class dcs
,
only including bandwidths and the estimated variance coefficient (only if
automatic bandwidth selection is used).
y <- y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs_object <- dcs(y) print(dcs_object) dcs_object
y <- y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs_object <- dcs(y) print(dcs_object) dcs_object
print
method for class "dcs_options"
## S3 method for class 'dcs_options' print(x, ...)
## S3 method for class 'dcs_options' print(x, ...)
x |
an object of class "dcs_options", usually, a result of a call
to |
... |
Additional arguments passed to |
No return value.
print.dcs_options
prints the main options and
summary.dcs_options
prints main and advanced (IPI) options used for
the dcs
function. Arguments should be an object of class
"dcs_options"
.
print.dcs
, summary.dcs_options
## Default options myOpt <- set.options() print(myOpt) summary(myOpt) ## Use Kernel regression myOpt <- set.options(type = "KR") print(myOpt) summary(myOpt)
## Default options myOpt <- set.options() print(myOpt) summary(myOpt) ## Use Kernel regression myOpt <- set.options(type = "KR") print(myOpt) summary(myOpt)
print
method for class "summary_dcs"
## S3 method for class 'summary_dcs' print(x, ...)
## S3 method for class 'summary_dcs' print(x, ...)
x |
An object of class |
... |
Additional arguments passed to |
No return value.
print
methods for class "summary_sarma"
/
"summary_sfarima"
## S3 method for class 'summary_sarma' print(x, ...) ## S3 method for class 'summary_sfarima' print(x, ...)
## S3 method for class 'summary_sarma' print(x, ...) ## S3 method for class 'summary_sfarima' print(x, ...)
x |
An object of class |
... |
Additional arguments passed to |
No return value.
Returns the residuals of an object of class "dcs"
.
## S3 method for class 'dcs' residuals(x, ...)
## S3 method for class 'dcs' residuals(x, ...)
x |
an object of class |
... |
Additional arguments passed to |
Returns the -matrix of residuals.
y = y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs_object = dcs(y) residuals(dcs_object)
y = y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs_object = dcs(y) residuals(dcs_object)
The (log-) returns of the shares of the German insurance company Allianz SE
from 2007-01-02 to 2010-12-30 aggregated to 5-minute observations. The data
is adjusted to matrix form for direct use with the DCSmooth
-functions.
returns.alv
returns.alv
A numeric matrix with 1016 rows representing the days and 101 columns representing the intraday time points.
Parametric Estimation of an -process on a
lattice.
sarma.est(Y, method = "HR", model_order = list(ar = c(1, 1), ma = c(1, 1))) qarma.est(Y, model_order = list(ar = c(1, 1), ma = c(1, 1)))
sarma.est(Y, method = "HR", model_order = list(ar = c(1, 1), ma = c(1, 1))) qarma.est(Y, model_order = list(ar = c(1, 1), ma = c(1, 1)))
Y |
A numeric matrix that contains the demeaned observations of the random field or functional time-series. |
method |
Method used for estimation of the parameters. One of |
model_order |
A list containing the orders of the SARMA model in the
form |
The function returns an object of class "sarma"
including
Y |
The matrix of observations, inherited from input. |
innov The estimated innovations. |
|
model |
The estimated model consisting of the coefficient
matrices ar and ma and standard deviation of innovations
sigma . |
stnry |
An logical variable indicating whether the estimated model is stationary. |
The MA- and AR-parameters of a top-left quadrant ARMA process are estimated
by the specified method. The lag-orders of the are given by
, where
are the lags over the rows and
are the lags over the columns. The estimation process is based on the model
.
# See vignette("DCSmooth") for examples and explanation ## simulation of SARMA process ma <- matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar <- matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) sigma <- 0.5 sarma_model <- list(ar = ar, ma = ma, sigma = sigma) sarma_simulated <- sarma.sim(100, 100, model = sarma_model) sarma_simulated$model ## estimation of SARMA process sarma.est(sarma_simulated$Y)$model sarma.est(sarma_simulated$Y, model_order = list(ar = c(1, 1), ma = c(1, 1)))$model
# See vignette("DCSmooth") for examples and explanation ## simulation of SARMA process ma <- matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar <- matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) sigma <- 0.5 sarma_model <- list(ar = ar, ma = ma, sigma = sigma) sarma_simulated <- sarma.sim(100, 100, model = sarma_model) sarma_simulated$model ## estimation of SARMA process sarma.est(sarma_simulated$Y)$model sarma.est(sarma_simulated$Y, model_order = list(ar = c(1, 1), ma = c(1, 1)))$model
-processsarma.sim
simulates a specified SARMA-model
on a lattice with normally distributed innovations.
sarma.sim(n_x, n_t, model) qarma.sim(n_x, n_t, model)
sarma.sim(n_x, n_t, model) qarma.sim(n_x, n_t, model)
n_x |
Number of simulated observation rows. |
n_t |
Number of simulated observation columns. |
model |
A list containing the coefficient matrices |
The function returns an object of class "sarma"
, consisting of
Y |
A -matrix of simulated values
of the specified SARMA process. |
innov |
The innovations used for simulation, iid. drawn from a
normal distribution with zero mean and variance
. |
model |
The model used for simulation, inherited from input. |
stnry |
An logical variable indicating whether the simulated model is stationary. |
Simulation of a top-left dependent spatial ARMA process (SARMA). This
function returns an object of class "sarma"
. The simulated innovations
are created from a normal distribution with specified variance
.
see the vignette for further details.
# See vignette("DCSmooth") for examples and explanation ma <- matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar <- matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) sigma <- 0.5 sarma_model <- list(ar = ar, ma = ma, sigma = sigma) sarma_sim <- sarma.sim(100, 100, model = sarma_model) summary(sarma_sim)
# See vignette("DCSmooth") for examples and explanation ma <- matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar <- matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) sigma <- 0.5 sarma_model <- list(ar = ar, ma = ma, sigma = sigma) sarma_sim <- sarma.sim(100, 100, model = sarma_model) summary(sarma_sim)
Set Options for the DCS procedure
set.options( type = "LP", kerns = c("MW_220", "MW_220"), drv = c(0, 0), var_model = "iid", ... )
set.options( type = "LP", kerns = c("MW_220", "MW_220"), drv = c(0, 0), var_model = "iid", ... )
type |
either local polynomial regression ( |
kerns |
a character vector of length 2 containing the identifier for the
kernels to be used in kernel regression. Weighting functions in local
polynomial regression are computed according to the identifier. Default value
is |
drv |
A non-negative vector of length 2, containing the derivative
orders to be estimated from the given data. The default is |
var_model |
the method of estimating the variance coefficient |
... |
Additional arguments passed to |
An object of class "dcs_options"
.
This function is used to set the options for bandwidth selection in the
dcs
function.
Detailed information can be found in the vignette.
# See vignette("DCSmooth") for examples and explanation set.options() myOpt <- set.options(type = "KR", var_model = "iid") y <- y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs(y, dcs_options = myOpt)
# See vignette("DCSmooth") for examples and explanation set.options() myOpt <- set.options(type = "KR", var_model = "iid") y <- y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs(y, dcs_options = myOpt)
Parametric Estimation of a -process on a
lattice.
sfarima.est(Y, model_order = list(ar = c(1, 1), ma = c(1, 1)))
sfarima.est(Y, model_order = list(ar = c(1, 1), ma = c(1, 1)))
Y |
A numeric matrix that contains the demeaned observations of the random field or functional time-series. |
model_order |
A list containing the orders of the SFARIMA model in the
form |
The function returns an object of class "sfarima"
including
Y |
The matrix of observations, inherited from input. |
innov The estimated innovations. |
|
model |
The estimated model consisting of the coefficient
matrices ar and ma , the estimated long memory parameters
d and standard deviation of innovations sigma . |
stnry |
An logical variable indicating whether the estimated model is stationary. |
The MA- and AR-parameters as well as the long-memory parameters
of a
SFARIMA process are estimated by minimization of the residual sum of squares
RSS. Lag-orders of are given by
, where
are
the lags over the rows and
are the lags over the
columns. The estimated process is based on the (separable) model
, where
.
# See vignette("DCSmooth") for examples and explanation ## simulation of SFARIMA process ma <- matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar <- matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) d <- c(0.1, 0.1) sigma <- 0.5 sfarima_model <- list(ar = ar, ma = ma, d = d, sigma = sigma) sfarima_sim <- sfarima.sim(50, 50, model = sfarima_model) ## estimation of SFARIMA process sfarima.est(sfarima_sim$Y)$model sfarima.est(sfarima_sim$Y, model_order = list(ar = c(1, 1), ma = c(0, 0)))$model
# See vignette("DCSmooth") for examples and explanation ## simulation of SFARIMA process ma <- matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar <- matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) d <- c(0.1, 0.1) sigma <- 0.5 sfarima_model <- list(ar = ar, ma = ma, d = d, sigma = sigma) sfarima_sim <- sfarima.sim(50, 50, model = sfarima_model) ## estimation of SFARIMA process sfarima.est(sfarima_sim$Y)$model sfarima.est(sfarima_sim$Y, model_order = list(ar = c(1, 1), ma = c(0, 0)))$model
-processsfarima.sim
simulates a specified SFARIMA-model
on a lattice with normally distributed innovations.
sfarima.sim(n_x, n_t, model)
sfarima.sim(n_x, n_t, model)
n_x |
Number of simulated observation rows. |
n_t |
Number of simulated observation columns. |
model |
A list containing the coefficient matrices |
The function returns an object of class "sfarima"
, consisting
of
Y |
A -matrix of simulated values
of the specified SFARIMA process. |
innov |
The innovations used for simulation, iid. drawn from a
normal distribution with zero mean and variance
. |
model |
The model used for simulation, inherited from input. |
stnry |
An logical variable indicating whether the simulated model is stationary. |
Simulation of a separable spatial fractionally ARIMA process (SFARIMA). This
function returns an object of class "sfarima"
. The simulated
innovations are created from a normal distribution with specified variance
.
see the vignette for further details.
# See vignette("DCSmooth") for examples and explanation ma <- matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar <- matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) d <- c(0.1, 0.1) sigma <- 0.5 sfarima_model <- list(ar = ar, ma = ma, d = d, sigma = sigma) sfarima_sim <- sfarima.sim(100, 100, model = sfarima_model) surface.dcs(sfarima_sim$Y)
# See vignette("DCSmooth") for examples and explanation ma <- matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar <- matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) d <- c(0.1, 0.1) sigma <- 0.5 sfarima_model <- list(ar = ar, ma = ma, d = d, sigma = sigma) sfarima_sim <- sfarima.sim(100, 100, model = sfarima_model) surface.dcs(sfarima_sim$Y)
summary
method for class "dcs"
## S3 method for class 'dcs' summary(object, ...)
## S3 method for class 'dcs' summary(object, ...)
object |
an object of class "dcs", usually, a result of a call to
|
... |
Additional arguments passed to the |
The function summary.dcs
returns an object of class
summary_dcs
including
h_opt |
estimated optimal bandwidth from the IPI-procedure. |
c_f |
estimated variance factor. |
iterations |
number of iterations of the IPI-procedure. |
time_used |
time spend searching for optimal bandwidths (not overall runtime of the function). |
var_est |
estimated variance model. Has class "sarma" if an SARMA model is used and class "sfarima" if an SFARIMA model is used. |
var_model_id |
identifier for the variance model estimated. |
var_model_order |
order of the estimated variance model, if either SARMA or SFARIMA is used. |
dcs_options |
an object of class cds_options containing the
initial options of the dcs procedure. |
summary.dcs
strips an object of class "dcs"
from all large
matrices (Y
, X
, T
, M
, R
), allowing
for easier handling of meta-statistics of the bandwidth selection procedure.
print.summary_dcs
returns a list of summary statistics
from the dcs procedure. The output depends on the use of the dcs
-
function. If automatic bandwidth selection is chosen, summary.dcs
prints detailed statistics of the type of regression, the estimated
bandwidths h_x
, h_t
, the variance coefficient c_f
and
performance statistics such as the number of iterations of the IPI-algorithm
and the time used for bandwidth selection.
The method used for estimation of the variance coefficient is printed and the results of an SARMA/SFARIMA-estimation, if available.
If bandwidths are supplied to dcs
, summary.dcs
only prints
the given bandwidths.
y <- y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs_object <- dcs(y) summary(dcs_object)
y <- y.norm1 + matrix(rnorm(101^2), nrow = 101, ncol = 101) dcs_object <- dcs(y) summary(dcs_object)
summary
method for class "dcs_options"
## S3 method for class 'dcs_options' summary(object, ...)
## S3 method for class 'dcs_options' summary(object, ...)
object |
an object of class "dcs_options", usually, a result of a call
to |
... |
Additional arguments passed to |
No return value.
print.dcs_options
prints the main options and
summary.dcs_options
prints main and advanced (IPI) options used for
the dcs
function. Arguments should be an object of class
"dcs_options"
.
## Default options myOpt <- set.options() print(myOpt) summary(myOpt) ## Use Kernel regression myOpt <- set.options(type = "KR") print(myOpt) summary(myOpt)
## Default options myOpt <- set.options() print(myOpt) summary(myOpt) ## Use Kernel regression myOpt <- set.options(type = "KR") print(myOpt) summary(myOpt)
summary
method for class "sarma" or "sfarima"
## S3 method for class 'sarma' summary(object, ...) ## S3 method for class 'sfarima' summary(object, ...)
## S3 method for class 'sarma' summary(object, ...) ## S3 method for class 'sfarima' summary(object, ...)
object |
an object of class "sarma" or "sfarima", usually a result of a
call to the estimation functions |
... |
Additional arguments passed to the |
The function summary.sarma
/summary.sfarima
returns an
object of class summary_sarma
including
model |
estimated or simulated model parameters including
coefficient matrices ar , ma , the error term standard deviation
sigma and the vector of long memory parameters d
(summary.sarma only) |
model_order |
order of the estimated/simulated model computed from
the matrices ar , ma . |
stnry |
a flag for stationarity of the short memory part. |
subclass |
a flag indicating whether the object inherits from an
estimation (subclass = "est" ) or simulation procedure
(subclass = "sim" ). |
summary.sarma
/summary.sfarima
strips an object of class
"sarma"/"sfarima" from all large matrices (Y
, innov
), allowing
for easier handling of meta-statistics of the bandwidth selection procedure.
print.summary_sarma
/print.summary_sarma
returns a list of
summary statistics from the estimation or simulation procedure.
sarma.est, sfarima.est, sarma.sim,
sfarima.sim
# SARMA Simulation and Estimation ma = matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar = matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) sigma = 0.5 sarma_model = list(ar = ar, ma = ma, sigma = sigma) sarma_sim = sarma.sim(100, 100, model = sarma_model) summary(sarma_sim) sarma_est = sarma.est(sarma_sim$Y) summary(sarma_est) # SFARIMA Simulation and Estimation ma = matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar = matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) d = c(0.1, 0.1) sigma = 0.5 sfarima_model = list(ar = ar, ma = ma, d = d, sigma = sigma) sfarima_sim = sfarima.sim(100, 100, model = sfarima_model) summary(sfarima_sim) sfarima_est = sfarima.est(sfarima_sim$Y) summary(sfarima_est)
# SARMA Simulation and Estimation ma = matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar = matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) sigma = 0.5 sarma_model = list(ar = ar, ma = ma, sigma = sigma) sarma_sim = sarma.sim(100, 100, model = sarma_model) summary(sarma_sim) sarma_est = sarma.est(sarma_sim$Y) summary(sarma_est) # SFARIMA Simulation and Estimation ma = matrix(c(1, 0.2, 0.4, 0.1), nrow = 2, ncol = 2) ar = matrix(c(1, 0.5, -0.1, 0.1), nrow = 2, ncol = 2) d = c(0.1, 0.1) sigma = 0.5 sfarima_model = list(ar = ar, ma = ma, d = d, sigma = sigma) sfarima_sim = sfarima.sim(100, 100, model = sfarima_model) summary(sfarima_sim) sfarima_est = sfarima.est(sfarima_sim$Y) summary(sfarima_est)
3D Surface Plot of "dcs"-object or numeric matrix
surface.dcs(Y, trim = c(0, 0), plot_choice = "choice", ...)
surface.dcs(Y, trim = c(0, 0), plot_choice = "choice", ...)
Y |
an object of class |
trim |
a numeric vector with two values specifying the percentage of trimming applied to the boundaries of the surface to plot. Useful for derivative estimation. |
plot_choice |
override the prompt to specify a plot, can be
|
... |
optional arguments passed to the plot function. |
dcs.3d
returns an object of class "plotly" and "htmlwidget".
surface.dcs
uses the plotly device to plot the 3D surface of the given
"dcs"
-object or matrix. If a "dcs"-object is passed to the function,
it can be chosen between plots of the original data (1), smoothed surface
(2) and residuals (3).
# See vignette("DCSmooth") for examples and explanation smth <- dcs(y.norm1 + rnorm(101^2)) surface.dcs(smth, trim = c(0.05, 0.05), plot_choice = 2)
# See vignette("DCSmooth") for examples and explanation smth <- dcs(y.norm1 + rnorm(101^2)) surface.dcs(smth, trim = c(0.05, 0.05), plot_choice = 2)
This dataset contains the 5-minute observations of the 2020 temperature in
Nunn, CO. The data is from the U.S. Climate Reference Network database at
www.ncdc.noaa.gov.
(see Diamond et al., 2013). The observations were adjusted matrix form for
direct use with the DCSmooth
-functions.
temp.nunn
temp.nunn
A numeric matrix with 366 rows and 288 columns containing the temperatures in Celsius.
This dataset contains the 5-minute observations of the 2020 temperature in
Yuma, AZ. The data is from the U.S. Climate Reference Network database at
www.ncdc.noaa.gov.
(see Diamond et al., 2013). The observations were adjusted matrix form for
direct use with the DCSmooth
-functions.
temp.yuma
temp.yuma
A numeric matrix with 366 rows and 288 columns containing the temperatures in Celsius.
The trading volumes of the shares of the German insurance company Allianz SE
from 2007-01-02 to 2010-09-30 aggregated to 5-minute observations. The data
is adjusted to matrix form for direct use with the DCSmooth
-functions.
volumes.alv
volumes.alv
A numeric matrix with 1016 rows representing the days and 102 columns representing the intraday time points.
This dataset contains the 5-minute observations of the 2020 wind speed in
Nunn, CO. The data is from the U.S. Climate Reference Network database at
www.ncdc.noaa.gov.
(see Diamond et al., 2013). The observations were adjusted matrix form for
direct use with the DCSmooth
-functions.
wind.nunn
wind.nunn
A numeric matrix with 366 rows and 288 columns containing the
wind speed in .
This dataset contains the 5-minute observations of the 2020 wind speed in
Yuma, AZ. The data is from the U.S. Climate Reference Network database at
www.ncdc.noaa.gov.
(see Diamond et al., 2013). The observations were adjusted matrix form for
direct use with the DCSmooth
-functions.
wind.yuma
wind.yuma
A numeric matrix with 366 rows and 288 columns containing the
wind speeds in .
Example data for using the DCSmooth functions. Data resembles a single
gaussian peak on the interval
with maximum at
and variance matrix
, where
represents the
identity matrix.
y.norm1
y.norm1
A numeric matrix with 101 rows and 101 columns.
Example data for using the DCSmooth functions. Data resembles two gaussian
peaks on the interval with maxima
at
with variance matrix
and at
with variance matrix
, where
represents the
identity matrix.
y.norm2
y.norm2
A numeric matrix with 101 rows and 101 columns.
Example data for using the DCSmooth functions. Data resembles two gaussian
ridges on the interval with maxima
at
with variance matrix
and at
with variance matrix
, where
represents the
identity matrix.
y.norm3
y.norm3
A numeric matrix with 101 rows and 101 columns.