R6 class for ARMA(p, q) model

Note

Version 1.0.2

See also

stats::arima() which is wrapped in the method fit.

Public fields

control

list, to contain custom control parameters.

model_name

character(1), standard model name.

Active bindings

arOrder

integer(1), Autoregressive order.

maOrder

integer(1), Moving-Average order.

order

named numeric vector of size 2. Orders of the ARMA model: the first element is the arOrder, while the second the maOrder.

intercept

named integer(1), intercept of the model.

phi

named numeric vector of size arOrder, AR parameters. If arOrder = 0, the parameter is zero.

theta

named numeric vector of size maOrder, MA parameters. If maOrder = 0, the parameter is zero.

coefficients

named numeric vector of size arOrder + maOrder + 1. The first element ie sthe intercept, then the ARMA parameters.

std.errors

Numeric named vector, standard errors of the intercept and ARMA parameters.

sigma2

integer(1), std.errors of the residuals.

A

numeric matrix of size (arOrder + maOrder) x (arOrder + maOrder). See the function ARMA_companion_matrix for more details.

b

numeric vector of size arOrder + maOrder. See the function ARMA_vector_b for more details.

tidy

Tibble with estimated parameters and standard errors.

Methods


Method new()

Initialize an ARMA model

Usage

ARMA_modelR6$new(arOrder = 1, maOrder = 1, include.intercept = FALSE)

Arguments

arOrder

integer(1), order of the Autoregressive component.

maOrder

integer(1), order of the Moving-Average component.

include.intercept

logical(1), the default is FALSE. When TRUE the intercept will be included.


Method fit()

Fit the ARMA model with arima function.

Usage

ARMA_modelR6$fit(x)

Arguments

x

numeric vector, time series to fit.


Method filter()

Filter the time-series and compute fitted values and residuals. See the function ARMA_filter for more details.

Usage

ARMA_modelR6$filter(x)

Arguments

x

numeric vector, time series to filter.


Method next_step()

Next step function. See the function ARMA_next_step for more details.

Usage

ARMA_modelR6$next_step(x, n.ahead = 1, eps = 0)

Arguments

x

Numeric vector, state vector with past observations and residuals.

n.ahead

integer(1), number of steps ahead.

eps

optional numeric vector of length n.ahead, next step realized residuals.


Method expectation()

Forecast expected value. See the function ARMA_expectation for more details.

Usage

ARMA_modelR6$expectation(h = 1, X0)

Arguments

h

integer(1), number of steps ahead.

X0

numeric vector of size p + q. State vector of past values.


Method variance()

Forecast variance. See the function ARMA_variance for more details.

Usage

ARMA_modelR6$variance(h = 1, sigma2 = 1)

Arguments

h

integer(1), number of steps ahead.

sigma2

integer(1), standard deviation of the residuals.


Method update()

Update the model's parameters

Usage

ARMA_modelR6$update(coefficients)

Arguments

coefficients

Numeric named vector, model's coefficients. If missing nothing will be updated.


Method update_std.errors()

Update the standard errors of the parameters.

Usage

ARMA_modelR6$update_std.errors(std.errors)

Arguments

std.errors

Numeric named vector, parameters' standard errors. If missing nothing will be updated.


Method update_sigma2()

Update the variance of the residuals.

Usage

ARMA_modelR6$update_sigma2(sigma2)

Arguments

sigma2

integer(1), variance of the residuals.


Method print()

Print method for ARMA_modelR6 class.

Usage

ARMA_modelR6$print()


Method clone()

The objects of this class are cloneable with this method.

Usage

ARMA_modelR6$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.