statsmodels Questions
1
Solved
I am fitting an OLS model using statsmodels. I need to return the slope of the fitted line.
model = sm.OLS(y, X)
results = model.fit()
results.fittedvalues gives me the points of the line. How ...
Fennel asked 6/6, 2014 at 17:45
1
Solved
I am modelling data for a logit model with 34 dependent variables,and it keep throwing in the singular matrix error , as below -:
Traceback (most recent call last):
File "<pyshell#1116>", l...
Merrillmerrily asked 24/5, 2014 at 17:45
2
Solved
I want to visually explore the relationship between two variables. The functional form of the relationship is not visible in dense scatter plots like this:
How can I add a lowess smooth to the s...
Intermix asked 21/5, 2014 at 13:18
2
Solved
I have a dataframe with columns, both of which I intend to treat as categorical variables.
the first column is country , which has values such as SGP, AUS, MYS etc. The second column is time of d...
Galvanism asked 15/5, 2014 at 8:2
1
Solved
I'm running a ridge regression on somewhat collinear data. One of the methods used to identify a stable fit is a ridge trace and thanks to the great example on scikit-learn, I'm able to do that. An...
Antlion asked 14/5, 2014 at 16:22
1
Solved
If I do sudo pip3 install statsmodels I get errors. I pasted the end of the console output below. I see a numpy 1.7 warning, yet if I do pip3 freeze | grep numpy, I see that I'm using numpy==1.8.1....
Hoashis asked 28/4, 2014 at 14:16
1
Solved
I want to have a coefficient and Newey-West standard error associated with it.
I am looking for Python library (ideally, but any working solutions is fine) that can do what the following R code is...
Falstaffian asked 2/5, 2014 at 3:54
2
Solved
Say I want to put a custom prior on two variables a and b in PyMC, e.g.:
p(a,b)∝(a+b)^(−5/2)
(for the motivation behind this choice of prior, see this answer)
Can this be done in PyMC? If so ho...
Tellez asked 21/4, 2014 at 13:18
2
Solved
I have a nonlinear model fit that looks like this:
The dark solid line is the model fit, and the grey part is the raw data.
Short version of the question: how do I get the likelihood of this mo...
Cobaltous asked 11/4, 2014 at 5:42
1
Solved
I am working on a logistic regression model and I am having trouble understanding how to take the model fit from my training set onto my testing set. Sorry, I am new to python and VERY new to stats...
Tobin asked 13/4, 2014 at 21:32
1
Solved
When I want to fit some model in python,
I often use fit() method in statsmodels.
And some cases I write a script for automating fitting:
import statsmodels.formula.api as smf
import pandas as pd
...
Vostok asked 11/4, 2014 at 16:50
1
Solved
How would I plot my linear regression results for this linear regression I did from pandas?
import pandas as pd
from pandas.stats.api import ols
df = pd.read_csv('Samples.csv', index_col=0)
contr...
Helban asked 28/3, 2014 at 8:22
1
Solved
It is common to want to append the results of predictions to the dataset used to make the predictions, but the statsmodels predict function returns (non-indexed) results of a potentially different ...
Commentator asked 22/3, 2014 at 16:43
3
Solved
Say I have several histograms, each with counts at different bin locations (on a real axis).
e.g.
def generate_random_histogram():
# Random bin locations between 0 and 100
bin_locations = np.r...
Mullane asked 18/3, 2014 at 15:3
1
Solved
I posted a IPython notebook here http://nbviewer.ipython.org/gist/dartdog/9008026
And I worked through both standard Statsmodels OLS and then similar with PYMC3 with the data provided via Pandas, ...
Teaser asked 14/2, 2014 at 20:16
1
I am trying to fit some models (Spatial interaction models) according to some code which is provided in R. I have been able to get some of the code to work using statsmodels in a python framework b...
Massive asked 14/2, 2014 at 16:52
3
I am working on time series in python. The libraries which I found useful and promising are
pandas;
statsmodel (for ARIMA);
simple exponential smoothing is provided from pandas.
Also fo...
Elimination asked 4/10, 2012 at 11:38
3
I am trying to write code to produce confidence intervals for the number of different books in a library (as well as produce an informative plot).
My cousin is at elementary school and every week...
Noellenoellyn asked 30/1, 2014 at 10:9
1
Solved
I have tried with both the (pandas)pd.ols and the (statsmodels)sm.ols to get a regression scatter plot with the regression line, I can get the scatter plot but I can't seem to get the parameters to...
Seaware asked 23/1, 2014 at 19:27
1
Solved
I am trying to use the predict() function of the statsmodels.formula.api OLS implementation. When I pass a new data frame to the function to get predicted values for an out-of-sample dataset result...
Otalgia asked 22/12, 2013 at 0:18
2
Solved
(problem resolved; x,y and s1,s2 were of different size)
in R:
x <- c(373,398,245,272,238,241,134,410,158,125,198,252,577,272,208,260)
y <- c(411,471,320,364,311,390,163,424,228,144,246,371...
Veteran asked 20/12, 2013 at 18:52
1
Solved
I have 3 dataframes containing 7 columns.
df_a
df_b
df_c
df_a.head()
VSPD1_perc VSPD2_perc VSPD3_perc VSPD4_perc VSPD5_perc VSPD6_perc \
0 NaN NaN NaN NaN NaN NaN
3 0.189588 0.228052 0.268460 0...
Skindeep asked 19/12, 2013 at 7:13
1
wls_prediction_std returns standard deviation and confidence interval of my fitted model data. I would need to know the way the confidence intervals are calculated from the covariance matrix. (I al...
Gilbertson asked 13/12, 2013 at 17:41
1
Solved
I would like to generate random numbers with a given mean, variance, skewness, and kurtosis from the Pearson system. I can do this in MATLAB using "pearsrnd" -- does scipy, statsmodels, or any othe...
Headfirst asked 11/11, 2013 at 16:5
1
I am trying to apply Logistic Regression in Python using statsmodel.api.Logit.
I am running into the error
ValueError: array must not contain infs or NaNs.
When I am executing with:
data['inter...
Dardar asked 7/10, 2013 at 11:16
© 2022 - 2024 — McMap. All rights reserved.