nlscontour: Contour plot for nonlinear least squares

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/nlscontour.R

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

1
2
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)

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))

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

...

Author(s)

Jean-Sebastien Pierre
[email protected]

References

~put references to the literature/web site here ~

See Also

nls logis summary.nlsgrid

Examples

1
2
3
4
5
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)

nlsrk documentation built on June 24, 2017, 1:02 a.m.