1
$\begingroup$

I am studying multivariate linear regression, trying to fit by the rule of thumb a multivariate model that predicts a target dataset $T$ over three datasets $D_1,D_2,D_3$, (blue, orange, green), all of them normalized.

scatter plot of <span class=$T$ against $D_1$, $D_2$, and $D_3$ (blue, orange, green).">

The scatter plot shows that the data sets contain outliers, and are differently correlated with the target dataset, with lines that represent the regression lines fitting $T$ with the datasets. These are the lines I traced by eye, basically just specifying a value for the slope.

I am trying to fit a regressor by eye, not using any quantitative method as OLS, just checking the plots of $T$ and of the residuals vs. the data.

%--------------------------------------------------------------------------

1) I checked the clouds of points, and concluded that one dataset, the green one $D_3$, is strongly uncorrelated with $T$, so it must be dropped. Is it a reasonable conclusion? I checked the Pearson cross-correlation matrix, and the correlation coefficient between $T$ and $D_3$ is -0.11.

%--------------------------------------------------------------------------

2) To proceed heuristically, I think this way: $$ y=\beta_1 x_1+\beta_2 x_2+\epsilon $$ is my regression model, so I set $\beta_i$ as the slope relative to the data from dataset $D_i$. By looking at the previous figure, I establish two values $\beta_1=1.2$ and $\beta_2=1$.

To check these values I plot the residuals, knowing that they should look like Gaussian noise, and I obtain the following plot:

scatter plot of the residuals against <span class=$D_1$ and $D_2$ (blue and orange)">

The lines represent the slope of the residuals I found w.r. to $D_1$ and $D_2$, so now I imagine that $\epsilon=\varepsilon+\alpha_1 x_1+\alpha_2 x_2$, where $\varepsilon$ is really a Gaussian noise, while the $\alpha$'s should be summed to the $\beta$'s. Always by eye, I get $\alpha_1=-0.7$, and $\alpha_2=-0.9$. After correcting the $\beta$'s, the correlation model looks like this:

scatter plot of <span class=$T$ against $D_1$ and $D_2$ (blue and orange), using the corrected slopes.">

At this point, I expect the residuals to look like Gaussian noise, while instead they look like depending on $D_1$ and $D_2$, as in the following picture:

scatter plot of the residuals against <span class=$D_1$ and $D_2$ (blue and orange), using the corrected slopes. The black line has slope 1.5">

The black line has a slope of 1.5.

%--------------------------------------------------------------------------

(I apologize for the very long description of the procedure)

I notice that my reasoning is not helping me in fitting a regression model. How would you solve this problem?

Using OLS, I found out that $\beta_1=0.743$ and $\beta_2=0.266$.

$\endgroup$
4
  • $\begingroup$ I think the Thiel-Sen estimator en.wikipedia.org/wiki/Theil%E2%80%93Sen_estimator is worth looking at, scikit-learn has an implementation, and because it is so useful, many other statistics packages also have it available. $\endgroup$ Commented Aug 8, 2019 at 1:36
  • $\begingroup$ If you are trying to eyeball by minimizing residuals are you not trying to heuristically run OLS? And, what is the point of doing this by winging it—is there a goal behind this approach? $\endgroup$
    – Brennan
    Commented Aug 8, 2019 at 5:42
  • $\begingroup$ @Brennan the OLS results I got them just to see how far I was from a "real" solution. I got a similar problem in a job interview. They wanted me to give values to the coefficients of the model by using just two informations, that are the two graphs I am showing above, plus the adjusted R-squared computed using these coefficients. $\endgroup$
    – marco
    Commented Aug 8, 2019 at 7:02
  • $\begingroup$ thats an interesting interview problem! So you get the plots of data and the ability to check the adjusted $R^2$? I suppose one way is to do guesswork, another (time permitting) way would be to try and eyeball as many of the points as possible and create a series and do OLS by hand. I feel like theres more to the problem than just winging it and trying to get as close to OLS as possible though, they're probably trying to see the way you solve problems, interesting nonetheless $\endgroup$
    – Brennan
    Commented Aug 8, 2019 at 16:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.