time series forecasting using Support Vector Machine

5.6k views Asked by At

What are the attributes used in time series to be forecasted using SVM? I have two values the date and the value at that date for the class I already know that I can use -1 and 1 when price gets up or down but still don't know how to plot the time series to calculate the hyperplane

1

There are 1 answers

3
Pedrom On BEST ANSWER

There are some papers that show some ways to do it:

Financial time series forecasting using support vector machine

Using Support Vector Machines in Financial Time Series Forecasting

Financial Forecasting Using Support Vector Machines

I really recommend that you go through the existent literature, but just for fun I will describe an easy way (probably not the best) to do it.

Let's say you have N pairs f where f is the particular date/time of the pair and f its corresponding value. The pairs are sorted by its X component.

Let's say you want to predict if given f, the corresponding unknown value f will go up or down (Notice that you could also use regression and instead try to predict the value itself).

Then we could train a model with a training set like this:

Input                         Value
======================        ================ 
y_t0, y_t1, ..., y_ti-1         1 :if y_ti   > y_ti-1, -1 otherwise
y_t1, y_t2, ..., y_ti           1 :if y_ti+1 > y_ti,   -1 otherwise
y_t2, y_t3, ..., y_ti+1         1 :if y_ti+2 > y_ti+1, -1 otherwise
y_t3, y_t4, ..., y_ti+2         1 :if y_ti+3 > y_ti+2, -1 otherwise
y_t4, y_t5, ..., y_ti+3         1 :if y_ti+4 > y_ti+3, -1 otherwise

Basically, you will be training the algorithm to make an educated guess of the next "tick" in the future by given to it a glimpse of the past. Once your model is trained to make a prediction you feed the model with the N values (where N is the amount of values you used as input in your training phase) previous to the value you want to predict.