Questions tagged [statsmodels]

A Python module for exploration, testing, and estimation. Do not use this tag for general statistical modeling questions! Nb, questions only about the module itself, Python, or coding will likely be off topic.

Filter by
Sorted by
Tagged with
1
vote
2answers
784 views

numeric variables showing categorical properties using statsmodels.api.ols [closed]

I am using Python statsmodels module, and doing ANOVA on a linear model. The data source is http://www.scipy-lectures.org/_downloads/brain_size.csv. There are ...
4
votes
2answers
6k views

Understand Summary from Statsmodels' MixedLM function

I am using MixedLM to fit a repeated-measures model to this data, in an effort to determine whether any of the treatment time points is significantly different from the others. I get the following ...
12
votes
1answer
9k views

Cause of a high condition number in a python statsmodels regression?

I'm pretty new to regression analysis, and I'm using python's statsmodels to look at the relationship between GDP/health/social services spending and health outcomes (DALYs) across the OECD. Just to ...
0
votes
1answer
6k views

Normal QQ-plot of logarithm of data does not match log-normal QQ-plot of data itself

I'm working in Python statsmodels, and trying to find the distribution of the data in a numpy array. From the histogram, it looked like the data might be log-normally distributed. So, I took the ...
6
votes
1answer
715 views

For random forest, what's the difference between out-of-bag error and k-fold cross validation?

I am trying to forecast a time series using random forest. In order to validate my model, I came cross two tests: OOB and K-fold cross validation. My question is: For a time series, is out-of-bag ...
2
votes
0answers
136 views

Interpreting result of OrdinalGEE

I am trying to understand the IPython notebook here. The output of the GEE fit displays: ...
0
votes
1answer
357 views

Statsmodels: How does statsmodels' VAR(p ) / VAR(p) in general works?

I'm trying to use statsmodels' VAR(p) to forecast some data points in the future. Below is a snapshot of what my data looks like: What I understand about VAR(p) equation in general is that when p = 3,...
2
votes
2answers
863 views

statsmodels KDE icdf

GOAL I am interested in the inverse cumulative distribution function - aka quantile function - my plan is to randomize the distribution using the inverse probability integral transform, aka feeding ...
0
votes
0answers
500 views

statsmodels: clarification on VAR(p) results attribute, results.forecast_interval()

I am trying to look for the upper and lower limits of my time series data, and follow the instructions from statsmodels to use the VAR(p) Below is my code ...
1
vote
0answers
2k views

GLM.fit() in Matlab vs. Python Statsmodels: why the different results?

In what ways is Matlab's glmfit implemented differently than Python statsmodels' GLM.fit()? Here is a comparison of their ...
1
vote
0answers
505 views

Problem with least squares cross validation in statsmodels

I'm trying to calculate a KDE bandwidth using the least-squares cross validation (LSCV) method. I'm using the statsmodels KDEMultivariate function in Python. But I'm running into an issue where the ...
2
votes
0answers
849 views

What is the formula of Median Magnitude of Relative Error? (MdMRE)

I'm familiar with these terms 1 - MRE Mean Relative Error 2 - MMRE Mean Magnitude of Relative Error I need to compute MdMRE which is Median Mean Relative Error. I searched on the net but didn't ...
5
votes
1answer
10k views

How to optimise an automatic ARIMA-model selection?

I've been using statsmodels.tsa.arima_model to fit the residual component of some data. I've written an algorithm to automatically select the ARIMA model. Results ...
0
votes
1answer
7k views

How to interpret hausman test results?

I'm trying to do 2 stage least squares regression in python using the statsmodels library. ...
3
votes
1answer
2k views

Making sense of Binominal GLM model

I have binominal data: For each of $x_i = 1,\ldots,49999$, I have the number of successes $s_i$, out of $n_i$ experiments. It so happens that $n_i = 50000-i$. Here is a plot of $s_i$: And here is a ...
10
votes
2answers
8k views

Logistic regression with binomial data in Python

This is probably trivial but I couldn't figure it out. I want to fit a logistic regression model, where my dependent variable is not a Bernoulli variable, but a binomial count. Namely, for each $X_i$, ...
1
vote
1answer
661 views

Standard error for intercept only model in probit regression

How do you calculate the standard error for intercept for an intercept only probit regression model? I was expecting the formula to be: 1 / sqrt(N * p * (1 - p)) where N = no. of obs, p = mean(y). ...
45
votes
3answers
88k views

Logistic Regression: Scikit Learn vs Statsmodels

I am trying to understand why the output from logistic regression of these two libraries gives different results. I am using the dataset from UCLA idre tutorial, predicting ...
3
votes
0answers
1k views

Python statsmodels ARIMA ValueErrors

I am using the statsmodels package in python to generate a set of ARIMA models for a series of log returns multiplied by 1000. I am iterating through possible models (p, d, q) starting from (1, 0, 0) ...
4
votes
1answer
5k views

Multinomial logit: mlogit vs statsmodels

I am doing a comparison between mlogit in R and statsmodels in python and have had trouble getting them to produce the same result. I'm wondering if the difference is a result of libraries or I am ...
1
vote
0answers
519 views

Knowing what exogenous variable cause quasi-separation

I'm trying to build a classifier using a logistic regression and statsmodel is telling me that there is an issue of quasi-separation. Well this isn't an issue! This is exactly what i'm trying to do: ...
2
votes
3answers
3k views

Why isn't logistic regression learning the correct weights for a Y variable defined as logit of X and weights?

I am trying to see if the implementation of logistic regression in my is correct. In order to do that I first started to generate some random X data and specify some predefined weights. When I train ...
3
votes
2answers
3k views

SciPy chisquare applied on continuous data?

chi2 seems to be used to compare distributions between categorical features. Is it possible to use SciPy chisquare function to compare two distributions of continuous data ? For example : ...
3
votes
1answer
1k views

Does ARIMA assume evenly-spaced data in statsmodels?

I've read that ARIMA assumes that endogenous input array is evenly spaced. If that is the case, then what is the point of the dates parameter in statsmodels.tsa.ARIMA(), which seems like it is there ...
5
votes
1answer
170 views

Adjusting time-series before a sudden increase(the reason & time of the increase are known)

There are 2 increases in magnitude (one between feb and march, and one at the beginning of september) (the chart has daily resolution btw) Assuming weekly seasonality, is it ok to get the exact ...
8
votes
1answer
21k views

Proving similarities of two time series

Let's assume an analytical model predicts an epidemic trend over time, i.e. number of infections over time. We also have a computer simulation results over time to verify the performance of the model. ...
16
votes
2answers
15k views

Ordinal logistic regression in Python

I would like to run an ordinal logistic regression in Python - for a response variable with three levels and with a few explanatory factors. The statsmodels package ...
0
votes
1answer
940 views

Regression of two data data sets of the same experiment

I have two data sets collected by different methods about the same phenomena, one 'bare' and other where I believe there is a constant value added (the same phenomena, with the data collected by a ...
0
votes
1answer
34 views

if we have 2 independent variables w correlation can we still use them in OLS

I've read from some resources that one of the assumptions in ols is that the predictor variables do not have a correlation. Is this because correlation => linear dependency? Which I know we cant have ...
0
votes
1answer
312 views

Weighted re sampling why cdf not pdf or pmf? [closed]

From thinkstats2 the O'Reilly text. ...
10
votes
1answer
2k views

Why is forecasting of ARMA models performed by Kalman filter

What are the advantages of expressing an ARMA model as a state-space-model and do forecasting using a Kalman filter? This methodology is for example used in the SARIMAX implementation of python-...
6
votes
1answer
16k views

Testing for Granger Causality

I have two time series (Stocks and GDP) that I want to check for Granger causality. After reading the literature and documentations of various statistics software documentations (py statsmodels), I'm ...
0
votes
1answer
2k views

Granger Causality / VAR / Negative Correlations

I have two questions on Granger causality. I feel puzzled after reading a dozen of papers on the topic and it appears to me that I need to clarify my understanding of Granger causality. Question 1 : ...
1
vote
0answers
8k views

Statsmodels: What can cause LinAlg error?

I am trying to do a mixed linear model for a dataset I am helping a colleague analyze, as in an earlier question I had posted, GLMs were unable to handle random effects. With the appropriate imports ...
2
votes
2answers
781 views

Multinomial logistic regression, weighted logistic regression?

I have a binary predictor with many response variables. The binary predictor was originally continuous but was converted to binary ... if the response was $>1000$ then 1, else 0. I would like to ...
1
vote
0answers
363 views

Backward ARIMA forecast

I want to try and predict previous values for random data that has properties of ARIMA process. Problem is that I dont understand ARIMA model mathematically, so I dont know if that's even possible ...
21
votes
4answers
29k views

Difference between statsmodel OLS and scikit linear regression

I have a question about two different methods from different libraries which seems doing same job. I am trying to make linear regression model. Here is the code which I using statsmodel library with ...
5
votes
0answers
1k views

statsmodels: quantreg convergence cycle warning

I am getting the same Convergence cycle detected warning running a quantile regression with ...
4
votes
0answers
5k views

ARMA Model fitting using statsmodels.tsa.ARMA()

Two questions. 1.) When I use the statsmodels.tsa.ARMA() module, I enter my parameters and fit a model as follows: ...
25
votes
3answers
71k views

Analyse ACF and PACF plots

I want to see if I am on the right track analysing my ACF and PACF plots: Background: (Reff: Philip Hans Franses, 1998) As both ACF and PACF show significant values, I assume that an ARMA-model ...
2
votes
0answers
669 views

Equivalence of intercept beta test to one-sample t-test in linear regression model with categorical variable

I am testing my understanding of the equivalence between basic linear regression with categorical variables, and one-sample / independent samples t-tests. I don't think this corresponds to an existing ...
2
votes
2answers
243 views

Stats t-test for soccer data

I am new to stats and had the following question I am studying if the total number of fouls in a soccer game increases/decreases if a particular team is winning at half time. This is what I did (one ...
3
votes
1answer
7k views

Johansen Test in python [closed]

How to get the trace statistics from the Johansen test for cointegration in python. Also, i tried to search it myself on google, found the following website ("http://www.drtomstarke.com/index.php/...
3
votes
0answers
911 views

Approximating cox model with time varying covariates using poisson

How do you reformat a dataset in order to perform a cox regression with time-varying covariates as a poisson regression. I'm trying to run a survival analysis regression in python with time varying ...
2
votes
0answers
1k views

Python: Compute the Generalized Impulse Responses

I am using the tsa.vector_ar in Python, StatsModel Package and when I do a Forecast Error Variance Decomposition using the command ...
3
votes
2answers
5k views

Different output for R lm() and python statsmodel OLS for linear regression

I'm exploring linear regressions in R and Python, and usually get the same results but this is an instance I do not. I added the sum of Agriculture and ...
9
votes
1answer
8k views

Assessing the Contribution of each Predictor in Linear Regression

Say I build a linear regression model to identify linear dependencies between variables in my data. Some of these variables are categorical variables. If I want to evaluate the contribution of a ...
0
votes
0answers
97 views

beanplots: plus sign?

I would like to draw bean plots using the statsmodel package for Python. In the example provided on the documentation, I see a red plus sign in each beanplot: What does it represent?
4
votes
1answer
8k views

ARIMA with seasonality in Statsmodels

I'd like to have a seasonal ARIMA model implemented with Statsmodels ARIMA. Specifically, I'd like to log before the weekly seasonality and then be able to make forecasts. Perhaps an example with ...
52
votes
2answers
30k views

Pandas / Statsmodel / Scikit-learn

Are Pandas, Statsmodels and Scikit-learn different implementations of machine learning/statistical operations, or are these complementary to one another? Which of these has the most comprehensive ...

1 2 3 4 5
6