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 parameter
is required, then
The equations
(1) and
(2) are solved by the Newton–Raphson iterative method with adjustments made to ensure that
.
- 1: – Character(1)Input
-
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: – Real (Kind=nag_wp) arrayInput
-
On entry: contains the th observation, , for .
Constraint:
, for .
- 4: – Integer arrayInput
-
Note: the dimension of the array
ic
must be at least
if
, and at least
otherwise.
On entry: if
,
contains the censoring codes for the
th observation, for
.
If , the th observation is exactly specified.
If , the th observation is right-censored.
If
,
ic is not referenced.
Constraint:
if , then or , for .
- 5: – Real (Kind=nag_wp)Output
-
On exit: the maximum likelihood estimate, , of .
- 6: – Real (Kind=nag_wp)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
, 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, the largest observation must not be exactly specified.) See
Section 9 for further details.
On exit: contains the maximum likelihood estimate, , of .
- 7: – Real (Kind=nag_wp)Input
-
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 , a relative precision of is used.
Constraint:
or .
- 8: – IntegerInput
-
On entry: the maximum number of iterations allowed.
If , a value of is used.
- 9: – Real (Kind=nag_wp)Output
-
On exit: an estimate of the standard error of .
- 10: – Real (Kind=nag_wp)Output
-
On exit: an estimate of the standard error of .
- 11: – Real (Kind=nag_wp)Output
-
On exit: an estimate of the correlation between and .
- 12: – Real (Kind=nag_wp)Output
-
On exit: the maximized kernel log-likelihood, .
- 13: – IntegerOutput
-
On exit: the number of iterations performed.
- 14: – Real (Kind=nag_wp) arrayWorkspace
-
- 15: – IntegerInput/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this argument, the recommended value is
.
When the value is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
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.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. 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.