Output a description of the model and the data that was used at the time of its creation to the console and optionally to a file. The purpose of this function is to provide a record of the details underlying the function fun as well as to aid users wishing to create objective functions for optimization tools.

Description

These functions create functions to evaluate residuals or sums of squares at particular parameter locations.

Usage

1
2
3
modeldoc(fun, savefile=NULL)
## S3 method for class 'modeldoc'
print(x, ...)

Arguments

fun

A function produced by one of model2rjfun or model2ssgrfun.

savefile

A character string or connection giving a location in which to record the modeldoc output.

x, ...

Object to print, and other arguments that will be ignored.

Details

modeldoc displays the contents of the environment associated with fun.

Value

modeldoc returns a list of class "modeldoc" containing values extracted from the environment of fun.

Author(s)

John Nash and Duncan Murdoch

See Also

nls

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## require(nlsr)
traceval  <-  TRUE  # traceval set TRUE to debug or give full history
# Data for Hobbs problem
ydat  <-  c(5.308, 7.24, 9.638, 12.866, 17.069, 23.192, 31.443, 
          38.558, 50.156, 62.948, 75.995, 91.972) # for testing
tdat  <-  seq_along(ydat) # for testing
# A simple starting vector -- must have named parameters for nlxb, nls, wrapnlsr.
start1  <-  c(b1=1, b2=1, b3=1)
weeddata2  <-  data.frame(y=1.5*ydat, tt=tdat)
escal <-  y ~ ms*b1/(1+b2*exp(-b3*tt))
ms <- 1
weeddata3<-weeddata2
weeddata3$y<-0
grs3<-model2rjfunx(escal, start1, data=weeddata3, ms=ms)
res3<-grs3(start1)
res3
modeldoc(grs3)

# Now a different value of ms
ms<-2
grs3b<-model2rjfunx(escal, start1, data=weeddata3, ms=ms)
res3b<-grs3b(start1)
res3b
modeldoc(grs3b)
# modeldoc(grs3b, savefile="grs3save.txt") ## to save the output