inst/doc/rucm_vignettes.R

## ----install, echo = T, message = F, eval = T----------------------------
#install.packages("rucm")
library(rucm)

## ----modelNile, echo = TRUE, cache=FALSE---------------------------------
modelNile <- ucm(formula = Nile~0, data = Nile, level = TRUE)
modelNile #Printing method for class ucm
plot(Nile, ylab = "Flow of Nile")
lines(modelNile$s.level, col = "blue")
legend("topright", legend = c("Observed flow","S_level"), col = c("black","blue"), lty = 1)

## ----forecast, echo = TRUE, eval = TRUE----------------------------------
modelNile <- ucm(formula = Nile~0, data = Nile, level = TRUE, slope = TRUE)
predict(modelNile$model, n.ahead = 12) # Forecasting

Try the rucm package in your browser

Any scripts or data that you put into this service are public.

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