\HeaderA{survregDtest}{Verify a survreg distribution}{survregDtest}
\keyword{survival}{survregDtest}
\begin{Description}\relax
This routine is called by \code{survreg} to verify that a distribution
object is valid.
\end{Description}
\begin{Usage}
\begin{verbatim}
survregDtest(dlist, verbose = F)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{dlist}] the list describing a survival distribution
\item[\code{verbose}] return a simple TRUE/FALSE from the test for validity
(the default), or a verbose description of any flaws.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
If the \code{survreg} function rejects your user-supplied distribution
as invalid, this routine will tell you why it did so.
\end{Details}
\begin{Value}
TRUE if the distribution object passes the tests, and either FALSE or a
vector of character strings if not.
\end{Value}
\begin{Author}\relax
Terry Therneau
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{survreg.distributions}{survreg.distributions}}, \code{\LinkA{survreg}{survreg}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
# An invalid distribution (it should have "init =" on line 2)
#  surveg would give an error message
mycauchy <- list(name='Cauchy',
                 init<- function(x, weights, ...) 
                      c(median(x), mad(x)),
                 density= function(x, parms) {
                      temp <- 1/(1 + x^2)
                      cbind(.5 + atan(temp)/pi, .5+ atan(-temp)/pi,
                            temp/pi, -2 *x*temp, 2*temp^2*(4*x^2*temp -1))
                      },
                 quantile= function(p, parms) tan((p-.5)*pi),
                 deviance= function(...) stop('deviance residuals not defined')
                 )

survregDtest(mycauchy, TRUE)
\end{ExampleCode}
\end{Examples}

