# Support vector regression (LIBSVM) returns out of range outputs when I use out-of-sample data to predict one step ahead (MATLAB)?

I'm using SVR model in MATLAB R2016a using this option:

options_z = ['-q -s 3 -t 2 -c ', C_param, ' -p ', epsilon, ' -g ,Kernel_scale];


I'm optimizing SVR parameters using an optimization algorithm and normalize inputs using this function:

[new_input_features, PS] = mapminmax(input_series);


Inputs are some financial indicators (moving average, etc. - calculated using close, high and traded volume) from a bond and output is tomorrow close price. There is a restriction in data: all outputs (tomorrow price) values should be in [-5%, +5%] of previous price value. I'm using same normalization parameters (PS) to normalize out-of-sample data and after normalize inputs using above function I separate whole data for cross validation (should I normalize every fold in cross validation separately and test other fold with same normalization properties?).

This is the problem. When I use out-of-sample data (last 10% of whole samples that we know the real tomorrow price values), in more than ~75% cases I will get out of range (less than or more than 5%) next day price comparing to previous day price. Why I have this behavior in my model? I need normalize output data?

The most straightforward way to impose range constraints is by postprocessing the SVM predictions, for instance by applying the logistic function and then mapping $[0, 1]$ to $[-0.05, 0.05]$.
Note that postprocessing often changes the optimal hyperparameters ($\epsilon$, $\gamma$), so you would need to tune those again.
• Thank you for answer. So I should obtain output results from out-of-sample data and then using logistic function? Why this affect optimal hyperparameters? This is a step after model training. Isn't it? -0.05% and +0.05 are rate of change comparing to last day close price. How can I use logistic function in this case? May 6 '16 at 9:34