nls2.model - Description of Non-linear Regression Models for nls2
On to:
DESCRIPTION
FILE STRUCTURE
SYNTAX
DECLARATION PART
EXPRESSION PART
REFERENCES
SEE-ALSO
EXAMPLE-1
EXAMPLE-2
EXAMPLE-3
EXAMPLE-4
DESCRIPTION:
The model studied by the non-linear regression function `nls2'
should be formally described
in an operating-system file.
This entry describes the general syntax of this file.
FILE STRUCTURE:
The description file is divided into two parts.
The first part is the Declaration Part and
contains identifier declarations. The second part is
the Expression Part and contains
the expressions of the model.
The Expression Part is not required if the user provides
C or Fortran programs for evaluating the model.
SYNTAX:
The declarations and the expressions are delimited by a
semi-column character (";") and the elements within lists by a comma
(",").
Lower and upper case letters are distinguished.
Comments begin with the "" character
and end with the new line character.
Lines that contain only the "" character are not accepted.
Comments should not be inserted within lists.
DECLARATION PART:
All identifiers that appear in the expressions
must be declared. Even
if no Expression Part is provided,
some identifiers are always required.
An identifier - or a list of identifiers -
is declared
by naming it after a keyword.
Identifiers must begin with a letter ([a-z, A-Z])
that may be followed by any number of characters among
[a-z, A-Z, 0-9,_].
Don't use keywords as identifiers.
The keywords and what they introduce are:
- resp
-
the name of the regression function (always required).
- varind
-
the names of the independent variables (always required).
- parresp
-
the names of the parameters of the regression function.
When the model is described by an "odes"
("odes" stands for ordinary differential equations system), parameters
should be named in the following order:
initial values of the system if necessary
(see the `condinit' declaration below), parameters of the "odes",
other parameters.
- var
-
the name of the variance function (required if there is a variance function).
- parvar
-
the names of the parameters that appear in the variance function
and not in the regression function (required if any exist).
- const
-
the names of the numerical constants used in the expressions, if any.
- aux
-
the names of the auxiliary variables used in the expressions, if any.
Introducing auxiliary variables may simplify the expressions
or avoid calculating the same quantities several times.
Be careful: when the model is described by an "odes",
don't use the same auxiliary variables in the expressions
of the "odes" and in the expressions of the response.
- pbisresp
-
the names of parameters of the regression function that will not be estimated
but are set to a known value. These parameters are called
second level parameters (required if any exist).
- pbisvar
-
the names of the second level parameters of the variance function
(see the `pbisresp' declaration - required if any exist).
- varint
-
required when the model is described by an "odes",
the name of the integration variable.
- valint
-
required when the model is described by an "odes",
the names of values where the "odes"
must be integrated (integration values).
These names may be a subset of the names introduced by the preceding
`varind' declaration.
- F
-
required when the model is described by an "odes",
the names of the differential equations.
- dF
-
required when the model is described by an "odes",
the names of the derivatives of the differential equations
with respect to the integration variable;
as many names as in the `F' declaration.
- condinit
-
the names of the initial values of the "odes".
(required when the model is described by an "odes" and
when the initial values are unknown;
in that case, the initial values are considered as
parameters to be estimated).
These names should be a subset of the names introduced by the preceding
`parresp' declaration and there must be
as many names as in the `F' declaration.
- filename
-
the pathname of the C-source file that is generated automatically from the description-file
when the Expression Part is provided.
By default, the name of the current file
followed by a ".c" suffix.
EXPRESSION PART:
The Expression Part begins with these 2 lines:
subroutine
begin
and ends with the line:
end
The other lines are of the type:
name=expr
where name is one of the identifiers declared by the
keywords "resp", "var", "dF", "aux", "const".
When "const",
expr is always a number
(for example: 23, -.0e+10, .2).
expr are expressions built with the following operators:
=, +, -, *, /, **
log, log10, sin, tg, cos, exp,
if then else fi
==, !=, >, <, <=, >= (comparison operators)
and, or, not.
Parentheses can be used.
The value of a differential equation at a given time is indicated
by using "[]" (see the paragraph `EXAMPLE-3').
REFERENCES:
`nls2 Reference Manual'.
SEE ALSO:
`calcmodnls2', `nls2', `nls2.mymodel', `loadnls2'.
EXAMPLE-1:
Example 1: ELISA
resp f;
varind x;
aux a1;
parresp d,n,a,b;
subroutine;
begin
a1=(1.+exp(a*(x-b)));
f=n+(d-n)/a1;
end
EXAMPLE-2:
Example 2: CORTISOL
resp f;
var v;
varind x;
aux a1,a2;
parresp n,d,a,b,g;
pbisresp minf,pinf;
pbisvar h;
subroutine;
begin
a1= 1+exp(a+b*x);
a2= if x==minf then d else
if x==pinf then n else
n+(d-n)*exp(-g*ln(a1))
fi fi;
f=a2;
v=exp(h*ln(f));
end
EXAMPLE-3:
Example 3: VOLTERRA, a differential equation system
resp f;
varind x, ind;
parresp H0, P0, r1,s1,r2,s2;
varint t;
valint x;
condinit H0, P0;
F H, P;
dF dH, dP;
aux a;
subroutine;
begin
dH = (r1-s1*P)*H;
dP = (r2-s2*(P/H))*P;
a = if ind==1 then H[x] else
P[x]
fi;
f = a;
end
EXAMPLE-4:
Example 4: SIMUL, case of a program previously loaded.
The model description file contains declarations only:
resp y;
varind x;
parresp a;
- Mon Sep 30 1996 -