Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
5 views

VECM Impulse Response Function with log levels data

I'm looking for some helping interpreting the IRF of a VECM. I have trained a VECM on a set of cointegrated log level daily time series using the [StatsModels implementation][1]. I decided to use a ...
0
votes
0answers
18 views

within-subject regression analysis

I have three levels (suppose A,B, and C) in my experiment and wish to do within-subject regression analysis. All the 3 levels are manipulated within-subject. Also A is outcome category, B is outcome ...
0
votes
0answers
10 views

Scaling/Normalizing data in Stats Models [closed]

Is there a way to scale data in python's statsmodels? I've tried using standardscaler from sklearn, then plugging the data into statsmodels, but there's some kinks in the process that I can't yet ...
0
votes
0answers
15 views

Running multivariate multiple regression in statsmodels [closed]

I'm trying to run a multivariate multiple regression in statsmodels, as it gives more model details than sklearn. While I am able import a logistic regression function through 'import statsmodels.api',...
0
votes
0answers
39 views

How to use Partial Autocorrelation (PACF) to determine the exact seasonal period in SARIMA model

I am currently using PACF values to determine the length of seasonal period which are further used in fitting SARIMA model. I use 90-day history to forecast for 30 days. My current method is to ...
1
vote
1answer
42 views

Python ARIMA generates different predictions than SARIMAX for same orders

I was under the impression that Python Statsmodels SARIMAX with seasonal order parameters set to 0 will generate the same forecasts as ARIMA. But apparently the forecasts are wildly different. What ...
0
votes
0answers
42 views

Why are the critical values in coint_johansen in statsmodels in Python so different from the ones in ca.jo in urca in R?

When i run the same johansen test across Python and R I get very different critical values. If I normalize the two columns in <...
0
votes
0answers
33 views

regression change point model

I am novice at best with linear regression models and I am interested to learn how to do a change point model in Python if possible. The data that I analyze is a years worth of electrical energy (kWh) ...
1
vote
1answer
45 views

Paired samples t test in Python

I'm trying to conduct a paired samples t-test in Python (statsmodels package), but I don't see a function for it in their documentation. The closest I can find is ttost_paired, but I don't think its ...
0
votes
1answer
65 views

Statsmodels' Negative Binomial: after .fit_regularized(), how to turn PMF into PPF to get the discrete values?

I used the package statsmodels to fit a Negative Binomial to my data. This data contains ~1500 samples with 21 covariates. Since I have overdispersion in my data ...
0
votes
1answer
90 views

2-way ANOVA in Python statsmodels yields different Sum of Squares than SPSS

I am learning to use Python for my statistical analyses, and while figuring out how to perform a 2-way ANOVA with statsmodels I found that my Python code yielded slightly aberrant values. Comparing ...
1
vote
1answer
46 views

Apply statsmodels PCA to new data

I am working on a personal project, and I want to use Statsmodels' PCA on a dataset. The ultimate goal is to then perform a linear regression and evaluate its prediction. I know scikit-learn may be ...
0
votes
1answer
41 views

Ljung-Box test on a out of sample residue with good forecast

To test the fbprophet library, I created a very simple synthetic series and generated a model like this: ...
4
votes
1answer
37 views

Appropriate Distribution for Survival Probability Parameters

I have a model that assumes a probability of survival over discrete time (example: decades) ...
0
votes
1answer
43 views

zero inflated poisson iregression AIC values

Im trying to regress count data (DV). There are a few IV's both continuous and categorical. Frequency count of my DV as show below.Two groups , treatment and control. About 75 % are zeros. ...
0
votes
1answer
73 views

Tukey HSD plot_simultaneous - how does it work?

I have performed a Tukey HSD in Python. I am not sure what values are plotted when using the .plot_simultaneous() command (see statsmodels documentation). The resulting plot is: I am wondering: how ...
0
votes
0answers
75 views

Are these Granger-causality F-tests equivalent?

I am comparing results of a Granger causality implementation I wrote in Python to the established package statsmodels, and noticed that the equation implemented has a scaling factor equal to the ...
0
votes
0answers
13 views

How to interpret regression results when there are categorical independent variables? (statsmodels | python) [duplicate]

I'm using a toy dataset from sklearn and adapted it for a linear regression framework. In this example, I'm constructing a ...
0
votes
2answers
48 views

Is this linear model overfitting when I add more parameters?

I am trying to figure out if my models are overfitting. This is a trend I noticed with my actual dataset associating metadata with compositional data. The more parameters I add, the better the ...
8
votes
2answers
5k views

Can we say 50% of data will be between 25th-75th percentile?

Let's say we have the following dataframe: ...
1
vote
0answers
21 views

How does Noise affect the results of Transfer Entropy?

I was reading about Transfer Entropy and came across this package: https://cran.r-project.org/web/packages/TransferEntropy/TransferEntropy.pdf The code in the package: ...
0
votes
3answers
140 views

SARIMAX(1,0,0)(0,0,0,0): Regression with ARMA errors or ARMAX?

I'm trying to unravel the influences of various exogenous regressors on a time series dataset. I'm getting good results with a sarimax(1,0,0)(0,0,0,0) specification, but I'm confused about the ...
6
votes
1answer
251 views

The identity link function does not respect the domain of the Gamma family?

I am using using a gamma generalized linear model (GLM) with an identity link. The independent variable is the compensation of a particular group. Python's statsmodels summary is giving me a warning ...
0
votes
0answers
24 views

Help me interpret a few lines of code and their results? (correlation analysis / CCA / Validation)

I have a few lines of code, using an R package to explore canonical correlation between two datasets. I really cannot make sense of the results, even if I read the documentation or academic articles ...
0
votes
0answers
69 views

ADF test and seasonal series

Hi I'm new in the time series field and so I've different doubts. Considering this dataset https://archive.ics.uci.edu/ml/datasets/Individual+household+electric+power+consumption And considering ...
1
vote
2answers
64 views

Nonlinear regressor in GLM link function

Try to reproduce Robert E. McCulloch and Ruey S. Tsay’s paper Nonlinearity in High-Frequency Financial Data and Hierarchical Models with local market data. the paper uses GLM to model high-frequency ...
0
votes
0answers
160 views

Discussion of a parameter in the python statsmodels augmented Dickey Fuller test

I would like to use the adfuller test from statsmodels.tsa.stattools, but I'm not sure when to change the parameter ...
1
vote
0answers
55 views

How to make statsmodels treat timeseries values as continuous? [closed]

This is basically a copy of the stackoverflow question here, which never received an adequate answer. The problem is that the Python's statsmodels package insists ...
1
vote
0answers
22 views

Which model for testing “has this binary variable changed over time?”

I am trying to figure out if a list of historical documents (N=50) drifted from one value of a binary variable $w$ to the other. Users have given 1 to 5 votes whether they think they think the ...
3
votes
2answers
474 views

Why is gradient descent so bad at optimizing polynomial regression?

As part of a self-study exercise, I am comparing various implementations of polynomial regression: Closed form solution Gradient descent with Numpy Scipy optimize Sklearn Statsmodel When the ...
1
vote
2answers
101 views
1
vote
1answer
216 views

Interpretation of PACF and ACF plots [duplicate]

I am trying to fit an ARMA model to a time series of a power spectral density values that I have calculated. Here is the plot of the data: with corresponding autocorrelation and partial ...
0
votes
0answers
158 views

Convergence Warning while Determining the order of ARMA model using arma_order_select_ic

I have got around 150 companies returns' data and I am trying to determine the arma order of p and q for each company. I came across the arma_order_select_ic function in the statsmodel library and ...
0
votes
1answer
43 views

Can log-likelihood of the data decrease when adding parameters in a linear mixed model?

I'm trying to fit different linear mixed models in the context of model selection. I'm using the StatsModel Python package in order to do that. However, I encounter a very strange phenomenon. Say I ...
2
votes
0answers
522 views

Ljung-Box test p-values

I am using the Ljung-Box test from the python statsmodel package to test if there are autocorrelations in a time series. To make sure I understand the test, I am performing it on white noise and ...
2
votes
1answer
30 views

model building - regression in statistical analysis

I have a theoretical question regarding model building. I have some real empirical data, but I will present the problem in more general terms. I have two groups. I have a dependent variable, and an ...
1
vote
2answers
298 views

Mixed Effects Model with Pre-Post Dependent Variable

I have a dataset that most likely requires a mixed effects model, but which has a few quirks that make me want to confirm that my current modeling approach is correct. Background My DV is a ...
0
votes
2answers
925 views

statsmodels SARIMAX forecast has downward slope

I fit a statsmodels.tsa.statespace.sarimax.SARIMAX model (statsmodels==0.8.0) but I'm getting unexpected forecasting behavior, ...
0
votes
0answers
363 views

Running a Logistic regression - overflow error [duplicate]

I am running a logit regression and the "field1" is an existing list of 1's and 0's (which I am converting into a numpy list before passing as a parameter to Logit). I am trying to come up with a ...
0
votes
1answer
72 views

Possibility of performming Timeseries Modeling and forecasting on per second (high frequency data)

I want to perform an analysis on timeseries data which is measured per second. To give some context, it is a data of temperature of air at the exit of air heater. Fluctuations in data are either due ...
0
votes
0answers
265 views

Interpret regression model actual vs predicted plot far off of y=x line

I'm working in Python with statsmodels. I estimate an OLS multiple regression model (n=10763; 12 predictors; r^2=0.29) The model coefficients all have signs pointing the correct theoretical direction ...
1
vote
1answer
177 views

Why does matrix condition number change drastically when a constant is added?

If I create a regression model design matrix with 3 uncorrelated variables, I get a small condition number as expected. MWE: ...
0
votes
2answers
367 views

Regression model constant causes multicollinearity warning, but not in standardized model

I'm working in Python with statsmodels. I have a response variable y and a design matrix X from which I have already removed the ...
1
vote
1answer
455 views

Difference in R-squared observed from statsmodels when WLS is used

Recently I have been trying to solve one of my problems with OLS and WLS respectively, and was trying to determine whether a weighted regression would be more suitable by comparing the R^2 value. I ...
0
votes
0answers
15 views

Minimum how many variables required for running GzLM or GAM?

I am interested to find, out of 3 different traps (Treatment), which trap catching more insects (Responder). Data is not normally distributed and overdispersed. Here is my data; ...
4
votes
0answers
2k views

Assessing A/B test results using Python

Problem's setting Assume having results of an A/B test. You let you users experience two variants of your website and you counted how many converted: ...
1
vote
2answers
3k views

Standard error of regression and of predictions in python (these are available in R) [closed]

I'm working with R and confirming my results in Python with the overwhelming majority of the work matching between the two quite well. There are two outputs coming out of R that I'm not seeing how to ...
0
votes
0answers
759 views

python StatsModels use training parameters for test data summary

I ran a linear regression on a month of hourly Nox concentration using StatsModels ols function. how can I get summary OLS Regression Results on the test data? I ...
0
votes
0answers
30 views

Conditional density distribution, two discrete variables

I have plotted the conditional density distribution of my variables by using cdplot. My independent variable and my dependent variable are not independent. Independent variable is discrete (it takes ...
0
votes
0answers
15 views

Analysis of power after filtering but before calculating t-statistic

Suppose I want to calculate many t-statistics from some arrays of data. The length n of these arrays changes depending on a filtering step I perform previously. ...