ucm: Unobserved components methods for a time series

Description Usage Arguments Details Value See Also Examples

Description

Function ucm decomposes a time series into components such as trend, seasonal, cycle, and the regression effects due to predictor series using Unobserved Components Model (UCM).

Usage

1
2
3
4
ucm(formula, data, irregular = TRUE, irregular.var = NA, level = TRUE,
  level.var = NA, slope = FALSE, slope.var = NA, season = FALSE,
  season.length = NA, season.var = NA, cycle = FALSE, cycle.period = NA,
  cycle.var = NA)

Arguments

formula

an object of class formula containing the symbolic description of the model with dependent and independent terms. If there are no independent terms, replace rhs with 0.

data

a required data frame or list containing variables in the model.

irregular

logical; if irregular component is to be included in the model. Defaults to TRUE.

irregular.var

value to fix variance of irregular component.

level

logical; if level is to be included in the model. Defaults to TRUE.

level.var

value to fix variance of level component.

slope

logical; if slope is to be included in the model along with level. Defaults to FALSE.

slope.var

value to fix variance of the slope component.

season

logical; if seasonal component is to be included in the model. Defaults to FALSE.

season.length

value of length of seasonal component. Required when season is included.

season.var

value to fix variance of seasonal component.

cycle

logical; if cyclical component is to be included in the model. Defaults to FALSE.

cycle.period

length of cyclical component. Required when cycle is included.

cycle.var

value to fix variance of cyclical component.

Details

Formula of the model can be of the forma as in lm with response variable on rhs and predictor variables or 0 (if no predictor variables) on the rhs.

Value

object of class ucm, which is a list with the following components:

est

Estimates of predictor variables, if present.

irr.var

Estimated variance of irregular component, if present.

est.var.level

Estimated variance of the level component, if present.

est.var.slope

Estimated variance of slope of the level, if present.

est.var.season

Estimated variance of the seasonal component, if present.

est.var.cycle

Estimated variance of the cyclical component, if present.

s.level

An object of the same class as of dependent variable containing the time varying level values, if level is present.

s.lope

An object of the same class as of dependent variable containing the time varying slope values, if slope is present.

s.season

An object of the same class as of dependent variable containing the time varying seasonal values, if season is present.

s.cycle

An object of the same class as of dependent variable containing the time varying cyclical values, if cycle is present.

vs.level

A vector containing time varying estimated variance of level, if level is present.

vs.slope

A vector containing time varying estimated variance of slope, if slope is present.

vs.season

A vector containing time varying estimated variance of seasonal component, if season is present.

vs.cycle

A vector containing time varying estimated variance of cyclical component, if cycle is present.

call

Original call of the function.

model

The original model of class SSModel from KFAS package.

See Also

KFAS, SSModel for a detailed discussion on State Space Models.

Examples

1
2
3
modelNile <- ucm(Nile~0, data = Nile, slope = TRUE)
modelNile
modelNile$s.level

Example output

Loading required package: KFAS
Call:
ucm(formula = Nile ~ 0, data = Nile, slope = TRUE)

Parameter estimates:
NULL

Estimated variance:
Irregular_Variance     Level_Variance     Slope_Variance 
        14706.3488          1742.8776             0.0037 
Time Series:
Start = 1871 
End = 1970 
Frequency = 1 
  [1] 1120.8009 1117.4788 1109.1175 1118.0728 1116.1336 1108.9957 1095.8132
  [8] 1116.1474 1122.9887 1100.5562 1073.4490 1055.6391 1052.1264 1041.7550
 [15] 1037.0432 1034.3513 1040.4710 1030.0549 1047.0217 1074.5386 1094.2975
 [22] 1113.3805 1121.0129 1125.2097 1114.6172 1086.7950 1043.1863 1001.1402
 [29]  947.3782  914.1638  889.7388  867.1794  865.1441  854.2378  845.8487
 [36]  854.6263  856.1307  877.0868  881.1062  865.1100  836.8018  809.1814
 [43]  791.4195  813.4091  834.1440  870.5398  877.3717  857.8198  841.3280
 [50]  834.0008  828.2145  829.5646  829.0858  824.4694  815.4054  820.2556
 [57]  822.1736  833.3563  848.9664  841.9368  844.7365  855.0898  864.2687
 [64]  875.7314  879.1034  870.0440  857.7901  849.7778  822.7773  801.9132
 [71]  795.9715  807.4479  814.3556  821.5425  838.1563  859.1736  858.7608
 [78]  858.2011  855.7691  854.2579  848.5107  855.1494  874.3680  897.8965
 [85]  903.3988  907.1706  901.6000  908.4256  913.5237  911.3360  920.5651
 [92]  918.0096  916.8773  917.6264  888.4659  856.5162  837.6638  809.1721
 [99]  791.4852  782.9813

rucm documentation built on May 2, 2019, 11:05 a.m.