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

Hey there,

I'm new in this forum. So if there are any missing information in the question I will deliver those as best as I can.

I'm using a Unobserved Components Model (rucm package) to predict future values using several independent variables.

Demand <- read.csv2("Demand.csv") 
# e.g. sample(x = 800 : 15000, size =46)
Cars <- read.csv2("Cars.csv")
#e.g. sample(x = 500 : 800, size =46)
...
Duration in min (1-60), Distance in m(300 and 3000) Rain in mm (between 0 and 500), Sun hours (0-12), Temperatur in °F (1 to 80), Wind in kmh (0 to 80)
Multivariate_DataFrame <- data.frame(Demand, Cars, Duration, Distance, Rain, Sun, Temperature, Wind)

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)
ucm_xyz$model

returns:

Call:
SSModel(formula = as.formula(ssm.formula), data = data, H = H)

State space model object of class SSModel

Dimensions:
[1] Number of time points: 46
[1] Number of time series: 1
[1] Number of disturbances: 3
[1] Number of states: 21
Names of the states:
 [1]  Cars Duration Distance Rain Regulars Sun Temperature 
 [8]  Wind level slope sea_dummy1 sea_dummy2 sea_dummy3 sea_dummy4     
[15]  sea_dummy5 sea_dummy6 sea_dummy7 sea_dummy8 sea_dummy9 sea_dummy10     sea_dummy11  
    
Distributions of the time series:
[1]  gaussian

Object is a valid object of class SSModel.

The summary function states that model has the length of 14, Class is SSModel and Mode is list.

When forecasting:

predict(ucm_xyz["model"],n.ahead = 6, newdata = Multivariate_Dataframe)

The error message:

Error in UseMethod("predict") : 
  no applicable method for 'predict' applied to an object of class "list"

occurs.

Any help would be fantastic

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.