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:
– Nag_CestMethod
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:
– const double
Input
-
On entry: contains the th observation, , for .
Constraint:
, for .
-
4:
– const Integer
Input
-
Note: the dimension,
dim, of the array
ic
must be at least
- when ;
- 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:
– 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
, 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:
– double
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:
– 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 7 in the Introduction to the NAG Library CL Interface).
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_CONVERGENCE
-
The chosen method has not converged in
iterations. You should either increase
tol or
maxit.
- NE_DIVERGENCE
-
The process has diverged. The process is deemed divergent if three successive increments of or increase. Either different initial estimates should be provided or the data should be checked to see if the Weibull distribution is appropriate.
- NE_INITIALIZATION
-
Unable to calculate initial values. This is due to there being either less than two distinct exactly specified observations or exactly two and the largest observation is one of the exact observations.
- NE_INT
-
On entry, .
Constraint: .
- NE_INT_ARRAY_ELEM_CONS
-
On entry, and .
Constraint: or .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
See
Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library CL Interface for further information.
- NE_OBSERVATIONS
-
On entry, there are no exactly specified observations.
- NE_OVERFLOW
-
Potential overflow detected. This is an unlikely error exit usually caused by a large input estimate of .
- NE_REAL
-
On entry, .
Constraint: or .
- NE_REAL_ARRAY_ELEM_CONS
-
On entry, and .
Constraint: .
- NE_SINGULAR
-
Hessian matrix of the Newton–Raphson process is singular. Either different initial estimates should be provided or the data should be checked to see if the Weibull distribution is appropriate.
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 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.