hi,
I am doing uni variate forecasting by using SVM in r. I did my in sample forecast precisely but when i do forecast for some next time period it gives the same values. here are codes.
lagged_data<-y[complete.cases(y),]
View(lagged_data)
n<-dim(lagged_data)[1]
train_data<-lagged_data[1:(n-24),]
test_data<-lagged_data[(n-23):n,]
modelsvm = svm(inflation~.,train_data)
predYsvm = predict(modelsvm, test_data)
forecast<-data.frame(test_data$inflation, predYsvm)
till now it did good but it is in sample forecast but when i do for out sample forecast it repeats the training values.
out_predYsvm = predict(modelsvm, h=24)
hi,
I am doing uni variate forecasting by using SVM in r. I did my in sample forecast precisely but when i do forecast for some next time period it gives the same values. here are codes.
lagged_data<-y[complete.cases(y),]
View(lagged_data)
n<-dim(lagged_data)[1]
train_data<-lagged_data[1:(n-24),]
test_data<-lagged_data[(n-23):n,]
modelsvm = svm(inflation~.,train_data)
predYsvm = predict(modelsvm, test_data)
forecast<-data.frame(test_data$inflation, predYsvm)
till now it did good but it is in sample forecast but when i do for out sample forecast it repeats the training values.
out_predYsvm = predict(modelsvm, h=24)