Draws the approximate bivariate contour plots for two or all parameters of a nonlinear heteroscedastic model and, on request, returns the list of elements used.
# S3 method for all.nlreg.profiles
contour(x, offset1, offset2, alpha = c(0.1, 0.05),
stats = c("sk", "fr"), ret = FALSE, plotit = TRUE,
drawlabels = FALSE, lwd1 = 1, lwd2 = 1, lty1 = "solid",
lty2 = "solid", cl1 = "blue", cl2 = "red", col = "black",
pch1 = 1, pch2 = 16, cex = 0.5, …)
an all.nlreg.profiles
object, that is, the result of a call to
profile.nlreg
with offset = "all"
.
the two parameters to consider in the approximate bivariate contour plots.
a numerical vector defining the levels of the contours; the default
is c(0.1, 0.05)
, that is, \(1-\alpha=0.9\)
and \(1-\alpha=0.95\).
character value indicating which higher order statistics to plot.
Admissible values are "sk"
for Skovgaard's (1996)
proposal and "fr"
for Fraser, Reid and Wu's (1999)
approach. The default is "sk"
.
logical value; if TRUE
, a list containing the elements
needed to draw the approximate contour plots is
returned. Default is FALSE
.
logical value indicating whether to draw the contours. Default is
TRUE
.
logical value. Contours are labelled if TRUE
.
the line widths used to compare different curves in the same
plot; default is lwd2 = 2
for higher order solutions and
lwd1 = 1
for first order solutions.
line types used to compare different curves in the same plot;
default is "solid"
for all statistics.
colors used to compare different curves in the same plot; default
is cl2 = "red"
for higher order solutions, and
cl1 = "blue"
for the remaining first order statistics.
The default color of the plot is col = "black"
.
character types used to compare different values in the same plot;
default is pch2 = 16
for higher order solutions, and
pch1 = 1
for the remaining first order statistics.
the character expansions relative to the standard size of the
device to be used for printing text. The default is
cex = 0.5
.
absorbs additional arguments such as graphics parameters.
If ret = TRUE
, a list of class nlreg.contours
is returned
which contains the elements needed to draw the profiles and approximate
bivariate contours for two or all parameters in a nonlinear
heteroscedastic model. Otherwise, no value is returned.
If plotit = TRUE
, a plot is produced on the current graphics
device.
The function contour.all.nlreg.profiles
calculates all
elements needed to draw the profile and approximate bivariate contour
plots for respectively two parameters of interest and all parameters
in the model, depending on whether the offset1
and
offset2
arguments are used.
Contour plots represent the bivariate extension of profile plots. Given two parameters of interst, they plot the corresponding joint confidence regions of levels \(1-\alpha\) obtained from the likelihood ratio statistic and the Wald statistic (Bates and Watts, 1988, Section 6.1.2). The closer the two curves are, the more the likelihood surface is quadratic. Usually profile traces are added, that is, the curves showing the constrained maximum likelihood estimates of one parameter as a function of the other, as they provide useful information on how the estimates affect each other. If the asymptotic correlation is zero, the angle between the traces is close to \(\pi/2\). The calculation of exact contour plots is computationally very intesive, as the model has to be refitted several times to obtain the constrained estimates. Bates and Watts (1988, Appendix A.6) present an approximate solution, which only requires the computation of the parameter profiles and which gives rise to the so-called profile pair sketches.
The function contour.all.nlreg.profiles
extends the classical
profile plots and profile pair sketches by including the higher order
solutions \(r^*\) (Barndorff-Nielsen, 1991) and
\(w^*\) (Skovgaard, 2001). The idea is to provide
insight into the behaviour of first order methods such as detecting
possible bias of the estimates or the influence of the model
curvature. More precisely, the sample space derivatives in
Barndorff-Nielsens' (1991) \(r^*\) statistic are
replaced by respectively the approximations proposed in
Skovgaard (1996) and Fraser, Reid and Wu (1999)
depending on the value of the stats
argument.
The \(r^*\) statistic is used to calculate an approximation
to Skovgaard's (2001) \(w^*\) statistic adopting the
method by Bates and Watts (1988, Appendix A.6). This method
can break down, if the two
parameter estimates are strongly correlated. The approximate
contours of \(w^*\) are then missing in the corresponding
panels; four bullets indicate where they intersect the profile
traces.
All necessary quantities are retrieved from the
all.nlreg.profiles
object passed through the
x
argument. The offset1
and offset2
arguments
can be used to specifiy two parameters of interest, in which case
only the profile pair sketches for these two parameters are returned,
one on the original scale and one on the normal scale. On the normal
scale, the units do not express the parameter values themselves, but
the associated likelihood root statistics. (See Bates
and Watts, 1988, Section 6.1.2, for explanation.) If the
offset1
and offset2
arguments are missing, profile
plots and approximate contour plots are drawn for all model
parameters. The plots are organized in form of a matrix. The main
diagonal contains the profile plots. The approximate bivariate
contour plots in the lower triangle are plotted on the original
scale, whereas the ones in the upper triangle are on the \(r\)
scale.
The theory and statistics used are summarized in Brazzale (2000, Chapters 2 and 3). More details of the implementation are given in Brazzale (2000, Section 6.3.2).
Barndorff-Nielsen, O. E. (1991) Modified signed log likelihood ratio. Biometrika, 78, 557--564.
Bates, D. M. and Watts, D. G. (1988) Nonlinear Regression Analysis and Its Applications. New York: Wiley.
Brazzale, A. R. (2000) Practical Small-Sample Parametric Inference. Ph.D. Thesis N. 2230, Department of Mathematics, Swiss Federal Institute of Technology Lausanne.
Fraser, D.A.S., Reid, N. and Wu, J. (1999). A simple general formula for tail probabilities for frequentist and Bayesian inference. Biometrika, 86, 249--264.
Skovgaard, I. M (1996) An explicit large-deviation approximation to one-parameter tests. Bernoulli, 2, 145--165.
Skovgaard, I. M. (2001) Likelihood asymptotics. Scandinavian Journal of Statistics, 28, 3--32.
# NOT RUN {
data(metsulfuron)
metsulfuron.nl <-
nlreg( formula = log(area) ~ log( b1+(b2-b1) / (1+(dose/b4)^b3) ),
weights = ~ ( 1+dose^exp(g) )^2, data = metsulfuron,
start = c(b1 = 138, b2 = 2470, b3 = 2, b4 = 0.07, g = log(0.3)),
hoa = TRUE )
##
metsulfuron.prof <- profile( metsulfuron.nl, trace = TRUE )
par( mai = rep(0.2, 4) )
contour( metsulfuron.prof )
# }
Run the code above in your browser using DataLab