contour.all.nlreg.profiles: Contour Method for 'nlreg' Objects

Description Usage Arguments Details Value Side Effects Note References See Also Examples

View source: R/nlreg.R


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 class '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".

offset1, offset2

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-\code{alpha}=0.9 and 1-\code{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.

lwd1, lwd2

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.

lty1, lty2

line types used to compare different curves in the same plot; default is "solid" for all statistics.

cl1, cl2, col

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".

pch1, pch2

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.


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-\code{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).


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.

Side Effects

If plotit = TRUE, a plot is produced on the current graphics device.


contour.all.nlreg.profiles is a method for the generic function contour for class all.nlreg.profiles. It can be invoked by calling contour for an object of the appropriate class, or directly by calling contour.all.nlreg.profiles.


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.

See Also

nlreg.profile.objects, plot.nlreg.contours, contour


## Not run: 
data(metsulfuron) <- 
    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 )
## <- profile(, trace = TRUE )
par( mai = rep(0.2, 4) )
contour( )
## End(Not run)

nlreg documentation built on Jan. 30, 2019, 5:04 p.m.