BookmarkSubscribeRSS Feed
babaJB
Calcite | Level 5

Hello everyone, I'm trying to reproduce Wright Paper, "Probability Distribution of Outstanding Liability from Individual Payment"  for estimating parameter using Generalized MLE.

log-likelihood for generalisation MLE is :

L=\sum w_j.log(f(x_j|\beta)), using gamma pdf :

1/(beta_1* \Gamma(beta_2)) *(x/beta_1)^(beta_2-1)*exp(-x/beta_1)

Here is the SAS code :

======================================================================

data work.claim;

input x w @@;

datalines;

1268 0.478 2225 0.478 2323 0.478 3135 0.478

3639 0.478 3815 0.478 3935 0.478 4187 0.478

4792 0.478 4960 0.478 5212 0.478 5253 0.478

5395 0.478 5953 0.478 6094 0.478 6210 0.478

6251 0.478 6319 0.478 6401 0.478 6615 0.478

6801 0.478 6905 0.478 7048 0.478 7062 0.478

7418 0.478 7589 0.478 7647 0.478 7886 0.478

8573 0.478 8661 0.478 9244 0.478 9515 0.478

9553 4.480 10043 0.478 10160 0.478 11826 0.478

11905 0.478 12968 0.478 13265 0.478 13609 4.480

16659 0.478 16756 0.478 18455 4.48 19875 0.478

22278 4.480 34091 4.480

;

run;

data par1(type=est);

   keep _type_ beta1 beta2 ;

     _type_='parms'; beta1 = .5;

          beta2 = .5;      output;

     _type_='lb';    beta1 = 1.0e-6;

          beta2 = 1.0e-6;  output;

proc nlp data=work.claim tech=newrap inest=par1 outest=opar1

      outmodel=model cov=2 covariance=h vardef=n pcov phes maxiter=5000;

   max logf;

   parms beta1, beta2;

   profile beta1 beta2 / alpha = .9 to .1 by -.1 .09 to .01 by -.01;

   s = -(w*x)/beta1 ;

   gma = log(GAMMA(beta2));

   a = w*log(x/beta1);

   logf = s-46*w*(log(beta1)+gma)+ (beta2-1)*a;

run;

===================================

This is the output result for my code :

   Optimization Results

                                       Parameter Estimates

                                                                                       Gradient

                                         Approx                          Approx       Objective

   N Parameter         Estimate         Std Err         t Value        Pr > |t|        Function

   1 beta1           300.797609        6.805052       44.202102    2.475435E-39    5.447776E-11

   2 beta2             1.546085        0.024014       64.381872    1.001291E-46    8.901502E-11

The output result is differs significantly from the estimated parameters generated in the paper wright ( beta1=5,742 beta2=2,41). Does anyone have any suggestion whats wrong with the code?. A little help would be much appreciated.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 1386 views
  • 0 likes
  • 1 in conversation