Questions tagged [statsmodels]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
101 views

ARMA model using different train and test/validation datasets

In sklearn I am used to having distinct train and test datasets. In other words, I train a model's parameters on the features from a training set, and then apply ...
user3128's user avatar
0 votes
0 answers
7 views

I am not able to change the model family of my GLM using statsmodels

Here are my lines (in python) for my GLM: ...
chris.rechenauer's user avatar
0 votes
0 answers
115 views

Ordinal logistic regression prediction and accuracy using statsmodels

I am trying to do a ordinal logistic regression analysis using statsmodels. However, the predictions I'm getting are vastly different from that I get when using SciKit-Learn ...
antikbd's user avatar
  • 101
0 votes
0 answers
33 views

Covariance of forecasts from Python/statsmodels SARIMAXResults object

I have a SARIMAX model fitted at daily frequency using statsmodels.tsa.statepsace.sarimax. It is a "full" SARIMAX model in the sense that it has AR, MA, ...
Jamie Ballingall's user avatar
0 votes
0 answers
46 views

Time series decomposition: Magnitude of result really high

Im using statsmodels mstl to decompose time series data. Results are shown below. The trend signal, to some extent makes sense with respect to how it is changing its peaks and so on. But I cant ...
calculusnoob's user avatar
0 votes
1 answer
29 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 ...
Miuni Nihara's user avatar
0 votes
1 answer
82 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 ...
user9532692's user avatar
0 votes
2 answers
69 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 ...
Lauren's user avatar
  • 1
0 votes
0 answers
641 views

"'ValueError' shapes not aligned" when doing regression with statsmodels.OLS. predict(X_new)` only works when `X_new` is the size of the training set?

I try to run regressions on each Branche of a df_to_predict dataframe, Branche is a column ...
Revolucion for Monica's user avatar
1 vote
0 answers
53 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: ...
HavingNoHead's user avatar
2 votes
1 answer
205 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....
Gloksinya's user avatar
  • 121
3 votes
5 answers
216 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 ...
fred's user avatar
  • 31
0 votes
0 answers
87 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 ...
aljrub12's user avatar
0 votes
0 answers
925 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 (...
Karima Touati's user avatar
2 votes
2 answers
707 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, ...
Chris_007's user avatar
  • 193
1 vote
1 answer
191 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 ...&...
user96624's user avatar
  • 169
1 vote
1 answer
35 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?
Zexxxx's user avatar
  • 33
1 vote
0 answers
54 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 ...
Zexxxx's user avatar
  • 33
0 votes
1 answer
24 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.) ...
An old man in the sea.'s user avatar
1 vote
0 answers
38 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 ...
codeananda's user avatar
2 votes
1 answer
2k 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: ...
Sandhya Indurkar's user avatar
0 votes
0 answers
234 views

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

I'm trying to get time series prediction using the following code. ...
soham_dhole's user avatar
1 vote
2 answers
55 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 ...
Lili's user avatar
  • 11
1 vote
1 answer
3k views

Statsmodel logit with sample weights

Using sklearn I can consider sample weights in my model, like this: ...
giotto's user avatar
  • 113
0 votes
2 answers
397 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 ...
Maths12's user avatar
  • 506
2 votes
0 answers
547 views

statsmodels.tsa.holtwinters.ExponentialSmoothing: what do “additive”/“multiplicative” trend and seasonality actually mean?

There are additional concepts of additivity and multiplicativity for trend (trend{“add”, “mul”, “additive”, “multiplicative”, None}) and seasonality (...
Vladimir Fadeev's user avatar
1 vote
2 answers
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 ...
grumpyp's user avatar
  • 157
2 votes
0 answers
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 ...
grumpyp's user avatar
  • 157
1 vote
0 answers
36 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 ...
NewbietoPython's user avatar
1 vote
1 answer
334 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 ...
Alexander Vocaet's user avatar
3 votes
0 answers
897 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. ...
Rylan Schaeffer's user avatar
0 votes
0 answers
16 views

Ideas on handling large quantities of "waste" data

Hello and thank you for taking time out of your day to help me. I am currently working on developing a machine vision application for production monitoring. The application handles images, about 20,...
Ηλίας Κωνσταντινίδης's user avatar
0 votes
1 answer
17 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 (...
Murcielago's user avatar
1 vote
0 answers
202 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 ...
Michael Petro's user avatar
2 votes
0 answers
176 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. ...
Abdul Rehman's user avatar
1 vote
0 answers
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: ...
kms's user avatar
  • 310
2 votes
0 answers
228 views

Does statsmodels fully support MultiIndex?

The below code snippet shows how statsmodels seems to flatten MultiIndex tuples by joining them with an underscore "_". ...
OldSchool's user avatar
  • 261
1 vote
0 answers
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. ...
David Masip's user avatar
  • 6,031
1 vote
1 answer
1k 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....
yogesh agrawal's user avatar
2 votes
2 answers
220 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 ...
J.C Guzman's user avatar
8 votes
2 answers
4k 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 ...
Lukáš Tůma's user avatar
1 vote
1 answer
95 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?
yathislax's user avatar
1 vote
1 answer
270 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 ...
rocksNwaves's user avatar
1 vote
0 answers
37 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 ...
rocksNwaves's user avatar
1 vote
1 answer
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 ...
Oussama Jabri's user avatar
1 vote
1 answer
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 ...
shaifali Gupta's user avatar
2 votes
0 answers
3k 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 ...
Sim_Demo's user avatar
2 votes
0 answers
119 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 ...
Martien Lubberink's user avatar
3 votes
1 answer
2k views

Advice on imputing temperature data with StatsModels MICE

This may be a dumb question but I can't figure out how to actually get the values imputed using StatsModels MICE back into my data. I have a dataframe (dfLocal) with hourly temperature records for ...
plytheman's user avatar
1 vote
2 answers
1k views

Can I conduct independent t-test when data is infested with outliers ? and how to interpret the t-statistics?

I am working on 2 sample independent t-test. I have conducted analysis on test group vs control group and I have to write a report but I have few questions. Do we have to take out the outliers and ...
pinky's user avatar
  • 151