nlsrk (version 1.1)

nlscontour: Contour plot for nonlinear least squares

Description

Takes as central values the results of non-linear least square fitting by the nls(base, stats) function, then draws a contour plot of the residual sum of squares function around these values.

Usage

nlscontour(x, param1 = 1, param2 = 2, range1 = NULL, range2 = NULL, 
	npoints = 100, filled = FALSE,colored=FALSE)

Arguments

x

a nls model

param1

The number of the first parameter to plot in the parameters list of model formula

param2

The number of the second parameter to plot

range1

The range (min and max) for plotting parameter param1. Default = +/-4*Standard Error of the parameter

range2

The range (min and max) for plotting parameter param2. Default = +/-4*Standard Error of the parameter

npoints

Number of points of the grid for contour. Default = 100

filled

Defines the style of the contour plot FALSE: lines (default), TRUE: filled contours (shades of gray)

colored

Defines the style of the contour plot FALSE: lines (default), TRUE: Colored contours (red= lower)

Value

an object of class nlsgrid with three components:

$x

the values used for the first parameter

$y

the values used for the second parameter

$grid

a square matrix: The values of the residual sum of squares for each combination of the parameters

...

Details

npoints defines the total number of points of the square grid used for drawing the contour plot. Thus, the grid will be of size round(sqrt(npoints))*round(sqrt(npoints))

References

~put references to the literature/web site here ~

See Also

nls logis summary.nlsgrid

Examples

Run this code
data(logis)
attach(logis)
m1<-nls(y~k/(1+c*exp(-r*time)),data=logis,start=c(k=100,r=0.1,c=40))
nlscontour(m1)
detach(logis)

Run the code above in your browser using DataLab