Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in predicting future values using UCM (Unobserved Components Model) #18

Open
MarcoVende opened this issue Nov 29, 2021 · 0 comments

Comments

@MarcoVende
Copy link

MarcoVende commented Nov 29, 2021

Hey team,
I'm using a Unobserved Components Model to predict future values using several independent variables.

Demand <- read.csv2("Demand.csv") 
# e.g. sample(x = 800 : 15000, size =50)
Cars <- read.csv2("Cars.csv")
#e.g. sample(x = 500 : 800, size =50)
Duration (1-60), Distance (300 and 3000) Rain (between 0 and 500), Sun_hrs (0-12), Temperatur (-3 to 27), Wind (0 to 80)
...
Multivariate_DataFrame <- data.frame(Demand, Cars, Duration, Distance, Rain, Sun, Temperature, Wind)
head(Multivariate_DataFrame)

library(rucm)

ucm_xyz <- ucm(formula = Demand ~ Cars + Duration + Distance + Rain + Regulars + Sun + Temperature + Wind, data = Multivariate_DataFrame, level = TRUE, slope = TRUE, irregular = TRUE, season = TRUE, season.length =12)
print(ucm_xyz)
fitted.values(ucm_xyz$model)

So far the model works and I'm happy with the fitted values.

But when forecasting,

predict(ucm_xyz["model"],newdata = 6)

The error message:

Error in meanf(object, h = h, level = level, fan = fan, lambda = lambda,  : 
  unused argument (newdata = 6)

occurs.

Any help would be fantastic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant