Api 参考 Statsmodels 0 14 4 Statsmodels 文档

Leo Migdal
-
api 参考 statsmodels 0 14 4 statsmodels 文档

statsmodels.api: 横截面模型和方法。通常使用 import statsmodels.api as sm 导入。 statsmodels.tsa.api: 时间序列模型和方法。通常使用 import statsmodels.tsa.api as tsa 导入。 statsmodels.formula.api: 用于使用公式字符串和 DataFrame 指定模型的便捷接口。此 API 直接公开支持公式 API 的模型的 from_formula 类方法。通常使用 import statsmodels.formula.api as smf 导入 API 重点关注模型以及最常用的统计检验和工具。 导入路径和结构 解释了这两个 API 模块的设计以及如何从 API 导入与直接从定义模型的模块导入的不同之处。有关可用模型、统计信息和工具的完整列表,请参阅 用户指南 中的详细主题页面。 WLS(endog, exog[, weights, missing, hasconst]) The main statsmodels API is split into models:

statsmodels.api: Cross-sectional models and methods. Canonically imported using import statsmodels.api as sm. statsmodels.tsa.api: Time-series models and methods. Canonically imported using import statsmodels.tsa.api as tsa. statsmodels.formula.api: A convenience interface for specifying models using formula strings and DataFrames. This API directly exposes the from_formula class method of models that support the formula API.

Canonically imported using import statsmodels.formula.api as smf The API focuses on models and the most frequently used statistical test, and tools. Import Paths and Structure explains the design of the two API modules and how importing from the API differs from directly importing from the module where the model is defined. See the detailed topic pages in the User Guide for a complete list of available models, statistics, and tools. statsmodels 是一个 Python 模块,提供用于估计各种统计模型的类和函数,以及用于进行统计检验和统计数据探索的类和函数。每个估计器都提供广泛的统计结果列表。结果经过测试,与现有的统计包进行比较,以确保其正确性。该包是在开源的 Modified BSD (3-clause) 许可下发布的。在线文档托管在 statsmodels.org。 statsmodels 支持使用 R 风格公式和 pandas DataFrame 来指定模型。以下是一个使用普通最小二乘法的简单示例

查看 dir(results) 以查看可用的结果。属性在 results.__doc__ 中描述,结果方法有自己的文档字符串。 Seabold, Skipper 和 Josef Perktold。 "statsmodels:Python 的计量经济学和统计建模。” 第九届 Python in Science 大会论文集。 2010 年。 statsmodels 提供数据集(即数据 *和* 元数据)供在示例、教程、模型测试等中使用。 该 Rdatasets 项目 提供对 R 的核心数据集包以及许多其他常用 R 包中可用数据集的访问。所有这些数据集都可通过使用 get_rdataset 函数供 statsmodels 使用。实际数据可通过 data 属性访问。例如 get_rdataset(dataname[, package, cache]) 该 Dataset 对象遵循 bunch 模式。完整数据集可在 data 属性中获得。

如果数据集没有对什么是 endog 和 exog 的明确解释,那么您始终可以访问 data 或 raw_data 属性。这适用于 macrodata 数据集,它是一组美国宏观经济数据,而不是具有特定示例的特定数据集。 data 属性包含完整数据集的记录数组,raw_data 属性包含一个 ndarray,其中列的名称由 names 属性给出。 statsmodels is using github to store the updated documentation. Two version are available: Development, the latest build of the main branch API stability is not guaranteed for new features, although even in this case changes will be made in a backwards compatible way if possible. The stability of a new feature depends on how much time it was already in statsmodels main and how much usage it has already seen.

If there are specific known problems or limitations, then they are mentioned in the docstrings. This release bring official Pyodide support to a statsmodel release. It is otherwise identical to the previous release. Special thanks to Agriya Khetarpal for working through Pyodide-specific issues, and improving other areas of statsmodels while doing so. statsmodels.api: 横截面模型和方法。通常通过 import statsmodels.api as sm 导入。 statsmodels.tsa.api: 时间序列模型和方法。通常通过 import statsmodels.tsa.api as tsa 导入。

statsmodels.formula.api: 一个用于使用公式字符串和DataFrame指定模型的便捷接口。此API直接公开了支持公式API的模型的from_formula类方法。通常通过import statsmodels.formula.api as smf导入 该API专注于模型和最常用的统计检验及工具。 导入路径和结构解释了两个API模块的设计以及从API导入与直接从定义模型的模块导入的区别。请参阅用户指南中的详细主题页面,以获取可用模型、统计数据和工具的完整列表。 WLS(endog, exog[, weights, missing, hasconst]) 这个非常简单的案例研究旨在帮助您快速上手使用 statsmodels。从原始数据开始,我们将展示估计统计模型和绘制诊断图所需的步骤。我们只使用 statsmodels 或其 pandas 和 patsy 依赖项提供的函数。 pandas 基于 numpy 数组提供丰富的 数据结构和数据分析工具。 pandas.DataFrame 函数提供标记的 (可能异构的) 数据数组,类似于 R 的“data.frame”。pandas.read_csv 函数可用于将逗号分隔值文件转换为 DataFrame 对象。 patsy 是一个 Python 库,用于描述统计模型和使用类似于 R 的公式构建设计矩阵。

本示例使用 API 接口。有关导入 API 接口 (statsmodels.api 和 statsmodels.tsa.api) 与直接从定义模型的模块导入之间的区别,请参见导入路径和结构。 我们下载了Guerry 数据集,这是一个用于支持 Andre-Michel Guerry 1833 年的《法国道德统计学论文》的历史数据集合。该数据集以逗号分隔值格式 (CSV) 形式托管在Rdatasets 存储库中。我们可以将文件下载到本地,然后使用 read_csv 加载它,但是 pandas 会自动为我们完成所有这些操作 There was an error while loading. Please reload this page.

People Also Search

Statsmodels.api: 横截面模型和方法。通常使用 Import Statsmodels.api As Sm 导入。 Statsmodels.tsa.api: 时间序列模型和方法。通常使用 Import

statsmodels.api: 横截面模型和方法。通常使用 import statsmodels.api as sm 导入。 statsmodels.tsa.api: 时间序列模型和方法。通常使用 import statsmodels.tsa.api as tsa 导入。 statsmodels.formula.api: 用于使用公式字符串和 DataFrame 指定模型的便捷接口。此 API 直接公开支持公式 API 的模型的 from_formula 类方法。通常使用 import statsmodels.formula.api as smf 导入 API 重点关注模型以及最常用的统计检验和工具。 导入路径和结构 解释了这两个 API 模块的设计以及如何从 API 导入与直接从定义模型的模块导入的不同之处。有关可用模型、统计信息和工具的完整列表,请参阅 用户指南 中的详细主题页面。 ...

Statsmodels.api: Cross-sectional Models And Methods. Canonically Imported Using Import Statsmodels.api

statsmodels.api: Cross-sectional models and methods. Canonically imported using import statsmodels.api as sm. statsmodels.tsa.api: Time-series models and methods. Canonically imported using import statsmodels.tsa.api as tsa. statsmodels.formula.api: A convenience interface for specifying models using formula strings and DataFrames. This API directly exposes the from_formula class method of models ...

Canonically Imported Using Import Statsmodels.formula.api As Smf The API Focuses

Canonically imported using import statsmodels.formula.api as smf The API focuses on models and the most frequently used statistical test, and tools. Import Paths and Structure explains the design of the two API modules and how importing from the API differs from directly importing from the module where the model is defined. See the detailed topic pages in the User Guide for a complete list of avai...

查看 Dir(results) 以查看可用的结果。属性在 Results.__doc__ 中描述,结果方法有自己的文档字符串。 Seabold, Skipper 和 Josef Perktold。

查看 dir(results) 以查看可用的结果。属性在 results.__doc__ 中描述,结果方法有自己的文档字符串。 Seabold, Skipper 和 Josef Perktold。 "statsmodels:Python 的计量经济学和统计建模。” 第九届 Python in Science 大会论文集。 2010 年。 statsmodels 提供数据集(即数据 *和* 元数据)供在示例、教程、模型测试等中使用。 该 Rdatasets 项目 提供对 R 的核心数据集包以及许多其他常用 R 包中可用数据集的访问。所有这些数据集都可通过使用 get_rdataset 函数供 statsmodels 使用。实际数据可通过 data 属性访问。例如 get_rdataset(dataname[, package, cache]) 该 Dataset 对象遵循 bunch 模式。...

如果数据集没有对什么是 Endog 和 Exog 的明确解释,那么您始终可以访问 Data 或 Raw_data 属性。这适用于 Macrodata

如果数据集没有对什么是 endog 和 exog 的明确解释,那么您始终可以访问 data 或 raw_data 属性。这适用于 macrodata 数据集,它是一组美国宏观经济数据,而不是具有特定示例的特定数据集。 data 属性包含完整数据集的记录数组,raw_data 属性包含一个 ndarray,其中列的名称由 names 属性给出。 statsmodels is using github to store the updated documentation. Two version are available: Development, the latest build of the main branch API stability is not guaranteed for new features, although even in this case changes wi...