Questions tagged [statsmodels]

Statsmodels is a Python module that allows users to explore data, estimate statistical models, and perform statistical tests.

Homepage: http://www.statsmodels.org/

An extensive list of descriptive statistics, statistical tests, plotting functions, and result statistics are available for different types of data and each estimator. Features include:

  • Linear regression models
  • Generalized linear models
  • Discrete choice models
  • Robust linear models
  • Many models and functions for time series analysis
  • Nonparametric estimators
  • A collection of datasets for examples
  • A wide range of statistical tests
  • Input-output tools for producing tables in a number of formats (Text, LaTex, HTML) and for reading Stata files into NumPy and Pandas.
  • Plotting functions
  • Extensive unit tests to ensure correctness of results
  • Many more models and extensions in development
2841 questions
1
vote
1 answer

How do you pull values out of statsmodels.WLS.fit.summary?

This is the code I have so far. I am performing a weighted least squares operation, and am printing the results out. I want to use the results from the summary, but the summary is apparently not iterable. Is there a way to pull the values from the…
noggy
  • 149
  • 1
  • 2
  • 10
1
vote
1 answer

Python vs MATLAB: ARIMA Model with Known Parameter Values

In MATLAB, we can specify an ARIMA(p, D, q) model with known parameter values by using the following function tdist = struct('Name','t','DoF',10); model = arima('Constant',0.4,'AR',{0.8,-0.3},'MA',0.5,... …
Tung Kieu
  • 79
  • 9
1
vote
1 answer

statsmodel.api fit() throws overflow error

I am using Logistic regression for Mnist digit classification and am using statsmodel.api library to fit the parameters but the Logit.fit() still throws an overflow warning.Below is the error I am getting on Windows10,python 2.7 using library…
1
vote
0 answers

Failure using pip to install statsmodels - Ubuntu 16.04, python 3

Here's where I think things are failing. It looks like it's looking for pyconfig.h, but can't find it. I have python-dev installed, and cython installed. Any ideas? x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g…
Jeremy
  • 1,960
  • 4
  • 21
  • 42
1
vote
2 answers

unable to update statsmodels to version 0.8.0rc1 using conda

I am unable to update my statsmodels v. 0.6.1 to 0.8.0rc1 using conda (I used conda because I have conda installed). I have tried several ways: conda install statsmodels (based on http://www.statsmodels.org/dev/). Nothing happened, my version stays…
wi3o
  • 1,467
  • 3
  • 17
  • 29
1
vote
0 answers

How does the predict function in statmodels work for a single future value?

I'm trying to understand simple regression and how the model predict work. The result of predict is an array of fitted values. But what if I only want one value for example. If I want X=11 ( expected predict to only give me 110 ) why do I still get…
JPC
  • 5,063
  • 20
  • 71
  • 100
1
vote
1 answer

What is first value that is passed into StatsModels predict function?

I have the following OLS model from StatsModels: X = df['Grade'] y = df['Results'] X = statsmodels.tools.tools.add_constant(X) mod = sm.OLS(y,X) results = mod.fit() When trying to predict a new Y value for an X value of 4, I have to pass the…
user3294779
  • 593
  • 2
  • 7
  • 23
1
vote
0 answers

Recieving inf/nan for ols report: python & numpy

I'm working on an assignment for the Data Analysis Tools course through Coursera and I've run into a wall with my code. The assignment is to find the Analysis of variance and run an ANOVA to compare the means of groups. I'm trying to test the…
ricopella
  • 63
  • 7
1
vote
1 answer

Calculate values w/ statsmodels given a formula and parameters

I have fitted a model given a Poly-3 function and extracted the found parameters model = smf.ols(formula='A ~ B + I(B ** 2.0) + I(B ** 3.0)', data=sp) poly_3 = model.fit() params = poly_3.params.values I want to save the params for later use since…
TomTom101
  • 6,581
  • 2
  • 20
  • 31
1
vote
0 answers

Binary Negative Binomial Case with Python's statsmodels

I am trying to use Python's statmodels for the analysis of some data. I know that the negative binomial regression fits the model, since the variance and mean values are different.(that is why I am not using a Poisson regression model) In my case I…
Tron
  • 59
  • 2
  • 12
1
vote
1 answer

Parsing a Pandas dataframe with an unknown number of columns for use in statsmodels.api

I would like to create a generic script to perform linear regressions on multiple data sets. Each data set will have the same y-variable called "SM" and an unknown number of x-variables. I have been able to do this successfully if I know exactly…
keirasan
  • 365
  • 2
  • 6
1
vote
1 answer

Markov Switching Model in Python Statsmodels

I would like to estimate a Markov Switching Model as done in the following: http://www.chadfulton.com/posts/mar_hamilton.html However, when I try to import the function to fit the model, i.e. from statsmodels.tsa.mar_model import MAR I get the…
1
vote
1 answer

Projecting time series predictions on trend line and including seasonality (Python)

For the past few days I'm going crazy with Times series using statsmodels (Python). I am a novice in the TS area, although i do have a better understanding of various regression models. Here is my issue: I have a time-series that I stationarized…
Arslán
  • 1,711
  • 2
  • 12
  • 15
1
vote
1 answer

Regression Method Used in statsmodels adfuller()?

What is the method of regression used in adfuller()? I'm performing an augmented dickey fuller test on a time series, and I'm trying two different ways of doing it. First, I use pandas.diff() to get the change in price dy. Then I'm passing the…
ddm-j
  • 403
  • 1
  • 3
  • 18
1
vote
0 answers

Confounded columns in R vs Statsmodels - Statsmodels splits values among all aliases

When I have an underconstrained system with confounded columns, lm in R ignores many second- and third-factor interactions (which to me seems correct behaviour), but statsmodels (in Python) splits the value among all confounded columns. Imagine I…
Jean Nassar
  • 555
  • 1
  • 5
  • 13
1 2 3
99
100