python Python中的多元回归

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1151088/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 21:35:07  来源:igfitidea点击:

Multiple regression in Python

pythonmathscipyregression

提问by Thomas Browne

I am currently using scipy's linregress function for single regression. I am unable to find if the same library, or another, is able to do multiple regression, that is, one dependent variable and more than one independent variable. I'd like to avoid R if possible. If you're wondering, I am doing FX market analysis with the goal of replicating one currency pair with multiple other currency pairs. Anyone help? Thanks,

我目前正在使用 scipy 的 linregress 函数进行单回归。我无法找到同一个库或另一个库是否能够进行多元回归,即一个因变量和多个自变量。如果可能,我想避免使用 R。如果您想知道,我正在做外汇市场分析,目的是将一种货币对与多种其他货币对复制。有人帮忙吗?谢谢,

Thomas

托马斯

回答by wierob

Use the OLS class [http://www.scipy.org/Cookbook/OLS]from the SciPy cookbook.

使用SciPy 食谱中的 OLS 类 [ http://www.scipy.org/Cookbook/OLS]

回答by nikow

I'm not sure if this is what you need, but the Modular toolkit for Data Processing (MDP)libray recently implemented multivariate linear regression. It is under LGPL license.

我不确定这是否是您所需要的,但用于数据处理 (MDP)库的模块化工具包最近实现了多元线性回归。它在 LGPL 许可下。