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
0
votes
0answers
22 views

SARIMAX Exog doesn't work well at all?

I'm working with demand forecasting and we are using Statsmodels SARIMAX on a regular basis. One thing we have noted is that the model doesn't seem to listen much at all to the EXOG argument to which ...
1
vote
0answers
12 views

What am I misunderstanding about the ACF and ACF plot?

I am using Python's statsmodels.tsa.stattools.acf on a series, specifying alpha: acf = acf(x, alpha=0.05). After this I'm using ...
0
votes
0answers
4 views

Gaussian Linear Model with Normalized dependent variable - statsmodels

I used MinMax normalization technique before applying GLM regression to my dataset. I have a few questions: Can I apply such transformation before fitting linear models? Which transformations could ...
0
votes
1answer
32 views

KPSS test: p-value greater than 0.05 but test statistic is less than critical values

I am using Python Statsmodels to find out if my time series is stationary or not. My time series (after the first level shift) passed the ADF test and it suggested that the time series is stationary. ...
0
votes
0answers
7 views

standar error of non-linear regression

I'm trying to compute the standar error of a non-linear regression fit, I find the answer in this post Non-linear regression confidence interval But i did't find that formula in any other place,and I ...
0
votes
0answers
14 views

statsmodels h-leverage vs leverage terminology

I have been using the python statsmodels api to perform OLS analysis. The API allows you to create several standardized plots. The Influence plot has axes of studentized residuals and h leverage. ...
0
votes
0answers
9 views

Are the statsmodels and sklearn implementation of multinomial logistic regression equivalent?

I'm trying to wrap my head around multinomial logistic regression for k classes. It looks like one formulation of the problem is to do k-1 binary logistic regressions with one class as a "pivot ...
-1
votes
0answers
45 views

What do these warnings mean? [duplicate]

New to statsmodels,so can't figure out the warnings ...
0
votes
1answer
47 views

initial conditions for statespace mlemodel in statsmodel

I am a bit puzzled by very sensitive dependence on the initial conditions in the statespace mlemodels in statsmodel. Let me take a concrete example here. I am trying to fit this Dynamic Linear model ...
1
vote
0answers
19 views

Numpy and Statmodel issue - LinAlgError - Singular Matrix

I have seen other topics on this, but I couldn't get their solutions working for me. Perhaps someone else will know why. namely: statsmodels: error in kde on a list of repeated values However, my ...
0
votes
0answers
6 views

What statistical analysis? Three continuous independent variables w/ one categorical dependent [duplicate]

Trying to find what type of analysis to run. Im trying to determine if three continuous variables can predict a categorical dependent variable (physical activity) w/ three levels (high, medium, and ...
3
votes
2answers
94 views

How to understand and interpret multicollinearity in regression models

I am using python to implement different regression models on a fantasy sports dataset. I am using a multivariable dataset which contains 5 independent variables to 2 regression models, which is Lasso ...
1
vote
1answer
36 views

Why does Statsmodels' ARMAX function fit a linear regression model

I want to fit an AR(MA)X model to some data. The application is to describe the temperature of a single room. As disturbances/exogenous inputs to the room temperature is solar radiation, outdoor air ...
0
votes
1answer
19 views

Unable to show cointegration between two lagged sine waves with statsmodels cointegration function, why?

When using the statstools cointegration function to test for cointegration with default parameters between two sine waves with a 1 period lag, coint() returns that ...
1
vote
1answer
14 views

patsy dmatrices() and statsmodels Logit() - the reference group and the intercept?

I want to understand what's going on with a categorical variable reference group generated using dmatrices(), when building logistic regression models with ...
0
votes
0answers
10 views

Statsmodel linear combination of previous values that fit the model

I have two list X and Y of length 500 with numbers. And i would like to make a forecasting model that make a linear combination of K values of Y to deduce the next value. For instance i train this ...
0
votes
1answer
11 views

Stats Model contingency table, unable to reshape data and run test for nd array 2 x 2 x k

Consider below list of 2×2 tables and CMH (Cochran–Mantel–Haenszel) test results. We are trying to determine if each specific centre was associated with the success of the treatment [Data from Agresti,...
0
votes
1answer
34 views

Statsmodels OLS R^2 calculation

I understand, that OLS of statsmodels sometimes uses centered and uncentered model for the calculation of R^2. Other calculations like tvalues, params, etc use only uncentered model. I want to ...
0
votes
1answer
81 views

What do the values for initialization method mean in statsmodels simple exponential smoothing?

I'm trying to use Statsmodels' simple exponential smoothing for time series analysis. There are various methods available for initializing the recursions (estimated, heuristic, known). Can someone ...
0
votes
0answers
10 views

Help in determining whether these time series are additive or multiplicative

I can't really figure out whether these time series are additive or multiplicative: I believe them to be additive as I can't really see any visible increasing or decreasing amplitudes. But is that ...
0
votes
1answer
74 views

How to calculate AIC and BIC?

I should find formula of BIC and AIC which is used in statsmodels. I have array with values: ...
1
vote
0answers
28 views

Marginal effect for mixed effects models (for python statsmodels)

I have a mixed effects model, developed using python statsmodels, and I want to know the effect of each independent variable on the response variable, assuming all other variables are constant. Based ...
2
votes
1answer
56 views

Understanding the period/cycle of time series data

I'm trying to understand the meaning of period/cycle length in time series forecasting. Some functions, such as seasonal_decompose and ...
0
votes
0answers
27 views

How to calculate confidence intervals for logistic regression predictions? How does `statsmodels` do it in `summary_frame`?

I am fitting a logistic regression in Python's statsmodels and want a confidence interval for the predicted probabilities. This has been easy to get using ...
0
votes
1answer
25 views

Statistical test for two categorical ordinal variables with four levels

There are two categorical variables with four levels, so ordinal variables. Specifically, they are responders and non-responders with heart function that is graded from mild, mild-moderate, moderate, ...
1
vote
0answers
31 views

why is the standard error so high for my probit model [closed]

I have created two probit models, and even though p values are significant and sample spaces are large- 10000 samples in both- standard errors seem to be about 6.27e. What could be the reason for that?...
0
votes
1answer
56 views

What can be a good way to generate data(tabular) from statistical facts and probability of data?

For Example, If I have facts saying that: 50% of humans are male 30% of males are Indians 70% of Indians are brown average age of Indians are 27 30% of indian females are working 80% of no-indian ...
0
votes
0answers
18 views

Multivariate Time series forecasting- Statistical methods

I was trying to forecast the truck numbers required at each distribution location...for that I was forecasting the shipments(number of units) at each location and dividing it by a factor to get the ...
2
votes
1answer
39 views

Why are the p-values of this mixed effect model non-uniform when there is no effect (synthetic data)?

I've been looking into using mixed effect models for a project, and along the way wanted to experiment with how they'd work on synthetic data. However, I'm confused by the results — if I generate what ...
2
votes
0answers
89 views

Trend Dampen with SARIMA

Trend dampen exists as a parameter for Holt-Winters in the ExponentialSmoothing class for statsmodels but how can I do something ...
0
votes
0answers
14 views

statsmodels seasonal_decompose forward looking bias?

I'm using the python module statsmodels to do an additive seasonal decomposition of a time series. I have been trying to understand if the method used looks at the whole series at once or if it only ...
0
votes
1answer
21 views

Determining user base growth with multilevel modeling - how to interpret

Background I'll start by saying that I'm not sure whether to use Multilevel Modeling or Vector Autoregression for this problem. I have panel data, which tracks users who log into my website over time. ...
0
votes
1answer
62 views

How to calculate the interannual variability and Seasonal Amplitude?

I have a time series of remote sensing observables. For example, the observed brightness from 2007 to 2019. And we have 2 datapoints per day. How can I calculate the interannual variability of this ...
0
votes
0answers
45 views

Bootstrapping OLS coefficient variance different results than Python Statsmodels

I wanted to test some basic OLS things in python with a sample dataset. One thing I wanted to test was just getting a bootstrap estimate of the variance of the model's coefficients. Here is the setup ...
0
votes
1answer
79 views

Statsmodels Robust Linear Regression; is F-test Valid?

For the sm.OLS() models, there is a provided Ftest and a p value inside the .summary() function. for Robust Linear Regression sm.RLM() there is no such value in the .summary() function yet there is a ....
0
votes
1answer
55 views

Logistic regression coefficient meaning with and without intercept in standardized data

I am using sm.MLogit in python (i.e. multiclass logistic regression) to classify a 3 classes (0,1,2). I have numerical dependent variables that are standardized (mean 0, standard dev. 1) and I add an ...
3
votes
0answers
51 views

Dealing with leptokurtosis, should I be worried?

I modeled a mixed model with the lmer library in Rstudio and my residues don't seem normal, with a Shapiro-Wilk test p-value <0.0001 and a QQ-plot that looks heavy tailed. I then plotted the ...
0
votes
1answer
63 views

Statsmodels Linear Regression with ARIMA errors model not including the ARIMA error in prediction?

I have fit a SARIMAX (1, 0, 0) model to a timeseries dataset consisting of 1 endogenous timeseries ("Y") and 1 exogenous timeseries ("X"). My exogenous timeseries in the model was ...
0
votes
0answers
37 views

How to test if a river affect another?

I have two rivers, two monitoring stations placed in each river, and two datasets. One river is a tributary of the other. The datasets are complete, pH, metals, field parameters (flow, temperature, ...
1
vote
1answer
51 views

How to efficiently present graph for this data

I have three variables. In the first table CPU value is fixed and similarly in the second. If I generate a graph for this data there will be four different graphs and then another four graphs if ...
0
votes
0answers
4 views

How to select time period for sampling?

I am currently planning my sampling methods to come up with an estimate of the average return for bitcoin (as an example). My first assumption will be that price movements will be somewhat similar ...
0
votes
0answers
83 views

Manual/Hand calculating statsmodels time series SARIMA forecast?

I am trying to hand calculate the prediction output for statsmodel's SARIMAX but am not getting the right values. I fit the model as follows: ...
1
vote
0answers
27 views

Mixed Linear Model Regression missing output

I'm running a mixed linear model regression and I get some missing output and for the one I get it doesn't make too much sense (or at least I think so as the p-value is always equal to 1). The columns ...
1
vote
1answer
171 views

Python statsmodels constant and error using Tweedie distribution

I'm following a paper described in the link which models rainfall. Due to a cyclical nature the authors use a model equation (53): $$ log(\mu_{i}) = a_{0} + a_{1} sin (\frac{2\pi i}{365}) + a_{2} ...
1
vote
0answers
84 views

Using ar_select_order from Python statsmodels 0.12.0 to determine optimal lag for AutoRegressive model

Using statsmodels 0.12.0 I am attempting to determine the optimal lag for a statsmodels.tsa.ar_models.AutoReg model. I am using US population data with monthly ...
5
votes
1answer
144 views

Python Mixed Linear Model Regression Interpretation of the Results

I cannot seem to find a proper guide on how to interpret the results from a Mixed Linear Model Regression. ...
1
vote
1answer
70 views

How to deal with extensive outlier periods caused by external factors like COVID?

I'm working on a timeseries that was significantly affected by the COVID-19 pandemic, but has since recovered to a more normal behavior. My objective is to have a good forecast for a couple of weeks, ...
1
vote
0answers
50 views

How to interpret the coefficients of a regressor in a ARIMAX model

I'm fitting an ARIMAX model with statsmodels SARIMAX library. I've done a logarithm transformation for both the dependent variable and the regressor and I've been left with the following coefficients: ...
3
votes
2answers
132 views

Can't decide if my data is normally distributed

I have a problem comparing results from shapiro test and qqplot. Shapiro tells me my data doesn't have normal distribution characteristics (pvalue = 1.94...e-08 <= 0.05) however when I look on QQ ...
0
votes
1answer
441 views

Statsmodels: how to run and interpret a Gamma regression?

I have an endogenous variable that is continuous and non-negative. From what I can gather, a Poisson regression is not appropriate because the values of the response variable are not natural number, ...

1
2 3 4 5
7