简体   繁体   中英

python pandas OLS.predict, what is the correct signature?

I am having a pandas OLS model,

mid_lag_lead_df_model

-------------------------Summary of Regression Analysis-------------------------

Formula: Y ~ <1> + <2> + <3> +

Number of Observations: 56 Number of Degrees of Freedom: 4

R-squared: 0.2864 Adj R-squared: 0.2452

Rmse: 0.0001

F-stat (3, 52): 6.9554, p-value: 0.0005

Degrees of Freedom: model 3, resid 52

-----------------------Summary of Estimated Coefficients------------------------

  Variable Coef Std Err t-stat p-value CI 2.5% CI 97.5% 

  1 0.0527 0.0268 1.97 0.0547 0.0001 0.1053 2 -0.0009 0.0269 -0.03 0.9730 -0.0537 0.0519 3 0.0980 0.0268 3.66 0.0006 0.0455 0.1505 intercept 0.0000 0.0000 1.59 0.1184 -0.0000 0.0000 

---------------------------------End of Summary---------------------------------

If i need to predict, the y value from [0.000207, -0.000361, -0.000091]

mid_lag_lead_df_model.predict

what the signature should be using predict as above?

你可以这样做来计算y这是你的独立变量向量:

mid_lag_lead_df_model.beta.dot(pandas.Series([0.000207, -0.000361, -0.000091]))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM