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?


If you don't explicitly model such constraints, there is no way for the SVM to adhere to them. Without adding constraints, the outputs of SVM regression can be any real number.

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.

  • $\begingroup$ 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? $\endgroup$ May 6 '16 at 9:34
  • $\begingroup$ By transforming your original regression targets (which I assume are absolute numbers) to % increases. As the logistic transform is nonlinear, it often implies a different optimal underlying model (the SVM), hence different hyperparameters. $\endgroup$ May 6 '16 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.