fit.mar1s {mar1s} | R Documentation |
Fit Multiplicative AR(1) with Seasonal Process to Data
Description
Fits Multiplicative AR(1) with Seasonal process model to time series.
Usage
fit.mar1s(x, xreg = NULL, seasonal.fun = seasonal.smooth, ...)
Arguments
x |
A univariate time series. |
xreg |
A univariate or multivariate time series of external regressors, or
|
seasonal.fun |
A function which takes a univariate time series as its first argument and returns the estimated seasonal component. |
... |
Additional arguments passed to |
Value
An object of class "mar1s"
with the following components:
logseasonal |
Estimated log-seasonal figure (a univariate or multivariate time series object). |
logstoch.ar1 |
AR(1) with external regressors model fitted for the log-stochastic
component (an object of class |
logresid.sd |
Standard deviation of the residuals. |
decomposed |
An object of class |
See Also
compose.mar1s
for MAR(1)S process formal definition and
composition/decomposition functions, seasonal.ave
,
seasonal.smooth
for seasonal component extraction
functions, sim.mar1s
for MAR(1)S process simulation and
prediction.
Examples
data(forest.fire, package = "mar1s")
data(nesterov.index, package = "mar1s")
## Simple
mar1s <- fit.mar1s(forest.fire)
plot(mar1s$logseasonal)
confint(mar1s$logstoch.ar1)
mar1s$logresid.sd
resid <- nan2na(mar1s$decomposed$logresid)
qqnorm(resid)
qqline(resid)
## External regressors
mar1s <- fit.mar1s(forest.fire, nesterov.index[, "mean"])
plot(cbind(mar1s$logseasonal, mar1s$logseasonal.r))
confint(mar1s$logstoch.ar1)
resid <- nan2na(mar1s$decomposed$logresid)
qqnorm(resid)
qqline(resid)