nag_estim_weibull (g07bec) computes maximum likelihood estimates for arguments of the Weibull distribution from data which may be right-censored.
nag_estim_weibull (g07bec) computes maximum likelihood estimates of the arguments of the Weibull distribution from exact or right-censored data.
For
realizations,
, from a Weibull distribution a value
is observed such that
There are two situations:
(a) |
exactly specified observations, when |
(b) |
right-censored observations, known by a lower bound, when . |
The probability density function of the Weibull distribution, and hence the contribution of an exactly specified observation to the likelihood, is given by:
while the survival function of the Weibull distribution, and hence the contribution of a right-censored observation to the likelihood, is given by:
If
of the
observations are exactly specified and indicated by
and the remaining
are right-censored, then the likelihood function,
is given by
To avoid possible numerical instability a different parameterisation
is used, with
. The kernel log-likelihood function,
, is then:
If the derivatives
,
,
,
and
are denoted by
,
,
,
and
, respectively, then the maximum likelihood estimates,
and
, are the solution to the equations:
and
Estimates of the asymptotic standard errors of
and
are given by:
An estimate of the correlation coefficient of
and
is given by:
Note: if an estimate of the original argument
is required, then
The equations
(1) and
(2) are solved by the Newton–Raphson iterative method with adjustments made to ensure that
.
- 1:
– Nag_CestMethodInput
-
On entry: indicates whether the data is censored or non-censored.
- Each observation is assumed to be exactly specified. ic is not referenced.
- Each observation is censored according to the value contained in
, for .
Constraint:
or .
- 2:
– IntegerInput
-
On entry: , the number of observations.
Constraint:
.
- 3:
– const doubleInput
-
On entry: contains the th observation, , for .
Constraint:
, for .
- 4:
– const IntegerInput
-
Note: the dimension,
dim, of the array
ic
must be at least
- when ;
- otherwise.
On entry: if
, then
contains the censoring codes for the
th observation, for
.
If , the th observation is exactly specified.
If , the th observation is right-censored.
If
, then
ic is not referenced.
Constraint:
if , then or , for .
- 5:
– double *Output
-
On exit: the maximum likelihood estimate, , of .
- 6:
– double *Input/Output
-
On entry: indicates whether an initial estimate of
is provided.
If , it is taken as the initial estimate of and an initial estimate of is calculated from this value of .
If
, then initial estimates of
and
are calculated, internally, providing the data contains at least two distinct exact observations. (If there are only two distinct exact observations, then the largest observation must not be exactly specified.) See
Section 9 for further details.
On exit: contains the maximum likelihood estimate, , of .
- 7:
– doubleInput
-
On entry: the relative precision required for the final estimates of
and
. Convergence is assumed when the absolute relative changes in the estimates of both
and
are less than
tol.
If , then a relative precision of is used.
Constraint:
or .
- 8:
– IntegerInput
-
On entry: the maximum number of iterations allowed.
If , then a value of is used.
- 9:
– double *Output
-
On exit: an estimate of the standard error of .
- 10:
– double *Output
-
On exit: an estimate of the standard error of .
- 11:
– double *Output
-
On exit: an estimate of the correlation between and .
- 12:
– double *Output
-
On exit: the maximized kernel log-likelihood, .
- 13:
– Integer *Output
-
On exit: the number of iterations performed.
- 14:
– NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
Given that the Weibull distribution is a suitable model for the data and that the initial values are reasonable the convergence to the required accuracy, indicated by
tol, should be achieved.
nag_estim_weibull (g07bec) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
In a study,
patients receiving an analgesic to relieve headache pain had the following recorded relief times (in hours):
(See
Gross and Clark (1975).) This data is read in and a Weibull distribution fitted assuming no censoring; the parameter estimates and their standard errors are printed.