statsmodels Questions
7
Solved
Given a posterior p(Θ|D) over some parameters Θ, one can define the following:
Highest Posterior Density Region:
The Highest Posterior Density Region is the set of most probable values of Θ that, i...
Cameraman asked 9/3, 2014 at 16:1
3
Solved
Let's assume I have some data I obtained empirically:
from scipy import stats
size = 10000
x = 10 * stats.expon.rvs(size=size) + 0.2 * np.random.uniform(size=size)
It is exponentially distribute...
Mabe asked 23/6, 2014 at 16:40
2
Solved
I produce the following plot using statsmodels STL:
The output is displayed using matplotlib.pyplot.
I would like to get the data from the lines but can't figure out how to extract them, even afte...
Locus asked 29/10, 2020 at 23:17
3
Solved
I'm calculating the Autocorrelation Function for a stock's returns. To do so I tested two functions, the autocorr function built into Pandas, and the acf function supplied by statsmodels.tsa. This ...
Overexert asked 16/3, 2016 at 14:43
1
Solved
from statsmodels.tsa.seasonal import seasonal_decompose
def seasonal_decomp(df, model="additive"):
seasonal_df = None
seasonal_df = seasonal_decompose(df, model='additive')
return sea...
Cholula asked 10/10, 2020 at 16:13
1
I am trying to plot my actual time series values and predicted values but it gives me this error:
ValueError: view limit minimum -36816.95989583333 is less than 1 and is an invalid Matplotlib da...
Vergara asked 1/4, 2018 at 7:17
1
Solved
How can I find and plot a LOWESS curve that looks like the following using Python?
I'm aware of the LOWESS implementation in statsmodels, but it doesn't seem to be able to give me 95% confidence...
Eburnation asked 6/3, 2017 at 23:34
3
Solved
How would I calculate the confidence intervals for a LOWESS regression in Python? I would like to add these as a shaded region to the LOESS plot created with the following code (other packages than...
Teets asked 28/6, 2015 at 20:45
2
I would like to perform a Granger Causality test on time series data using Python Pandas and I have two questions.
(1) I have tried using the pandas.stats.var package, but that seems to be depreca...
Jaqitsch asked 1/3, 2016 at 16:29
3
Solved
I have a .csv file containing a 5-year time series, with hourly resolution (commoditiy price). Based on the historical data, I want to create a forecast of the prices for the 6th year.
I have rea...
Assegai asked 2/8, 2016 at 14:53
3
Solved
I want to evaluate the residuals: (y-hat y).
I know how to do that:
df = pd.read_csv('myFile', delim_whitespace = True, header = None)
df.columns = ['column1', 'column2']
y, X = ps.dmatrices('col...
Varian asked 15/2, 2016 at 19:2
1
Solved
I have this code:
from statsmodels.formula.api import OLS
The error is as follows:
ImportError: cannot import name 'OLS' from 'statsmodels.formula.api'
I tried updating statsmodels, but it does ...
Pika asked 12/8, 2020 at 13:38
1
Solved
This question concerns the best-practice to do descriptive statistics in Python with a formatted output that correspond to tables found in academic publications: means with their respective standar...
Kotick asked 31/1, 2019 at 17:31
2
Solved
From a dataset like this:
import pandas as pd
import numpy as np
import statsmodels.api as sm
# A dataframe with two variables
np.random.seed(123)
rows = 12
rng = pd.date_range('1/1/2017', period...
Piteous asked 30/1, 2018 at 13:27
1
I am using my data to train a GLM model (poisson family) using python statsmodels package. The data I have contains both numeric values and categorical values. I did standardization for numeric val...
Hypotaxis asked 8/7, 2020 at 17:38
1
Solved
I want to calculate (weighted) logistic regression in Python. The weights were calculated to adjust the distribution of the sample regarding the population. However, the results don´t change if I u...
Anxiety asked 5/7, 2020 at 15:2
2
I am a bit confused about the output of Statsmodels Mixedlm and am hoping someone could explain.
I have a large dataset of single family homes, including the previous two sale prices/sale dates f...
Merv asked 27/11, 2017 at 0:12
5
Solved
I have a DataFrame with a few time series:
divida movav12 var varmovav12
Date
2004-01 0 NaN NaN NaN
2004-02 0 NaN NaN NaN
2004-03 0 NaN NaN NaN
2004-04 34 NaN inf NaN
2004-05 30 NaN -0.117647 Na...
Mcfarlin asked 24/12, 2015 at 19:45
0
I am trying to implement the Python version of this 'R' code to compare 2 or more Logistic Regression models by finding deviance statistics
anova(LogisticModel.1, LogisticModel.2)
which gives an o...
Gonyea asked 28/6, 2020 at 11:47
1
Background: I'm developing a program using statsmodels that fits 27 arima models (p,d,q=0,1,2) to over 100 variables and chooses the model with the lowest aic and statistically significant t-statis...
Hutchings asked 5/12, 2014 at 5:15
0
I am using statsmodel for OLS regression. When I clustered the standard error, there was this warning message indicating multicolinearity issue. However, if I just fit the model without clustered e...
Lyell asked 23/6, 2020 at 13:18
3
Although the question seems to have been tackled a lot, I cannot figure out why seasonal decompose doesn't work in my case although I am giving as input a dataframe with a Datetime Index. Here is a...
Izolaiztaccihuatl asked 31/5, 2018 at 5:12
2
Solved
I followed the tutorial to study the SARIMAX model: https://www.digitalocean.com/community/tutorials/a-guide-to-time-series-forecasting-with-arima-in-python-3. The date range of data is 1958-2001.
...
Devlin asked 29/5, 2017 at 6:3
4
Solved
I want to use a logit model and trying to import statsmodels library.
My Version: Python 3.6.8
The best suggestion I got is to downgrade scipy but unclear how to and to what version should I down...
Bruin asked 23/5, 2019 at 21:42
1
For the past few days I'm going crazy with Times series using statsmodels (Python). I am a novice in the TS area, although i do have a better understanding of various regression models. Here is my ...
Athos asked 27/7, 2016 at 15:58
© 2022 - 2024 — McMap. All rights reserved.