Merging Linear Regression

106 Views Asked by At

If I have built two linear regression models over sets $A$ and $B$, and now want a linear regression over set $A\cup{}B$.

Is there a way to reuse what I already have?

2

There are 2 best solutions below

0
On

This is a suggestion based on similar previous experience.

For sets A and B independently, you built a linear regression $Y=a + b X$ a,d now you want to consider the data coming from the union of A and B.

In a first step, I should perform a multilinear regression using as a model
$$Y = a + b Z + c X + d X Z$$ introducing a variable Z which would be given a value of $+1$ if the data point belongs to set A or $-1$ if the data point belongs to set B. Now, the standard analysis could apply to check if, yes or no, parameters $b$ and $d$ are significant. If they are, then using the union of the two sets could not be done.

I should like to know how you react to such a suggestion?

4
On

It seems my Q was not clear enough, actually I have built two linear regressions over A and B, say y = Ax+b over set A, and y = A'x+b' over set B. Now I have to build a new model on AUB. Is there a way to avoid doing calculations from scratch, and use what I have before?

If I want to add more details, the expensive part of calculating LR is the inversion operation.

http://upload.wikimedia.org/math/d/0/d/d0d47d9a941d17f3d099fa18b38b1736.png

When some points are added, then you have to re-calculate the inv(X^T * X). So I want to figure out if there is a way to reuse the previously calculated inversions (suppose we have saved them) for the new matrix? maybe using block matrix inversion...