Linear Regression with two variables

3 views (last 30 days)
Matthias Gattiker
Matthias Gattiker on 11 May 2015
Answered: Matthias Gattiker on 11 May 2015
I am working with a data set of Volatility Swap prices, i.e. a matrix, where the rows represent dates, the columns maturities and the entries prices. My goal is now, to find coefficients and two functions, such that
a+b*v_t+c*v'_t = V_t(t+T)
where I know the right hand side from the data and try to find v_t and v'_t. I can fix the parameters a,b and c and minimize over the error at the end, but I do not know, how I can program Matlab to find the best data points v_t and v'_t for t running through time.
  1 Comment
Ingrid
Ingrid on 11 May 2015
I do not know how to do this but I know the CAPTAIN toolbox provided functionalities for fitting when dealing with time series so you might want to google this to see if it suits your needs

Sign in to comment.

Answers (2)

Torsten
Torsten on 11 May 2015
So a, b, c, V_t(t+T) are given und you search for (time-varying) v_t and v'_t to make
a+b*v_t+c*v'_t = V_t(t+T)
?
Choose v_t = 0 and v'_t = (V_t(t+T)-a)/c.
I guess this is not what you want, but you will have to explain more clearly what you are trying to do.
Best wishes
Torsten.

Matthias Gattiker
Matthias Gattiker on 11 May 2015
I know that V_t(t+T) follows approximately a certain formula, i.e. a+b*v_t+c*v'_t. I do know the V_t(t+T) exactly, as they are data points. So I would like to perform linear regression to get the best v_t and v'_t. The problem I am having, is that normally you have two sets of data on which you perform linear regression. If we fix t, I have 17 data points, one for each T, but still, I cannot figure out a matlab command which then performs a linear regression on these data points on which I can figure out v_t and v'_t.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!