Skip to content

Instantly share code, notes, and snippets.

@vftools
Forked from emielrv/example.R
Last active August 29, 2015 14:27
Show Gist options
  • Save vftools/65f73679dcfd2e680612 to your computer and use it in GitHub Desktop.
Save vftools/65f73679dcfd2e680612 to your computer and use it in GitHub Desktop.
Example code for using the Time Series Analysis Tool
library(devtools)
devtools::install_github("veneficusnl/vf_model_time_series")
library(vfmodels.timeseries)
data('EIA')
train <- 1:(nrow(data) - 5)
labels <- data$Date
x <- data$Value
model <- get_model(x = x,method = 'time_series', lag = 2, labels = labels, family = gaussian('log'), train = train )
summary(model)
plot(model)
#Prediction is still very unreliable and should be looked at closer.
res <- predict(model, x = x, n.ahead = 2, labels = labels, train = train)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment