UCsetup: UCsetup

View source: R/UCmodel.R

UCsetupR Documentation

UCsetup

Description

Sets up UC general univariate models

Usage

UCsetup(
  y,
  u = NULL,
  model = "?/none/?/?",
  h = 9999,
  lambda = 1,
  outlier = 9999,
  tTest = FALSE,
  criterion = "aic",
  periods = NA,
  verbose = FALSE,
  stepwise = FALSE,
  p0 = -9999.9,
  arma = FALSE,
  TVP = NULL,
  trendOptions = "none/rw/llt/dt",
  seasonalOptions = "none/equal/different",
  irregularOptions = "none/arma(0,0)"
)

Arguments

y

a time series to forecast (it may be either a numerical vector or a time series object). This is the only input required. If a vector, the additional input periods should be supplied compulsorily (see below).

u

a matrix of external regressors included only in the observation equation. (it may be either a numerical vector or a time series object). If the output wanted to be forecast, matrix u should contain future values for inputs.

model

the model to estimate. It is a single string indicating the type of model for each component. It allows two formats "trend/seasonal/irregular" or "trend/cycle/seasonal/irregular". The possibilities available for each component are:

  • Trend: ? / none / rw / irw / llt / dt / td;

  • Seasonal: ? / none / equal / different;

  • Irregular: ? / none / arma(0, 0) / arma(p, q) - with p and q integer positive orders;

  • Cycles: ? / none / combination of positive or negative numbers. Positive numbers fix the period of the cycle while negative values estimate the period taking as initial condition the absolute value of the period supplied. Several cycles with positive or negative values are possible and if a question mark is included, the model test for the existence of the cycles specified. The following are valid examples with different meanings: 48, 48?, -48, -48?, 48+60, -48+60, -48-60, 48-60, 48+60?, -48+60?, -48-60?, 48-60?.

h

forecast horizon. If the model includes inputs h is not used, the lenght of u is used instead.

lambda

Box-Cox transformation lambda, NULL for automatic estimation

outlier

critical level of outlier tests. If NA it does not carry out any outlier detection (default). A positive value indicates the critical minimum t test for outlier detection in any model during identification. Three types of outliers are identified, namely Additive Outliers (AO), Level Shifts (LS) and Slope Change (SC).

tTest

augmented Dickey Fuller test for unit roots used in stepwise algorithm (TRUE / FALSE). The number of models to search for is reduced, depending on the result of this test.

criterion

information criterion for identification ("aic", "bic" or "aicc").

periods

vector of fundamental period and harmonics required.

verbose

intermediate results shown about progress of estimation (TRUE / FALSE).

stepwise

stepwise identification procedure (TRUE / FALSE).

p0

initial parameter vector for optimisation search.

arma

check for arma models for irregular components (TRUE / FALSE).

TVP

vector of zeros and ones to indicate TVP parameters.

trendOptions

trend models to select amongst (e.g., "rw/llt").

seasonalOptions

seasonal models to select amongst (e.g., "none/differentt").

irregularOptions

irregular models to select amongst (e.g., "none/arma(0,1)").

Details

See help of UC.

Value

An object of class UComp. It is a list with fields including all the inputs and the fields listed below as outputs. All the functions in this package fill in part of the fields of any UComp object as specified in what follows (function UC fills in all of them at once):

After running UCmodel or UCestim:

  • p: Estimated parameters

  • v: Estimated innovations (white noise in correctly specified models)

  • yFor: Forecasted values of output

  • yForV: Variance of forecasts

  • criteria: Value of criteria for estimated model

  • iter: Number of iterations in estimation

  • grad: Gradient at estimated parameters

  • covp: Covariance matrix of parameters

After running UCvalidate:

  • table: Estimation and validation table

After running UCcomponents:

  • comp: Estimated components in matrix form

  • compV: Estimated components variance in matrix form

After running UCfilter, UCsmooth or UCdisturb:

  • yFit: Fitted values of output

  • yFitV: Estimated fitted values variance

  • a: State estimates

  • P: Variance of state estimates

  • aFor: Forecasts of states

  • PFor: Forecasts of states variances

After running UCdisturb:

  • eta: State perturbations estimates

  • eps: Observed perturbations estimates

Standard methods applicable to UComp objects are print, summary, plot, fitted, residuals, logLik, AIC, BIC, coef, predict, tsdiag.

Author(s)

Diego J. Pedregal

See Also

UC, UCmodel, UCvalidate, UCfilter, UCsmooth, UCdisturb, UCcomponents, UChp

Examples

## Not run: 
y <- log(AirPassengers)
m1 <- UCsetup(y)
m1 <- UCsetup(y, outlier = 4)
m1 <- UCsetup(y, model = "llt/equal/arma(0,0)")
m1 <- UCsetup(y, model = "?/?/?/?")
m1 <- UCsetup(y, model = "llt/?/equal/?", outlier = 4)

## End(Not run)

UComp documentation built on May 31, 2023, 7:41 p.m.

Related to UCsetup in UComp...