You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create a cure version of the GeneralizedGammaRegressionFitter and looking into the code. My understanding was that the _create_initial_point() method is used to fit a univariate model and use the parameters to initialize the intercepts of the regression model. Is that correct?
If so, I wonder if there could be a bug. If I follow the example in the doc:
from lifelines import GeneralizedGammaRegressionFitter
from lifelines.datasets import load_rossi
df = load_rossi()
df['Intercept'] = 1.
# this will regress df against all 3 parameters
ggf = GeneralizedGammaRegressionFitter(penalizer=1.).fit(df, 'week', 'arrest')
ggf.print_summary()
# If we want fine control over the parameters <-> covariates.
# The values in the dict become can be formulas, or column names in lists:
regressors = {
'mu_': df.columns.difference(['arrest', 'week']),
'sigma_': ["age", "Intercept"],
'lambda_': 'age + 1',
}
ggf = GeneralizedGammaRegressionFitter(penalizer=0.0001).fit(df, 'week', 'arrest', regressors=regressors)
ggf.print_summary()
the model converges and fit the data but if I look into the value of constant_col, I see that (Xs.var(0) < 1e-8).idxmax()
is equal to ('sigma_', 'Intercept').
I was expecting something like:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to create a cure version of the
GeneralizedGammaRegressionFitter
and looking into the code. My understanding was that the_create_initial_point()
method is used to fit a univariate model and use the parameters to initialize the intercepts of the regression model. Is that correct?If so, I wonder if there could be a bug. If I follow the example in the doc:
the model converges and fit the data but if I look into the value of
constant_col
, I see that(Xs.var(0) < 1e-8).idxmax()
is equal to
('sigma_', 'Intercept')
.I was expecting something like:
As a matter of fact, all the intercept columns verify:
(Xs.var(0) < 1e-8)
but I don't understand why we take the max index?Is this intentional or are we missing
mu_
andlambda_
intercepts?Beta Was this translation helpful? Give feedback.
All reactions