### Name: hrm ### Title: Hidden Resolution Time Series Model ### Aliases: hrm ### Keywords: models ts ### ** Examples # ------------------------------------------------------------ # use the full time series to fit the model for the RIVER data # ------------------------------------------------------------ data(river) # fit the model (MCMC) river.hrm <- hrm(river, harms=c(6,3,2)) # view the posterior of the parameters plot(river.hrm) # follow by three empty/comment lines for R CMD CHECK # forecast (MCMC), three years ahead river.hrm <- hrm.fcast(river.hrm, window=3) # plots of forecasts plot.hrm.fcast(river.hrm, start=1991) # follow by three empty/comment lines for R CMD CHECK # --------------------------------------------------------------- # fit the model for the RIVER data (leaving off last three years) # --------------------------------------------------------------- # fit the model (MCMC) river.hrm <- hrm(river[1:(length(river)-3*12)], harms=c(6,3,2)) # view the posterior of the parameters plot(river.hrm) # follow by three empty/comment lines from R CMD CHECK # forecast (MCMC), three years ahead river.hrm <- hrm.fcast(river.hrm, window=3) # plots of forecasts, follow by three empty/comment lines plot.hrm.fcast(river.hrm, start=1988, truth=river[(length(river)-3*12+1):length(river)]) # -------------------------------------------------------------- # use the full time series to fit the model for the SUDESTE data # -------------------------------------------------------------- data(sudeste) # fit the model (MCMC) sudeste.hrm <- hrm(sudeste, harms=c(6,3)) # view the posterior of the parameters plot(sudeste.hrm) # forecast (MCMC), three years ahead sudeste.hrm <- hrm.fcast(sudeste.hrm, window=3) # plots of forecasts plot.hrm.fcast(sudeste.hrm, start=2001) # ----------------------------------------------------------------- # fit the model for the SUDESTE data (leaving off last three years) # ----------------------------------------------------------------- # fit the model (MCMC) sudeste.hrm <- hrm(sudeste[1:(length(sudeste)-3*12)], harms=c(6,3)) # view the posterior of the parameters plot(sudeste.hrm) # follow by three empty/comment lines for R CMD CHECK # forecast (MCMC), three years ahead sudeste.hrm <- hrm.fcast(sudeste.hrm, window=3) # plots of forecasts, follow by three empty/comment lines plot.hrm.fcast(sudeste.hrm, start=1998, truth=sudeste[(length(sudeste)-3*12+1):length(sudeste)])