Proportional hazard model with weibull distribution

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

Dani1
Posts: 6
Joined: Wed Jun 22, 2011 1:54 pm

Proportional hazard model with weibull distribution

Postby Dani1 » Fri Mar 02, 2012 4:52 pm

Hello all,

I have the following problem. I've run a Proportional hazard model in order to examine the hazard rate (probability of a client cancelling his contract given that he has not canceled yet) using a log-logistic distribution with the following programming code:

Code: Select all

' declare params to estimate with initial values coef(30) b = 0 coef(1) a = 1 coef(1) g = 1 ' setup likelihood for Loglogistic Proportional Hazard model logl llllph llllph.append @logl loglllph ' define exponent part llllph.append xb = b(1)+b(2)*bla+b(3)*blabla etc.+b(30)*blablabla ' define log hazard and integrated hazard function llllph.append lhaz=log(a(1))+log(abs(g(1)))+(a(1)-1)*log(abs(g(1))*duration)-log(1+(abs(g(1))*duration)^(a(1))) llllph.append ihaz=log(1+(abs(g(1))*duration)^(a(1))) llllph.append loglllph = y*(xb+lhaz)-exp(xb)*ihaz ' do MLE llllph.ml(d,m=1000) show llllph.output

Since the model with this underlying distribution specification did not seem adequate, I've run the same model (with the same variables) using a weibull distribution. The programming code looks like this:

Code: Select all

' declare params to estimate with initial values coef(30) b = 0 coef(1) a = 1 coef(1) g = 1 ' setup likelihood for Weibull Proportional Hazard model logl llllphwb llllphwb.append @logl loglllph ' define exponent part llllphwb.append xb = b(1)+b(2)*bla+b(3)*blabla etc.+b(30)*blablabla ' define log hazard and integrated hazard function llllphwb.append lhaz=log(a(1))+log(abs(g(1)))+(a(1)-1)*log(abs(g(1))*duration) llllphwb.append ihaz=(abs(g(1))*duration)^(a(1)) llllphwb.append loglllph = y*(xb+lhaz)-exp(xb)*ihaz ' do MLE llllphwb.ml(d,m=1000) show llllphwb.output

However the second model (weibull) gives me a error: WARNING: Singular covariance - coefficients are not unique
This is normally no problem as you just have to delete some variables because they are highly correlated (multicollinearity). In this case however that can not be the problem since I had no problem getting parameter estimations (including standard errors) of the log-logistic model.


My question is, does anybody know what I'm doing wrong here? How can I solve this problem? Thanks in advance.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Proportional hazard model with weibull distribution

Postby EViews Gareth » Fri Mar 02, 2012 4:55 pm

Try different starting values and/or tightening the convergence criteria.

Dani1
Posts: 6
Joined: Wed Jun 22, 2011 1:54 pm

Re: Proportional hazard model with weibull distribution

Postby Dani1 » Fri Mar 02, 2012 5:09 pm

Try different starting values and/or tightening the convergence criteria.
Thanks for your fast reply. I have tried different starting values for the shape parameter gamma (g). This parameter by the way must be positive. The same goes for the slope parameter alpha (a) in the weibull distribution (I think).

How can I thighten the convergence criteria?

Thanks

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Proportional hazard model with weibull distribution

Postby EViews Gareth » Fri Mar 02, 2012 5:10 pm

There's a c= option.

Dani1
Posts: 6
Joined: Wed Jun 22, 2011 1:54 pm

Re: Proportional hazard model with weibull distribution

Postby Dani1 » Fri Mar 02, 2012 5:20 pm

There's a c= option.
I have tried both (using different starting values for alpha and gamma and using a small convergence value of 1e-5) but both dont seem to work.

Perhaps I could estimate a Cox proportional hazard model instead. Do you happen to know where I can find Eviews code for that?

Thanks in advance


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 1 guest