fit.mar1s: Fit Multiplicative AR(1) with Seasonal Process to Data

Description Usage Arguments Value See Also Examples

Description

Fits Multiplicative AR(1) with Seasonal process model to time series.

Usage

1
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 NULL.

seasonal.fun

A function which takes a univariate time series as its first argument and returns the estimated seasonal component.

...

Additional arguments passed to seasonal.fun.

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 "Arima").

logresid.sd

Standard deviation of the residuals.

decomposed

An object of class "mar1s.ts" containing decomposed time series (see compose.mar1s).

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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)

Example output

Loading required package: cmrutils
Loading required package: chron
Loading required package: fda
Loading required package: splines
Loading required package: Matrix
Loading required package: fds
Loading required package: rainbow
Loading required package: MASS
Loading required package: pcaPP
Loading required package: RCurl

Attaching package:fdaThe following object is masked frompackage:graphics:

    matplot

Loading required package: zoo

Attaching package:zooThe following objects are masked frompackage:base:

    as.Date, as.Date.numeric

        2.5 %    97.5 %
ar1 0.6774523 0.7334565
[1] 0.8567558
                   2.5 %    97.5 %
ar1            0.6399382 0.6998776
nan2na(y$rest) 0.4305606 0.5716993

mar1s documentation built on May 2, 2019, 3:40 p.m.

Related to fit.mar1s in mar1s...