# Questions tagged [statsmodels]

The tag has no usage guidance.

49 questions
Filter by
Sorted by
Tagged with
13 views

### Multivariate linear regression via scikit and statsmodels

want to preface this first with terminology: multivariate regression deals with the case where there are more than one dependent variables while multiple regression deals with the case where there is ...
• 11
44 views

### Beta Regression Model in Python for Effect of Marketing Campaign B Membership on CTR

I am trying to build a model to estimate the ATE of Campaign B (B1) on CTR (Click-thru-Rate), with Campaign A as the baseline (B0), represented by column 'a_or_b'. Other exogenous variables are: '...
1 vote
11 views

### Unexplainable noise in STL of clean, seasonal data

I am encountering unexplained noise in the residual component after STL decomposition. I use this dataset taken from NAB's benchmark. It is a periodic (daily) timeseries, with no noise or anomalies. ...
• 111
16 views

### Supply weights/number of obs to instead of one obs per row when doing multinomial regression?

EDIT: The code below is using statsmodels but I have the same problem when using sklearn. I'm trying to do multinomial regression using the statsmodels MNLogit package. It says in the documentation ...
• 101
10 views

...
1 vote
9 views

### How to calcualte LR_statistic for the below data

I am trying to calculate LR_statistic for two models where my log-likelihood ratio values as follows. model1.llf = -2326.9 and model2.llf = -4649.1. When read ...
30 views

### What statistical model suits for this problem?

I have a dataset with 6 target variables and the target variables are Boolean. The requirement is to use logistic regression to build the model. Which ML approach can be used in this situation? Will ...
167 views

### Time series: Why does this data have seasonality on periods where observed values are zero

I'm a novice to time series and am using seasonal_decompose() to split a time series into three components: trend, seasonality, and residuals as below: As shown in ...
• 109
123 views

### What model should I use to predict monthly sales by products?

I am trying to predict monthly sales by product based on a plethora of variables. There are 4 predictors. One is categorical (month) and the other three are numerical. One of the variables is just ...
1 vote
58 views

### Is there a python package that can replicate this model?

I'm trying to convert a short R data analysis script to python and can't find the right modules/packages to do so. This is the script in R: ...
313 views

### ARIMA predictions look shifted by one unit of time

I am using statsmodels ARIMA (1,2,1) to predict the monthly demand for a product. The predictions look like they are shifted to the right by one month. I wonder if the statsmodels.ARIMA.Residuals....
• 121
228 views

### Predicting deterioration of equipment on a production line

Background There is a production line where there is a machine that interacts with some tools. The process goes as such. Machine makes a product Product is moved into the tool [tool here is ...
• 31
93 views

### Why coefficients from logistic regression are not proportional to bad rate?

I am building a logistic regression model in Python with statsmodels.api.Logit. The model contains 12 features that are encoded using ...
1k views

### NaN, inf or invalid value detected in endog, estimation infeasible error when training statsmodels GLM model

I am trying to build a GLM model (poisson family) using python statsmodels package on train data. The data I have contains categorical values as exogenous variables and numerical values for my target (...
1k views

### Does t-test require Standard Deviation of sample for calculation

Might be a novice question, but the main difference between a t-test and z-test, I was able to understand, is that the z-test calculation requires the SD value of the population where as in a t-test, ...
• 193
1 vote
283 views

### Persistence and stationarity together

I am trying to analyse a time series. I want to get only quantitative results (so, I'm excluding things like "looking at this plot we can note..." or "as you can see in the chart ...&...
• 169
1 vote
49 views

### When an Fourier Analysis should be used for timeseries data

When Fourier Analysis should be used for time-series data,except when doing decomposition?
• 33
1 vote
56 views

### Understanding plotted ACF on stationary time-series data

I made time-series data stationary and plotter ACF & PCF, while PCF looks fine, I do not know how to interpretate ACF, as it looks like this - I could not say it geometrical. For PACF - it is ...
• 33
25 views

### PACF for Airline Passengers dataset: What's wrong?

The airline passengers dataset is available here, but it also comes with in R. I'm working with python, and I import the following (besides the usual like pandas and numpy.) ...
1 vote
49 views

### Does this ARIMA model take seasonality into account?

I'm writing a tutorial on traditional time series forecasting models. One key issue with ARIMA models is that they cannot model seasonal data. So, I wanted to get some seasonal data and show that the ...
• 288
3k views

### How do I use number of hours as index in timeseries forecasting?

I have a dataset that has number of hours (consecutive value) and total sales in that 1 hour in my dataset. See below for head of the dataset: ...
297 views

### Getting KeyError while executing forcast( ) in statsmodel's holtwinters function

I'm trying to get time series prediction using the following code. ...
• 140
1 vote
64 views

### Which features are important in determining fluency of participants measured by weighted composite score?

I'm starting to learn about data science. I have sample data including different features run over several people, for each person n times. these features represent the fluency of the participants in ...
• 11
4k views

### Statsmodel logit with sample weights

Using sklearn I can consider sample weights in my model, like this: ...
• 123
753 views

### Selecting most important features for multilinear regression

I have a set of 25 features. I would like to choose the best features for my model. Originally, I was looking at the correlation of features with respect to response, and only taking those which are ...
• 526
672 views

1 vote
1k views

### How to interpret my logistic regression result with statsmodels

so I'am doing a logistic regression with statsmodels and sklearn. My result confuses me a bit. I used a ...
• 157
2k views

### How to interpret my logistic regression result?

I'm having a hard time to interpret my result of the logistic regression. I have a few question. Firstly, how can I check if a feature is more important to the others, like that there is a real ...
• 157
1 vote
37 views

### analyze the effect of some new changes to business rules on customers retention and sales

I am trying to analyze the effect of a particular business rule on customer behavior. Background: I have two call centers operating in my company. One is an in-house call center and the other one is a ...
1 vote
438 views

### Does statsmodels compute R2 and other metrics on a validation-/test- set?

Does statsmodels compute R2 and other metrics on a validation set? I am using the OLS from the statsmodels.api when printing summary, an r2 and r2_asjusted are ...
978 views

### How to retrieve results summary from statsmodels GLM with regularization?

I'm trying to fit a GLM to predict continuous variables between 0 and 1 with statsmodels. Because I have more features than data, I need to regularize. ...
18 views

### multi items forecasting: issue with storing results

disclaimer: I am not 100% sure that this is the appropriate place to ask this question. Here is a little bit of context about the problem. I have a dataset containing about 1000 products timeseries (...
• 101
1 vote
223 views

### How to implement large-scale Poisson Regression in Python

I am trying to implement a Poisson Regression in Python to predict rates. I am dealing with a ton of data (too much to store in a DataFrame), which means that using the standard statsmodels.api GLM ...
189 views

### Classification and clustering of Time series data of temperature

I have a time series recorded data of temperature. This is what my data looks like: The change in data represents specific event or a class which I would like to detect when new incoming data. ...
• 131
1 vote
22 views

### Solve a regression equation algebraically in python

I fit a regression model using python statsmodels.formula.api package and obtain the coefficients/results. Here's the model: ...
• 310
243 views

### Does statsmodels fully support MultiIndex?

The below code snippet shows how statsmodels seems to flatten MultiIndex tuples by joining them with an underscore "_". ...
• 261
1 vote
31 views

### Stasmodels unexpected behaviour

I am using statsmodels in python to perform quantile regression. I am running quantile 99 and quantile 1 to see the extremes quantile of my distribution. ...
• 6,111
2k views

### Can we do multivariate time series analysis using holt-winter ( Exponential smoothing) method?

Just like we have a method like ARIMAX and SARIMAX where we can provide exog and endog variable for perfroming multivariate analysis. I was hoping is there a way, we can achieve same using ETS as well....
268 views

### High error Arima model - Python

I have a time series data. It has daily frequency. I want to forecast the data for the next week or month with an ARIMA model. This is a chart of my time series data: First I use the method ...
• 151
5k views

### Why Scikit and statsmodel provide different Coefficient of determination?

First of all, I know there is a similar question, however, I didn't find it so much helpful. My issue is concerning simple Linear regression and the outcome of R-Squared. I founded that results can ...
• 183
1 vote
101 views

### what is the difference between Bias and overfilling and under fitting? [closed]

I am confused about Bias and overfitting as I see it sounds similar but not able to explain differene?
1 vote
766 views

### Question on ANOVA and Correlation/Association

I've been working on examining statistical relationships between variable: Pearsons, Spearman's for continuous variables Kendall's Tau, Cramer's V for ordinal/nominal variables. I know there's many ...
• 309
1 vote
42 views

### Using Residual Plots to combat Simpson's Paradox and Other Misleading phenomenon

I've read that univariate analysis is a huge part of EDA, pretty much everywhere. What I understand of univariate analysis basically comes down to using Seaborn pairplot and correlation matrices and ...
• 309
1 vote
32 views

### How to do backward features elimination when considering interactions between them

I have a multi linear regression problem, $Y$ is my target and $X_1, X_2, X_3$ are my features. In my regression, I consider the interaction between $X_1, X_2, X_3$ and I add a bias. So my problem ...
1 vote
1k views

### Timeseries VAR vs VARMA model: issue in time to fit model

I want to use VARMA model on a data of about 80000 samples with 10 features. I tried using VARMA model from statsmodels with p=50 and q=10 but it is taking too much time to build the model. I tested ...
4k views

### Some of the p-values are NaN - logistic regression

I am trying to do logisitc regression, but have this issue - some of the p values are NaN ...
• 41
138 views

### Using an unmerged branch from StatsModels for Anaconda

I am interested in using a statistical test from StatsModels, one that is not available in the default Anaconda StatsModels folder on my drive. See this blog, which as some point mentions, almost ...