Title: | Support Functions for Time Series Analysis Book |
---|---|
Description: | Contains the support functions for the Time Series Analysis book. We present a function to calculate MSE and MAE for inputs of actual and forecast values. We also have the code for disaggregation as found in Wei and Stram (1990, <doi:10.1111/j.2517-6161.1990.tb01799.x>), and Hodgess and Wei (1996, "Temporal Disaggregation of Time Series"). |
Authors: | Erin Hodgess [aut, cre] |
Maintainer: | Erin Hodgess <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-02-25 06:15:29 UTC |
Source: | https://github.com/cran/disagg2 |
Input an annual, quarterly series. Create a quarterly or monthly series via ARIMA
disag1(x, m)
disag1(x, m)
x |
Input ts, must have frequency of 1 or 4 |
m |
Order of disaggregation, must be 12, 4, or 3 |
Uses ARIMA model on the aggregate series to create a disaggregate series
y_s |
Disag. series to be summed |
y_m |
Disag. series mean |
disphi |
Disagg phi value |
distheta |
Disagg theta value |
dissig2 |
Disagg sigma2 |
William W.S. Wei and Daniel Stram, 1990, Disaggregation of Time Series Models, Journal of the Royal Statistics Society, B, Vol 52, Number 3, pp. 453-467. Erin M. Hodgess and William W.S. Wei, 1996, Temporal Disaggregation of Time Series, Applied Statistical Science I, pp. 33-43, Nova Science Publishers, Commack, NY
The inputs are the actual and the forecast values. We calculate the Mean Square Error (MSE) and Mean Absolute Error (MAE)
foremeas1(actx, forex)
foremeas1(actx, forex)
actx |
actual values |
forex |
forecast values |
MSE = mean((act-fore)^2), MAE = mean(abs(act-fore))
MSE |
Mean square error |
MAE |
Mean absolute error |
c( person( "Erin", "Hodgess", email = "[email protected]", role = c("aut", "cre") ) )
Create an nxn symmetric matrix from an n length vector
mySym(x)
mySym(x)
x |
input length n vector |
create an nxn symmetric matrix
y |
symmetric matrix |
c( person( "Erin", "Hodgess", email = "[email protected]", role = c("aut", "cre") ) )
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or standard data sets, see data(). mySym(1:6)
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or standard data sets, see data(). mySym(1:6)