ellisp / forecastHybrid

Convenient functions for ensemble forecasts in R combining approaches from the {forecast} package
GNU General Public License v3.0
79 stars 23 forks source link

Error in forecasts[[j]]$upper[, i] : incorrect number of dimensions #58

Closed mbanco closed 7 years ago

mbanco commented 7 years ago
datos <- c(120993428, 106929033, 104674273, 87729480, 90490853, 93092843, 92036929, 95549077.7, 87869549.95, 97209064.3, 107229618.9, 127711642.8, 124792527.7, 113088874.7, 113327746.2, 91529840.3, 101789522.2, 107988992.1, 111080336.3, 115378202.4, 94868993.2, 104232444, 112259558, 128513103, 131687074.9, 114913799.8, 110346654, 98093388.5, 100060055.1, 113210251.4, 113263974.8, 107804431.7, 99720508.98, 103428656.2, 121021283.9, 132907628.2, 136057677.7, 128185824.9, 129501717.2, 103229077.4, 103300887, 113427487.2, 124141275.5, 110614730, 103834605, 109455819.3, 122472667.8, 140279327, 158514210.5, 139930173, 143982640.4, 106584021, 113787755.4, 119564578.8, 134451109.9, 126777099.7, 110351015.8, 112590675.7, 125040203.1, 154043011.7, 156459194.4, 133297676.2, 137362366.7, 117659908.6, 121238142.6, 133346352.7, 146313223.8, 133720676.5, 117457085.7, 122790721.9, 144402368.7, 168788629.3, 184250207.9, 162004124.6, 157568494.7, 123471564.4, 129316073, 140003685.2, 155255942.7, 147748549.5, 124860729.1, 133748225.5, 158452722.3, 190350272.5, 187631762.1, 174032770.3, 153106923.8, 130891088.3, 136363916.8, 144219179.3, 168568094.3, 157218161.9, 145627109.3, 149329890.8, 167372970.7, 213373086.7, 218665652, 156608050.8, 142766681.2, 132533907.5, 145523688.6, 159044256.6, 171640782.3, 151720619.2, 140130378.5, 163767092, 171200753.2, 204743304.5, 224287446.7, 181174118.8, 196109184.9)
ano_inicial <- c(2006)
mes_trim_inicial <- c(1)
period_proyec <- c(20)

nivel_confianza <- c(0.95)

library('forecastHybrid');

y <- ts(datos, frequency = 12, start = c(ano_inicial[1], mes_trim_inicial[1]), class = 'ts');

mdl <- hybridModel(y, weights='insample.errors', errorMethod='RMSE')

proy <- forecast(mdl, h=20, level=nivel_confianza[1]);

Best regards,

dashaub commented 7 years ago

This is caused by robjhyndman/forecast#450.

As a workaround for now, you can pass at least two values to level in forecast(mdl, h=20, level = c(95, 95)).

mbanco commented 7 years ago

Thanks David.

Regards

2016-12-30 16:25 GMT-03:00 David Shaub notifications@github.com:

This is caused by robjhyndman/forecast#450 https://github.com/robjhyndman/forecast/issues/450.

As a workaround for now, you can pass at least two values to level in forecast(mdl, h=20, level = c(95, 95)).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ellisp/forecastHybrid/issues/58#issuecomment-269811891, or mute the thread https://github.com/notifications/unsubscribe-auth/AHWbYsUkI7tp5x_LCfEumfJVNZpqNRZDks5rNVqZgaJpZM4LYLS- .

robjhyndman commented 7 years ago

Now fixed in https://github.com/robjhyndman/forecast/commit/dffc55d2ecf5846031578db57557d5fd07efd689

dashaub commented 7 years ago

Fully fixed here.