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.outputSince 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.outputHowever 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.
