Computing derivative using finite differnce method



I am working with MLECOV function.

Inorder to compute the asympotic covariance of the MLE of Weibull
distribution, I took the data set:

x=[1.8487;0.3761;0.75;3.053;1.3545;1.8802;1.57;1.7708;1.3592;3.0466;1.
7961;1.5319;0.5903;0.6288;0.6461;1.6560;1.7172;1.931;1.0509;1.6173;1.3
162;0.7705;1.8889;1.8889;4.1505];

The data is from a solved example of "Life testing and reliablity
estimation", S K Sinha & B. K .Kale.

The MLE for the parameters are
a=2.035, b=3.381

and the loglikehood function for the Weibull distribution fuction:

nloglf=25*(log(a)-log(b))+(a-1)*8.37031865 ...
-(x(1)^a+x(2)^a+x(3)^a+x(4)^a...
+x(5)^a+x(6)^a+x(7)^a+x(8)^a...
+x(9)^a+x(10)^a+x(11)^a+x(12)^a...
+x(13)^a+x(14)^a+x(15)^a...
+x(16)^a+x(17)^a+x(18)^a...
+x(19)^a+x(20)^a+x(21)^a...
+x(22)^a+x(23)^a+x(24)^a...
+x(25)^a)/b;

When I run function

acov=mlecov(params,x,'nloglf',@nloglf)

then we get

acov = NaN NaN
NaN NaN

with the warning

Warning: Cannot compute a cov matrix -- the computed Hessian is not
positive definite.

The closed form solution of the Hessian matrix given in the book is:

Hessain matrix = 28.02844 -6.108481
-6.108481 2.187003

This is however a postive definite matrix.
.



Relevant Pages

  • Re: Computing derivative using finite differnce method
    ... Inorder to compute the asympotic covariance of the MLE of Weibull ... I took the data set: ... and the loglikehood function for the Weibull distribution fuction: ...
    (comp.soft-sys.matlab)
  • Re: Predicting using SAS-Survival analysis
    ... The problem with simply using the highest likelihood is that those ... one parameter, Weibull, logistic, log-normal, normal, and log-logistic ... are two-parameter distributions, and gamma has three. ... chi-square distribution with 1 degree of freedom, ...
    (sci.stat.edu)
  • Re: Predicting using SAS-Survival analysis
    ... The problem with simply using the highest likelihood is that those ... one parameter, Weibull, logistic, log-normal, normal, and log-logistic ... are two-parameter distributions, and gamma has three. ... chi-square distribution with 1 degree of freedom, ...
    (sci.stat.math)
  • Re: Distribution fitting
    ... > Peter Perkins wrote: ... >> Jan Van den Bulcke wrote: ... >>> like a distribution. ... >> which, if you plotted them against 1:n, look like a Weibull (or ...
    (comp.soft-sys.matlab)
  • Re: Distribution Fitting and GoF Tests
    ... Regarding the p-value, I'm assuming the higher the p-value, the ... to be significant if you use the entire data set. ... from the theoretical distribution might be statistically ... It's true that the K-S test and some others require that the ...
    (comp.soft-sys.matlab)