I have a problem making time series predictions with SVM and Matlab. I tried to solve the problem by myself in several ways without success.
I downloaded, compiled and installed LibSVM scripts for Matlab. But I don't know how to format my data in input. I mean, I have a time series that is an array of values, something like:
x=[1 2 3 4 5 6 7 8 9 10]
I want to use 70% of the vector as a training sequence of the SVM:
x1=[1 2 3 4 5 6 7]
Then I have to predict the last three values of the time series and I have to calculate the error between predicted values and the array [8 9 10].
I have to understand:
How to set SVM parameters. But there is a script that I found here that is the Matlab version of easy.py. So problem solved.
How to format my time series in order to be "acceptable" with easy.py (easy.m), svmtrain and svmpredict.
On LibSVM FAQ website I found this procedure [code]:
matlab> SPECTF = csvread('SPECTF.train'); % read a csv file
matlab> labels = SPECTF(:, 1); % labels from the 1st column
matlab> features = SPECTF(:, 2:end);
matlab> features_sparse = sparse(features); % features must be in a sparse matrix
matlab> libsvmwrite('SPECTFlibsvm.train', labels, features_sparse);
But I think this is a procedure for classification. From my point of view, how do I distinguish labels and features if I have only a simple array of values?
Here I found a similar procedure, but it is not clear if the script really works or not (I obtain a translated version of the input)
Can anyone help me?
