statsmodels.regression.linear_model.RegressionResults
statsmodels.regression.linear_model.RegressionResults
*class statsmodels.regression.linear_model.RegressionResults(model, params, normalized_cov_params=None, scale=1.0, cov_type=‘nonrobust’, cov_kwds=None, use_t=None, *kwargs)[source]
详细的注释回头再写~
This class summarizes the fit of a linear regression model
It handles the output of contrasts, estimates of covariance, etc.
Returns:
- aic – Akaike’s information criteria. For a model with a constant −2llf+2(df_model+1)−2llf+2(df_model+1). For a model without a constant −2llf+2(df_model)−2llf+2(df_model).
- bic – Bayes’ information criteria. For a model with a constant −2llf+log(n)(df_model+1)−2llf+log(n)(df_model+1). For a model without a constant −2llf+log(n)(df_model)−2llf+log(n)(df_model)
- bse – The standard errors of the parameter estimates.
- pinv_wexog – See specific model class docstring
- centered_tss – The total (weighted) sum of squares centered about the mean.
- cov_HC0 – Heteroscedasticity robust covariance matrix. See HC0_se below.
- cov_HC1 – Heteroscedasticity robust covariance matrix. See HC1_se below.
- cov_HC2 – Heteroscedasticity robust covariance matrix. See HC2_se below.
- cov_HC3 – Heteroscedasticity robust covariance matrix. See HC3_se below.
- cov_type – Parameter covariance estimator used for standard errors and t-stats
- df_model – Model degrees of freedom. The number of regressors p. Does not include the constant if one is present
- df_resid – Residual degrees of freedom. n - p - 1, if a constant is present. n - p if a constant is not included.
- ess – Explained sum of squares. If a constant is present, the centered total sum of squares minus the sum of squared residuals. If there is no constant, the uncentered total sum of squares is used.
- fvalue – F-statistic of the fully specified model. Calculated as the mean squared error of the model divided by the mean squared error of the residuals.
- f_pvalue – p-value of the F-statistic
- fittedvalues – The predicted values for the original (unwhitened) design.
- het_scale – adjusted squared residuals for heteroscedasticity robust standard errors. Is only available after HC#_se or cov_HC# is called. See HC#_se for more information.
- history – Estimation history for iterative estimators
- HC0_se – White’s (1980) heteroskedasticity robust standard errors. Defined as sqrt(diag(X.T X)^(-1)X.T diag(e_i^(2)) X(X.T X)^(-1) where e_i = resid[i] HC0_se is a cached property. When HC0_se or cov_HC0 is called the RegressionResults instance will then have another attribute het_scale, which is in this case is just resid**2.
- HC1_se – MacKinnon and White’s (1985) alternative heteroskedasticity robust standard errors. Defined as sqrt(diag(n/(n-p)*HC_0) HC1_see is a cached property. When HC1_se or cov_HC1 is called the RegressionResults instance will then have another attribute het_scale, which is in this case is n/(n-p)*resid**2.
- HC2_se – MacKinnon and White’s (1985) alternative heteroskedasticity robust standard errors. Defined as (X.T X)^(-1)X.T diag(e_i^(2)/(1-h_ii)) X(X.T X)^(-1) where h_ii = x_i(X.T X)^(-1)x_i.T HC2_see is a cached property. When HC2_se or cov_HC2 is called the RegressionResults instance will then have another attribute het_scale, which is in this case is resid^(2)/(1-h_ii).
- HC3_se – MacKinnon and White’s (1985) alternative heteroskedasticity robust standard errors. Defined as (X.T X)^(-1)X.T diag(e_i(2)/(1-h_ii)(2)) X(X.T X)^(-1) where h_ii = x_i(X.T X)^(-1)x_i.T HC3_see is a cached property. When HC3_se or cov_HC3 is called the RegressionResults instance will then have another attribute het_scale, which is in this case is resid(2)/(1-h_ii)(2).
- model – A pointer to the model instance that called fit() or results.
- mse_model – Mean squared error the model. This is the explained sum of squares divided by the model degrees of freedom.
- mse_resid – Mean squared error of the residuals. The sum of squared residuals divided by the residual degrees of freedom.
- mse_total – Total mean squared error. Defined as the uncentered total sum of squares divided by n the number of observations.
- nobs – Number of observations n.
- normalized_cov_params – See specific model class docstring
- params – The linear coefficients that minimize the least squares criterion. This is usually called Beta for the classical linear model.
- pvalues – The two-tailed p values for the t-stats of the params.
- resid – The residuals of the model.
- resid_pearson – wresid normalized to have unit variance.
- rsquared – R-squared of a model with an intercept. This is defined here as 1 - ssr/centered_tss if the constant is included in the model and 1 - ssr/uncentered_tss if the constant is omitted.
- rsquared_adj – Adjusted R-squared. This is defined here as 1 - (nobs-1)/df_resid * (1-rsquared) if a constant is included and 1 - nobs/df_resid * (1-rsquared) if no constant is included.
- scale – A scale factor for the covariance matrix. Default value is ssr/(n-p). Note that the square root of scale is often called the standard error of the regression.
- ssr – Sum of squared (whitened) residuals.
- uncentered_tss – Uncentered sum of squares. Sum of the squared values of the (whitened) endogenous response variable.
- wresid – The residuals of the transformed/whitened regressand and regressor(s)
Methods
HC0_se
() See statsmodels.RegressionResults
HC1_se
() See statsmodels.RegressionResults
HC2_se
() See statsmodels.RegressionResults
HC3_se
() See statsmodels.RegressionResults
aic
()
bic
()
bse
()
centered_tss
()
compare_f_test
(restricted) use F test to test whether restricted model is correct
compare_lm_test
(restricted[, demean, use_lr]) Use Lagrange Multiplier test to test whether restricted model is correct
compare_lr_test
(restricted[, large_sample]) Likelihood ratio test to test whether restricted model is correct
condition_number
() Return condition number of exogenous matrix.
conf_int
([alpha, cols]) Returns the confidence interval of the fitted parameters.
cov_HC0
() See statsmodels.RegressionResults
cov_HC1
() See statsmodels.RegressionResults
cov_HC2
() See statsmodels.RegressionResults
cov_HC3
() See statsmodels.RegressionResults
cov_params
([r_matrix, column, scale, cov_p, …]) Returns the variance/covariance matrix.
eigenvals
() Return eigenvalues sorted in decreasing order.
ess
()
f_pvalue
()
f_test
(r_matrix[, cov_p, scale, invcov]) Compute the F-test for a joint linear hypothesis.
fittedvalues
()
fvalue
()
get_prediction
([exog, transform, weights, …]) compute prediction results
get_robustcov_results
([cov_type, use_t]) create new results instance with robust covariance as default
initialize
(model, params, **kwd)
llf
()
load
(fname) load a pickle, (class method)
mse_model
()
mse_resid
()
mse_total
()
nobs
()
normalized_cov_params
()
predict
([exog, transform]) Call self.model.predict with self.params as the first argument.
pvalues
()
remove_data
() remove data arrays, all nobs arrays from result and model
resid
()
resid_pearson
() Residuals, normalized to have unit variance.
rsquared
()
rsquared_adj
()
save
(fname[, remove_data]) save a pickle of this instance
scale
()
ssr
()
summary
([yname, xname, title, alpha]) Summarize the Regression Results
summary2
([yname, xname, title, alpha, …]) Experimental summary function to summarize the regression results
t_test
(r_matrix[, cov_p, scale, use_t]) Compute a t-test for a each linear hypothesis of the form Rb = q
t_test_pairwise
(term_name[, method, alpha, …]) perform pairwise t_test with multiple testing corrected p-values
tvalues
() Return the t-statistic for a given parameter estimate.
uncentered_tss
()
wald_test
(r_matrix[, cov_p, scale, invcov, …]) Compute a Wald-test for a joint linear hypothesis.
wald_test_terms
([skip_single, …]) Compute a sequence of Wald tests for terms over multiple columns
wresid
()
Attributes
use_t
statsmodels.regression.linear_model.RegressionResults相关推荐
- Python手册(Machine Learning)--statsmodels(Regression)
本站已停止更新,查看最新内容请移至本人博客 Wilen's Blog Regression Linear Regression(线性回归) Generalized Linear(广义线性回归) Gen ...
- Python 第三方模块 统计1 statsmodels模块1 简介,回归
官方文档:https://www.statsmodels.org/stable/user-guide.html\quadhttps://www.statsmodels.org/stable/api.h ...
- 数据分析系列之Python数据分析简介
Python是一门简单易学且功能强大的编程语言,使其在许多领域成为编写脚本或开发应用程序理想语言 .Python被称作"胶水语言",是由于其运行效率的问题,将程序核心部分由C++等 ...
- Python数模笔记-StatsModels 统计回归(2)线性回归
1.背景知识 1.1 插值.拟合.回归和预测 插值.拟合.回归和预测,都是数学建模中经常提到的概念,而且经常会被混为一谈. 插值,是在离散数据的基础上补插连续函数,使得这条连续曲线通过全部给定的离散数 ...
- python将学生信息保存到文件中_Python statsmodels OLS:如何将学习的模型保存到文件中...
模型和结果实例都有一个保存和加载方法,因此您不需要直接使用pickle模块. 编辑以添加示例: import statsmodels.api as sm data = sm.datasets.long ...
- statsmodels学习——使用多元回归拟合数据
文章目录 1. 多元回归拟合代码 2. 分析结果 3. 完整案例 参考资料 1. 多元回归拟合代码 首先构造一个任意的dataframe: import pandas as pd import num ...
- 理解statsmodels中OLS对应基金alpha、beta、R-squared
概解statsmodels <理解patsy & Design Matrices> To fit most of the models covered by statsmodels ...
- Python Statsmodels 统计包之 OLS 回归
Statsmodels 是 Python 中一个强大的统计分析包,包含了回归分析.时间序列分析.假设检 验等等的功能.Statsmodels 在计量的简便性上是远远不及 Stata 等软件的,但它的优 ...
- Python+statsmodels实现多元线性回归和泊松回归
statsmodels是python中专门用于统计学分析的包,它能够帮我们在模型未知的情况下来检验模型的线性显著性 更多回归模型见:statsmodels-formula-api 在建立回归方程前首先 ...
最新文章
- 反向区域DNS解析服务
- rt-thread 自动初始化机制分析-关于编译链接及段信息
- VMWare 安装 Linux
- Spring思维导图,让spring不再难懂(一)
- arp包多久发一次_多久洗一次头发合适?洗头越频繁,掉的头发越多?
- mac上的Android虚拟机,android虚拟机能在retina MacBook pro上跑吗?
- 阿里Java开发规范IDEA开发插件
- 海阔凭鱼跃:记一场工业场景下的AI技术实践
- 同济大学Python程序设计基础 实验二:数据表示和处理
- opencv-3.0.0-beta和opencv2版本的区别
- 造一个智能语音音箱!!!太简单了【语音智能管家】
- 【协议】NVMe over RoCE 初探 SATA接口(AHCI协议)、PCIe 接口(NVMe 协议)
- eventBus VSvueX
- 浪潮服务器安装windows操作系统找不到硬盘、识别不到阵列卡、找不到驱动器,免去各种驱动安装烦恼,浪潮懒人工程师福利
- 超详细的网络抓包神器 tcpdump 使用指南
- 华为系统怎么使用小米云服务器,从小米的MIUI换成华为EMUI,使用5个月,憋了一肚子的真心话...
- MySQL数据库技术
- 家长叫我别天天我在房间没事多看看新闻,我说我马上写个爬虫爬新闻看!!!
- VS2017 无法启动 IIS EXPRESS Web 服务器。 工作进程未能正确初始化,因而无法启动。返回的数据为错误信息。已解决!!!
- mysql安装2基本SQL命令3数据类型