I have programmed a proportional hazard model using the following code:
Code: Select all
' declare params to estimate with initial values
coef(3) 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)*blabla+b(3)*blablala
' 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
smpl @all if log(duration)>0
' do MLE
llllph.ml(d,m=1000)
show llllph.output
' generate genererlized residuals
genr genres_phm_loglog=exp(xb)*log(1+(abs(g(1))*duration)^a(1))
' generate survival function
genr surv=exp(-ihaz)Another thing I could look at is the probability of the event ending in the next period. I could for instance take a certain period and then calculate the expected number of ended durations with the true number of ended durations.
The question is which of these two methods do you think would be more interesting and how can I program this in Eviews. I have the model estimation. How can I use this to make forecast. I tried via proc-estimate, but it doesnt work like that. In OlS you can point click by using proc-forecast. How does this work in a ML-estimated Proportional Hazard Model?
Thanks in advance
