Maithili Shiva
2009-Mar-26 08:40 UTC
[R] (Interpretation) VGAM - FRECHET 3 parameters by maximum likelihood estimation for
Dear R Helpers
This is the R code (which I have slightly changed) I got in VGAM package for
estimating the parameters of FRECHET.
_________________________________________________________________
y = rfrechet(n <- 100, shape=exp(exp(0))) # (A)
fit3 = vglm(y ~ 1, frechet3(ilocation=0), trace=TRUE, maxit=155) # (B)
coef(fit3, matrix=TRUE) # (C)
Coef(fit3) # (D)
fitted(fit3)[1:5,] # (E)
mean(y) # (F)
weights(fit3, type="w")[1:5,] # (G)
vcov(fit3) # (H)
fit3 at extra$location[1:3] # Estimate of the location parameter # (I)
fit3 at extra$LHSanchor # Anchor Point # (J)
_________________________________________________________________
When I run these commands using R I get following output corresponding to each
command line
OUTPUT # (A)
[1] 0.7495887 1.1578511 0.8872487 0.7781103 1.1026540 1.8557026 1.1527270
1.1538885
[9] 1.0436005 0.8702552 1.0326653 1.1456378 1.1292287 0.9779141 0.7882611
2.0040318
[17] 0.8832376 1.6684632 0.7112340 1.8440806 0.8103669 0.6171517
0.6632612 0.9288173
[25] 1.2625774 1.2371949 2.3995687 0.9674406 1.2205647 2.2997349
1.3561988 1.0257294
[33] 0.7693035 1.3112102 1.2841138 0.5207330 0.8861406 0.7819666
1.1376008 1.3396068
[41] 0.6828540 0.7358596 0.8678724 1.1191930 0.9581007 0.8645687
1.0269345 0..9853376
[49] 0.7861684 2.2938797 0.5994656 1.3733527 3.0904095 2.7179989
0.8408945 0.9995262
[57] 1.0456575 0.6139744 17.4274447 0.5928158 1.6172649 0.7354806
1.4714551 0.7851852
[65] 1.9091740 1.0862915 1.9082128 1.0051395 1.0991948 1.6698645
2.8901334 0.8174091
[73] 1.3964180 0.7452934 0.8133906 1.2417527 2.1583672 1.1822409
0.8068691 0.8410480
[81] 1.2394454 1.3391757 1.0867579 1.3395385 1.2791401 0.7897431
1.2112373 1.6531473
[89] 1.7432403 6.7756058 0.9385585 1.5561437 0.9590773 0.7936483
2.5215168 1.1984615
[97] 0.6345925 1.4218795 2.3178357 1.5454827
OUTPUT # (B)
In vglm.fitter(x = x, y = y, w = w, offset = offset, Xm2 = Xm2, : convergence
not obtained in 155 iterations.
OUTPUT # (C)
> coef(fit3, matrix=TRUE)
log(difference) log(scale) loglog(shape)
(Intercept) -0.7954072 -0.1283776 -0.03175329
OUTPUT # (D)
> Coef(fit3))
difference scale shape
0.4513974 0.8795212 2.6346374
(IS IT THAT THESE GIVE THE SCALE AND SHAPE PARAMETER ESTIMATES OF FRECHET.?)
OUTPUT # (E)
> fitted(fit3)[1:5,]
[1] 1.339454 1.339454 1.33954 1.339454 1.339454
(WHAT DOES THIS MEAN?)
OUTPUT # (F)
> mean(y)
[1] 1.439024
OUTPUT # (G)
weights(fit3, type="w")[1:5,]
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 24.264915 46.60547 38.864660 -33.624853 40.492033 -29.075460
[2,] 7.599936 14.18608 1.554636 -9.724618 2.440009 -2.670739
[3,] 6.486803 26.53437 1.855081 -12.926846 -5.700736 2.433455
[4,] 16.768849 37.36856 36.299447 -25.025068 34.078418 -22.643518
[5,] 9.562077 15.87083 2.671884 -11.625172 4.418292 -4.454716
(WHAT DOES THIS MEAN?)
OUTPUT # (H)
vcov(fit3)
(Intercept)1 (Intercept)2 (Intercept):3
(Intercept) : 1 0.0022605491 0.0021317673 -1.576056e-04
(Intercept) : 2 0.0021317673 0.0020926942 -1.780387e-04
(Intercept) : 3 -0.0001576056 -0.0001780387 3.892675e-05
Warning message:
In summaryvlm(object, corr = FALSE, dispersion = dispersion) : the estimated
variance-covariance matrix is usually inaccurate as the working weight matrices
are a crude BFGS quasi-Newton approximation
OUTPUT # (I)
fit3 at extra$location[1:3] # Estimate of the location parameter
1 2 3
0.06930899 0.06930899 0.06930899
(What does this MEAN? IS IT THAT 'D' gives SCALE and SHAPE parameter
whereas this gives me LOCATION parameter?)
OUTPUT # (J)
fit3 at extra$LHSanchor # Anchor point
[1] 0.520733
(What does this mean?)
My problem is to calculate the estimators of 3 Parameter FRECHET distribution.
Which of the above figures give me estimates of the three parameters of the
FRECHET distribution.
With regards and thanking in advance,
Maithili
Connect with friends all over the world. Get Yahoo!
