Questions tagged [statmodels]
29 questions
3
votes
1 answer
Time Series Prediction with statsmodels.tsa.arima.model import ARIMA
I am trying to make prediction on my ARIMA Model but I stucked in one point
from statsmodels.tsa.arima.model import ARIMA
train2 = trainData1["meantemp"][:1170]
test2 = trainData1["meantemp"][1170:]
# p,d,q ARIMA Model
model = ARIMA(train2,…

Ugur Selim Ozen
- 159
- 3
- 10
3
votes
1 answer
statsmodel - TypeError: fit() got an unexpected keyword argument 'disp'
I'm working on some forecasts using statsmodels' arima model.
This used to work well with
model_result = model.fit(disp = -1)
but it seems that disp no longer seems to be working…

Anna Bleha
- 63
- 1
- 1
- 7
2
votes
0 answers
using statsmodels.api for train and test with logistic regression in Python
Starting from a dataframe df, I created some train and test data with this code
X_train, X_test, y_train, y_test = train_test_split(
X, Y, test_size=.2, random_state=1)
Now I would like to train data and test results, but I’m not sure how to…

progster
- 877
- 3
- 15
- 27
2
votes
1 answer
No confidence interval are shown when using plot_acf
I have the following code:
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
from pandas import ExcelWriter
import numpy as np
import pandas as pd
import seaborn as sns
import statsmodels.formula.api as smf
import statsmodels.tsa.api as…

Luigi87
- 265
- 4
- 13
2
votes
1 answer
AttributeError: module 'statsmodels' has no attribute 'datasets'
I am using the code in this post:
Fitting empirical distribution to theoretical ones with Scipy (Python)?
However, it keeps giving me this error:
File "fitdistr.py", line 102, in
data =…

user2012677
- 5,465
- 6
- 51
- 113
1
vote
0 answers
Is there a way to create a partial regression plot in Python?
I have a question regarding the statmodels graphic module.
Let's assume I have built a linear regression with an interaction term:
import statsmodels.formula.api as smf
reg = smf.ols(data=data,
formula= "y ~ age + C(group,…

Luis_12345
- 55
- 6
1
vote
0 answers
ETS model in statsmodels library
I have several questions regarding the ETS model in statsmodels library. The description of the model can be found here.
The default initialization_method is estimated. In the description, it says ‘estimated’ uses the same heuristic as initial…

ycenycute
- 688
- 4
- 10
- 20
1
vote
1 answer
Predict future values using linear regression
So i've made a model for values prediction using linear regression. And now i need to get it to predict for 2022-2024 years into the future. how can i do it? maybe add rows 2023-2024 to dataframe? but will it be correct?
Data
data['Year'] =…

kiwi555
- 21
- 4
1
vote
1 answer
Time series Analysis ,checking for stationarity using Kwiatkowski–Phillips–Schmidt–Shin (KPSS)
I am performing a time series analysis and was checking for stationarity using Kwiatkowski–Phillips–Schmidt–Shin (KPSS). I have loaded the data using the following:
import pandas as pd
import numpy as np
path =…

Derrick Kuria
- 159
- 1
- 10
1
vote
0 answers
statmodels inside a class giving shape error
I'm using the following model with statmodels.
import statsmodels.api as sm
class MultiLinRegLearner_A:
"""This class defines a Multi Linear regression algorithm."""
def __init__(self, X_train, Y_train):
self.X_train =…

user5484106
- 13
- 3
1
vote
0 answers
How to, extract specific information from a GLM summary table in Python
After ruuning a glm model by this Python code :
mod1 = sm.GLM(response, predictors, family=sm.genmod.families.family.Gaussian()).fit()
print(mod1.summary())
I got the following summary table :
I know how to extarct the coefficient, but I would like…

Jacques Troussart
- 53
- 7
1
vote
0 answers
Residuals for cumulative penalized ordinal models with ordinalNet in R
I'm using the ordinalNet package in R for a cumulative elastic model.
I want use surrogate residuals for the diagnostics.
The package sure doesn't work with ordinalNet models.
Someone knows others packages to get residuals for ordinalNet or can you…
0
votes
0 answers
Fast Kernel Regression in Python?
I am running repeated simulations in the context of 1D non-parametric regression in order to evaluate the performance of some non-parametric methods. the Nadayara-Watson kernel estimate is one of these methods. But, i am struggling a bit with…

BabaUtah
- 11
- 2
0
votes
1 answer
AttributeError: 'ModelData' object has no attribute 'design_info'
I am unable to perform annova on a linear regression model. I have attached the simplified code below. Please let me know how to fix it.
import statsmodels.api as sm
import numpy as np
# define the data
x1 = np.random.rand(100)
x2 =…

randomGeek4
- 151
- 1
- 2
- 7
0
votes
0 answers
Calculate power and effect size using stat models - one sample 'two-sided' binomial test
Trying to perform power statistics to calculate power and effect size for a one sample two-sided binomial test using stat models. For the Pearson g-o-f test it is working but same for binomial test gives an error (I pasted below). how to solve this…

pranav nerurkar
- 596
- 7
- 19