nls2.inv - Description of the Inverse of an nls2 Regression Function
On to:
DESCRIPTION
FILE STRUCTURE
SYNTAX
DECLARATION PART
EXPRESSION PART
SEE-ALSO
EXAMPLE
DESCRIPTION:
The regression function, "f", of a model studied by `nls2'
being defined by:
y=f(x, theta)+epsilon
its inverse (denoted here by "f-1"):
x=f-1(y, theta)+nu
should be formally described
in an operating-system file.
This file must contain the expression of the abscissa x
in terms of the ordinate y, of the parameters theta
and, possibly of second level parameters.
The variance of y may also be expressed.
This entry describes the general syntax of this description-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 inverse function.
The Expression Part is not required if the user provides
C or Fortran programs for evaluating the inverse function.
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:
- abs
-
the name of the abscissa x (always required).
- ord
-
the name of the ordinate y (always required).
- paract
-
the names of the parameters theta (always required).
- varord
-
the name of the variance of y.
- pbisabs
-
the names of the second level parameters that occur
in the expression of x.
- pbisvar
-
the names of the second level parameters that occur
in the expression of the variance of y.
- const
-
the names of the numerical constants used in the expression
of x.
- aux
-
the names of the auxiliary variables used in the expressions
of x and y.
Introducing auxiliary variables may simplify the expressions
or avoid calculating the same quantities several times.
- 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 "abs", "varord", "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.
SEE ALSO:
`calcinvnls2', `calib.nls2', `nls2.myinv', `loadnls2'.
EXAMPLE:
Example 1:
ord y;
abs x;
varord v;
aux a1,a2;
paract a,b;
subroutine;
begin
a2=10;
a1= exp((b*y+a)*log(a2));
x=a1;
v=1;
end
Example 2:
abs x;
ord y;
varord vy;
paract n, d, a, b, g, h;
pbisvar lambda;
aux a1;
subroutine;
begin
a1=-log10((y-n)/(d-n))/g;
x=(log10(-1+exp(a1))-1)/b;
vy=exp(lambda*log10(y));
end
- Mon Sep 30 1996 -