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
1answer
22 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
11 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
34 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 ...
1
vote
0answers
68 views
+100

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
12 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 ...
1
vote
1answer
16 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
16 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
23 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
32 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 ....
3
votes
0answers
37 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
41 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
48 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
37 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
23 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
69 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
37 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 ...
4
votes
1answer
56 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
60 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
28 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
92 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
149 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, ...
0
votes
1answer
60 views

ARIMA model with delay in fitting and constant prediction

I am trying to use ARIMA (Python, statsmodel) on the following time series, values are collected with a weekly frequency: ...
1
vote
0answers
16 views

Unable to match numerical output of Newey-West standard error in statsmodel

I'm trying to implement Newey-West from scratch to better understand each component. Currently having trouble replicating a basic numerical example of Newey-West with lag=1 from ...
0
votes
0answers
16 views

ARIMA Forecasts (Python / Statsmodel)

Say I have an ARIMA model that I have fit and with with I want to make forecasts/predictions. Say the model is an ARIMA(2,0,2) with some seasonality (1,0,0,365) Since p and q are 2, we are relying on ...
0
votes
0answers
35 views

Forecasting Quarterly Time Series Data?

I've gotten very confused reading all the articles about forecasting time series data with seasonality on Medium and other sources. It seems that many provide useful background and importance of ...
1
vote
1answer
31 views

Can logistic regression be used when the dataset has observations from the same users but are unique per day

I have a dataset that captures user information by day (the users are unique per day but often have observations on multiple days) and I want to analyze a binary outcome. Is there a more appropriate ...
0
votes
0answers
28 views

How to calculate statistics for categorical variable level omitted by one-hot encoding?

I'm performing an ordinary least squares regression on a dataset whose predictors are two categorical variables and the dependent variable is continuous. The resulting model gives me stats like the ...
0
votes
0answers
37 views

Why aren't all my categorical variables included in the OLS model from statsmodels?

I'm using statsmodels to perform an Ordinary Least Squares regression between two categorical variables and a continuous dependent variable. My data is structured ...
0
votes
0answers
62 views

coint_johansen test results

I am running the coint_johansen test (Python) on stock data of 3 different banks. The results im getting are the following: Trace statistics: ...
0
votes
0answers
41 views

How to read and extract p & q values from the given ACF & PACF plot with fluctuations?

So I am new to Time-Series and have started with some basic financial data. Since it was not covariance stationary, I transformed it by taking daily percentage changed. The data became stationary and ...
0
votes
1answer
243 views

Measuring Strength of Trend and Seasonalities for Time-Series presenting Multi-Seasonal Patterns

My goal is to cluster time-series which may present daily/weekly/yearly seasonalities. To do so, I plan to use different variables and among them, the following ones: $F_{s_{daily}}$, $F_{s_{weekly}}$ ...
3
votes
5answers
133 views

is logistic regression stochastic like neural network?

I have observed that neural network models (using Keras TensorFlow) can be very unstable (when my sample size is small) in the sense that if I were to train 999 NN models, there might only be 99 with ...
1
vote
1answer
165 views

Standard Errors for LS Means

In Python, I'm trying to validate the LS means from a mixed model that I ran with R's lme4 after using the lsmeans library. I'm using Python's mixedlm() from statsmodels. I've successfully obtained ...
1
vote
0answers
27 views

How to visually verify correlation in a Generalized Linear Model with Binomial Distribution?

I am trying to determine whether my exogenous variables have significant influence over an endogenous variable. This response variable is a count, so I am using a generalized linear model with a ...
1
vote
0answers
38 views

Why does my ARIMA model forecast drastic drop at the second timestamp in the prediction period?

I am trying to reproduce SPSS results with python. I'm using statsmodels SARIMAX package in python. My model produces forecasting results which shows sudden drop at '2020-08-01'. After '2020-08-01', ...
0
votes
0answers
30 views

VECM - Impulse reponse function - statsmodels - AttributeError: 'lr_effects'

I am using statsmodels version '0.11.1'. I am trying to sum cumulative effects of using the impulse response function derived of a VECM, but I am getting an AttributeError regarding 'lr_effects'. As ...
0
votes
0answers
43 views

Granger causality and meaning of lag for time series $X_{t}$ and $X_{t+1}$

Consider 2 time series $X_{t}$ and $X_{t+1}$ created as follows ...
1
vote
1answer
85 views

Statsmodel logit producing param nans, large std err, warnings, but model performance is fine [duplicate]

I keep getting warnings such as RuntimeWarning: invalid value encountered in greaterreturn (a < x) & (x < b) and my model summary is full of nans and ...
0
votes
0answers
33 views

Fitting a VAR model with nonstationary data and possible cointegration

I have time series data from multiple realisations (trials) of the same process in the shape (n_trials, n_sensors, n_times) which I would like to fit a vector ...
0
votes
0answers
66 views

Converting Cohen's $F^2$ to Cohen's $D$

How can I convert Cohen's $F^2$ to Cohen's $D$? I am interested in calculating the effect size for the difference between two groups in a mixed model. The data is from a within-subjects experiment ...
2
votes
0answers
13 views

Suggestion on statistical models that compare likeness

I have a large dataset with thousands of entries. there are two columns the first being a type value (A,B,C,D,E,F) and the second column is a raw data value. I'd like to run statistical analysis on ...
0
votes
0answers
587 views

statsmodels seasonal_decompose(): What is the right “period of the series” in the context of a list column (constant vs. varying number of items)

Assume having a list column so that your time series is nested, see https://stackoverflow.com/questions/63246938/convert-pandas-df-with-data-in-a-list-column-into-a-time-series-in-long-format for ...
0
votes
1answer
238 views

all non-significant or NAN p-values in Logit

I'm running a logit with statsmodels that has around 25 regressors, ranging from categorical, ordinal and continuous variables. My code is the following, with its output: ...
0
votes
0answers
19 views

What do VAR model coeefficient probabilities represent?

I understand that with simple linear regression, each estimated coefficient has an associated p-value that corresponds to the null hypothesis that the coefficient in question is 0. If this p-value is ...
1
vote
0answers
396 views

Difference between forecasting and predicting in statsmodels SARIMAX

I am using SARIMAX model from the statsmodels library to predict(forecast) future values in a time-series. The library contains four methods: predict(), get_predictions(), forecast(), get forecast(). ...
0
votes
0answers
16 views

Maximum likelihood estimation of a 3-parameter logistic function using statsmodels

I would like to fit a 3-parameter logistic function to data using maximum likelihood estimation via statsmodels (and/or pymc3). The logistic function is defined as follows: I am stuck because I don't ...
2
votes
1answer
163 views

chi squared test in python libraries

As I understand it, statsmodels.stats.contingency_tables.Table.test_nominal_association() and scipy.stats.chi2_contingency() ...
5
votes
2answers
97 views

How to find the 95% confidence interval when there is outliers?

I know how to find the 95% confidence interval for normal distributions. But how to find it when there is outliers? Question: The health-care costs, in thousands of dollars for 20 males aged 75 or ...

1
2 3 4 5 6