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:
– Integer
Input
-
On entry: , the number of observations.
Constraint:
.
-
3:
– Real (Kind=nag_wp) array
Input
-
On entry: contains the th observation, , for .
Constraint:
, for .
-
4:
– Integer array
Input
-
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:
– Integer
Input
-
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:
– Integer
Output
-
On exit: the number of iterations performed.
-
14:
– Real (Kind=nag_wp) array
Workspace
-
-
15:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended.
When the value or 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.
Background information to multithreading can be found in the
Multithreading documentation.
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.