How to approximate linear relationship between two timeseries?

129 Views Asked by At

I have two time series A and B

I would like to solve for the equation in the form $$y_t = m x_t + b$$ that transforms a point $y$ at time $t$ from series $B$ to the corresponding point $x$ at time $t$ from $A$.

How do I approximate $m$ and $b$ given $A$ and $B$?

Is there an easy way to do this in MATLAB or Excel?

1

There are 1 best solutions below

2
On BEST ANSWER

You are looking for a linear regression.

In Excel, if $A$ data is in A1:A7 and $B$ data is in B1:B7, select two cells and in the formula enter =LINEST(B1:B7, A1:A7,TRUE,FALSE) and press Ctrl-Shift-Enter. The first number will be $m$, the second -- $b$.

Look up here for MATLAB