How to predict the use of a multidimensional regression function, which is the sum of other regression functions

I am doing multivariate regression in python using the weighted least squares method. I have a data set that is 10x4, in other words, there are 4 functions for each sample in the data.

If my dataset is X, I can do the following to get the regression function coefficients:

import numpy as np
import statsmodels.api as sm
from statsmodels.sandbox.regression.predstd import wls_prediction_std

mod_wls = sm.WLS(y, X)
res_wls = mod_wls.fit()
print res_wls.params

For my specific 10x4 dataset, this gives me the following result:

[ 0.06210193  5.24256099  0.15214974  0.12325115]

However, they told me that I needed to create a regression function g(X), by iterating over EACH x[i]in Xand summing up the various regression functions.

I suppose (but would like to be corrected if I misunderstood it), I suppose that means that g(x) = g(x1) + g(x2) + g(x3) + ... + g(x10)

, , . , :

[ 0.11  1.22  0.33  0.88]

[ 1.22  0.55  0.44  0.11]

, g(X) :

[ 1.33  1.77  0.77  0.99]

0.11 + 1.22 = 1.33 .. .

: scikit-learn?

, - ?

, , , , ?

+4
1

, , .

g (X1, X2, X3, X4) = 0,06210193 * X1 + 5.24256099 * X2 + 0.15214974 * X3 + 0.12325115 * X4

, : [0,11 1,22 0,33 0,88] (0,11,1,22,0,33,0,88) = 0,06210193 * 0,11 + 5,24256099 * 1,22 + 0,155214974 * 0,33 + 0,12325115 * 0,88

g (0,11,1,22,0,33,0,88) = 6,561426046

, : https://stats.stackexchange.com/questions/tagged/multiple-regression

0

Source: https://habr.com/ru/post/1537652/


All Articles