nls2.mymethod - For Expert User of nls2: How to Define a New Method.


On to:
DESCRIPTION
HOW TO PROCEED
EXAMPLE
REFERENCE
SEE-ALSO





DESCRIPTION:

This entry explains how a statistical expert user can define a new method in function `nls2': he can provide the programs that calculate the estimating equations B, D, Eta, the sufficient statistics Z, and the statistical criterion (see the `nls2 Reference Manual').

Sommaire




HOW TO PROCEED:

1) Copy the file src/ToMyOwn.c from the installation-directory of nls2 and insert in it the required programs: see comments included.

2) Open an S session and invoke `loadnls2' with adding an argument called "tomyown", equal to the pathname of this file. (The programs may be split into several files: in that case, the names of these files should be separated with spaces).

4) Invoke `nls2' with the argument method set to "MYOWN", and with an additional argument called num.ctx, equal to a list-structure which contains the following components:
"nh": the number of sufficient statistics Z ("nh" in the `nls2 Reference Manual').
"effic": TRUE if the estimator is efficient, FALSE otherwise.
"W.type": a character string equal to "SYM" if the matrix W is symmetric, "SYMBLOCK" if it is block symmetric and "NONSYM" in the other cases.
"fit.type": a character string that indicates how to calculate the statistical criterion. Valid values are:
"LOGV": the statistical criterion is equal to -2log(likelihood),
"STOPCRIT": it is equal to the stopping criterion,
"NWSST": it is equal to the non-weighted sum of squares,
"VWSS": it is equal to the variance-weighted sum of squares,
"IVWSS": it is equal to sum of squares weighted by the intra-repetitions-variance,
"NWSSB": it is equal to the non-weighted sum of squares in the context of the variance estimation, divided by n,
"SIGMA2": it is equal to square sigma,
"MYOWN": it is calculated by programs provided in "ToMyOwn.c" (the default).

If there are several steps, the elements of "method" that correspond to a step where a personal method is to be applied must be equal to "MYOWN", and "num.ctx" is a vector of length equal to the number of these elements.

Sommaire




EXAMPLE:

The user's programs are provided in the file "ToMyOwn.c".


An S-session is opened with commands of the following pattern: loadnls2(tomyown="ToMyOwn.o") nls2.out <- nls2(data, model, stat.ctx, method = "MYOWN", num.ctx=list(nh=3,effic=T,W.type="SYM",fitting.crit="STOPCRIT"))
See also the example nls2.ownmethod.

REFERENCE:

`nls2 Reference Manual'.


SEE ALSO:

`nls2', the example nls2.ownmethod.

Sommaire


Creation: 09/12/2001 -