\newpage \noindent {\bf \huge lazy}\\  \rule[3pt]{\textwidth}{1pt}\\
\begin{description}
 \item[Purpose]\ \newline \newline 
Constructor for the lazy abstract class
\end{description}

\begin{description}
 \item[Synopsis]\ \newline \newline 
{\tt m=lazy}\\ 
{\tt m=lazy(name,n\_in,n\_out)}\\ 
\end{description}

\begin{description}
 \item[Description]\ \newline \newline 
{\tt m=lazy} 
creates a new general lazy skeleton
\vspace{4mm}\\ 
\hspace{2mm}
{\tt m=lazy(name,n\_in,n\_out)} 
creates a new general lazy with {\tt n\_in} inputs
and {\tt n\_out} outputs. The name {\tt name} is associated to it.
\end{description}

\begin{description}
 \item[Remarks]\ \newline \newline 
This class implements the famimo class and allows to describe
dynamical systems using a 'lazy' representation.
It works in a very simple way. The input-output data is stored in
a database. When a prediction of the putput is needed a local model 
is fitted through the closest points of the query contained in 
the database.\\
The elements that describe the lazy model associated with each output are 
defined by the following attributes:
\\  
\begin{tabular}{lp{12cm}}
{\tt id\_par}: & identification parameters \\ 
{\tt cmb\_par}: & model combination parameters \\ 
\end{tabular} \\ 

\end{description}

\begin{description}
 \item[Methods]\ \\ 
\begin{itemize}
\item {\tt check}   checks the consistency of all the field of a lazy object
\item {\tt denormalise}   denormalises the model M
\item {\tt display}   Display an object of class lazy

\item {\tt eval}   computes the value of the lazy for some input
\item {\tt get}   gets the value of the attribute of an object
\item {\tt identify}   Identify the lazy model from data

\item {\tt jacob\_inputs}   computes the jacobian of the model
\item {\tt jacob\_params}   computes the jacobian of the model
\item {\tt normalise}   normalises the model M
\item {\tt set}   Set object properties
\end{itemize}
\end{description}

\begin{description}
 \item[See also]\ \newline \newline 
mapping

\end{description}
\newpage \noindent {\bf \huge check}\\  \rule[3pt]{\textwidth}{1pt}\\
\begin{description}
 \item[Purpose]\ \newline \newline 
checks the consistency of all the field of a lazy object
\end{description}

\begin{description}
 \item[Synopsis]\ \newline \newline 
{\tt check(m)}\\ 
\end{description}

\begin{description}
 \item[Description]\ \newline \newline 
{\tt check(m)} 
check the consistency of a lazy object.
\end{description}

\begin{description}
 \item[Remarks]\ \newline \newline 
This function has been provided in order to make the lazy class
more robust since it checks a lazy object for consistency of
the data defined in its fields. If a inconsistency is found, an 
error message is displayed.

\end{description}
\newpage \noindent {\bf \huge denormalise}\\  \rule[3pt]{\textwidth}{1pt}\\
\begin{description}
 \item[Purpose]\ \newline \newline 
denormalises the model M
\end{description}

\begin{description}
 \item[Synopsis]\ \newline \newline 
{\tt m=denormalise(m)}\\ 
\end{description}

\begin{description}
 \item[Description]\ \newline \newline 
{\tt m=denormalise(m)} 
denormalises the model {\tt m}
\end{description}

\begin{description}
 \item[Remarks]\ \newline \newline 
This function denormalises a lazy in order to make fit its limits
from [0,1] to the original values, before normalisation.

\end{description}
\newpage \noindent {\bf \huge display}\\  \rule[3pt]{\textwidth}{1pt}\\
\begin{description}
 \item[Purpose]\ \newline \newline 
Display an object of class lazy

\end{description}

\begin{description}
 \item[Synopsis]\ \newline \newline 
{\tt display(m)}\\ 
\end{description}

\begin{description}
 \item[Description]\ \newline \newline 
{\tt display(m)} 
Display the object {\tt m} of class lazy
\end{description}
\newpage \noindent {\bf \huge eval}\\  \rule[3pt]{\textwidth}{1pt}\\
\begin{description}
 \item[Purpose]\ \newline \newline 
computes the value of the lazy for some input
\end{description}

\begin{description}
 \item[Synopsis]\ \newline \newline 
{\tt out=eval(m,regressor)}\\ 
{\tt out=eval(m,regressor,j)}\\ 
\end{description}

\begin{description}
 \item[Description]\ \newline \newline 
{\tt out=eval(m,regressor)} 
returns the value {\tt out} of the output(s)  of
lazy {\tt m} given the input(s) {\tt x}.
\vspace{4mm}\\ 
\hspace{2mm}
{\tt out=eval(m,regressor,j)} 
returns the value {\tt out} of the output(s) {\tt j} of
lazy {\tt m} given the input(s) {\tt x}.
\end{description}

\begin{description}
 \item[Remarks]\ \newline \newline 
This function
returns the output of system as computated by the model, given 
a regressor.  

\end{description}
\newpage \noindent {\bf \huge get}\\  \rule[3pt]{\textwidth}{1pt}\\
\begin{description}
 \item[Purpose]\ \newline \newline 
gets the value of the attribute of an object
\end{description}

\begin{description}
 \item[Synopsis]\ \newline \newline 
{\tt d = get(m,label,opt)}\\ 
\end{description}

\begin{description}
 \item[Description]\ \newline \newline 
{\tt d = get(m,label,opt)} 
gets the value of the attribute {\tt label}
associated to the object {\tt m} and return it inside {\tt d}.
The following codes are recognised:
\\  
\begin{tabular}{lp{12cm}}
{\tt name}: & returns the name of the object \\ 
{\tt n\_in}: & returns the number of inputs of the lazy \\ 
{\tt n\_out}: & returns the number of outputs of the lazy \\ 
{\tt userData}: & returns the 'userData' field \\ 
{\tt opt}: & returns the 'opt' field \\ 
{\tt date}: & returns the date of creation of the object \\ 
{\tt limits}: & returns the limits of the lazy \\ 
{\tt optimparams}: & returns the indices of the parameters to be optimised \\ 
{\tt numparams}: & returns the number of parameters to be optimised \\ 
{\tt id\_par}: & returns the identification paramenters \\ 
{\tt cmb\_par}: & returns the combination paramenters of the models \\ 
{\tt examples\_x}: & the database of the input examples \\ 
{\tt examples\_y}: & the database of the output examples \\ 
\end{tabular} \\ 

\end{description}

\begin{description}
 \item[See also]\ \newline \newline 
set

\end{description}
\newpage \noindent {\bf \huge identify}\\  \rule[3pt]{\textwidth}{1pt}\\
\begin{description}
 \item[Purpose]\ \newline \newline 
Identify the lazy model from data

\end{description}

\begin{description}
 \item[Synopsis]\ \newline \newline 
{\tt m = identify(m,in,out,options)}\\ 
\end{description}

\begin{description}
 \item[Description]\ \newline \newline 
{\tt m = identify(m,in,out,options)} 
performs the identification of the model {\tt m} using
data inside {\tt in} and {\tt out}. Define the structure
{\tt options} in order
to specify the identification method and options.\\
Accepted fields are:
\\  
\begin{tabular}{lp{12cm}}
{\tt id\_par}: & identification parameters \\ 
{\tt cmb\_par}: & model combination parameters \\ 
\end{tabular} \\ 

\end{description}
\newpage \noindent {\bf \huge jacob\_inputs}\\  \rule[3pt]{\textwidth}{1pt}\\
\begin{description}
 \item[Purpose]\ \newline \newline 
computes the jacobian of the model
\end{description}

\begin{description}
 \item[Synopsis]\ \newline \newline 
{\tt jacob\_inputs(m,x)}\\ 
{\tt jacob\_inputs(m,x,j)}\\ 
\end{description}

\begin{description}
 \item[Description]\ \newline \newline 
{\tt jacob\_inputs(m,x)} 
computes for each output the jacobian of
the model with respect to the x (the input of the
lazy) at point {\tt x}.
\vspace{4mm}\\ 
\hspace{2mm}
{\tt jacob\_inputs(m,x,j)} 
computes for output J the jacobian of
the model with respect to the x (the input of the
lazy) at point {\tt x}.
\end{description}

\begin{description}
 \item[Remarks]\ \newline \newline 
The procedure for computing the jacobian depends on the underlying representation 
of the model. The result {\tt out} is an array of size number of outputs * number of inputs
containing the derivatives of the outputs with respect to the inputs.

\end{description}
\newpage \noindent {\bf \huge jacob\_params}\\  \rule[3pt]{\textwidth}{1pt}\\
\begin{description}
 \item[Purpose]\ \newline \newline 
computes the jacobian of the model
\end{description}

\begin{description}
 \item[Synopsis]\ \newline \newline 
{\tt jacob\_params(m,x)  }\\ 
{\tt jacob\_params(m,x,j)  }\\ 
\end{description}

\begin{description}
 \item[Description]\ \newline \newline 
{\tt jacob\_params(m,x)  } 
computes for each output the jacobian of
the model with respect to the parameters at input {\tt x}.
It returns an empty array.
\vspace{4mm}\\ 
\hspace{2mm}
{\tt jacob\_params(m,x,j)  } 
computes for output(s) {\tt j} the jacobian of
the model with respect to the parameters at input {\tt regressor}.
It returns an empty array.
\end{description}

\begin{description}
 \item[Remarks]\ \newline \newline 
This function does not have 
any meaning for lazy systems, and it is provided only for compatibility
reasons.

\end{description}
\newpage \noindent {\bf \huge normalise}\\  \rule[3pt]{\textwidth}{1pt}\\
\begin{description}
 \item[Purpose]\ \newline \newline 
normalises the model M
\end{description}

\begin{description}
 \item[Synopsis]\ \newline \newline 
{\tt m=normalise(m)}\\ 
\end{description}

\begin{description}
 \item[Description]\ \newline \newline 
{\tt m=normalise(m)} 
normalises the model {\tt m}
\end{description}

\begin{description}
 \item[Remarks]\ \newline \newline 
This function normalizes a lazy in order to make fit its limits
to the interval [0,1]

\end{description}
\newpage \noindent {\bf \huge set}\\  \rule[3pt]{\textwidth}{1pt}\\
\begin{description}
 \item[Purpose]\ \newline \newline 
Set object properties
\end{description}

\begin{description}
 \item[Synopsis]\ \newline \newline 
{\tt set(m,'AttrName1',AttrValue1,'AttrName2',AttrValue2,...)}\\ 
{\tt m\_out = set(m,'AttrName1',AttrValue1,'AttrName2',AttrValue2,...)}\\ 
\end{description}

\begin{description}
 \item[Description]\ \newline \newline 
{\tt set(m,'AttrName1',AttrValue1,'AttrName2',AttrValue2,...)} 
sets the value of the attribute {\tt AttrName1}, {\tt AttrName2}, ...
associated to the object {\tt m}.
\vspace{4mm}\\ 
\hspace{2mm}
{\tt m\_out = set(m,'AttrName1',AttrValue1,'AttrName2',AttrValue2,...)} 
sets the value of the attribute {\tt AttrName1}, {\tt AttrName2}, ...
associated to the object {\tt m} and return the modified model inside m\_out. The original
model is not modified.
The following {\tt AttrName} inherided from the
mapping class are recognised:
\\  
\begin{tabular}{lp{12cm}}
{\tt name}: & sets the name of the object \\ 
{\tt n\_in}: & sets the number of inputs of the model. This
sets the saturation level of the inputs to -Inf, Inf. \\ 
{\tt n\_out}: & sets the number of outputs of the model \\ 
{\tt userData}: & sets the 'userData' field \\ 
{\tt opt}: & sets the 'opt' field \\ 
{\tt date}: & sets the date of creation of the object \\ 
{\tt limits}: & sets the limits of the domain of definition
of the lazy. The value must be a {\tt 2*n\_in} matrix where
the upper and lever saturation level are defined. \\ 
{\tt optimparams}: & sets the indices of the parameters to be optimised \\ 
\end{tabular} \\ 

The following codes specific to the lazy class are recognised:
\\  
\begin{tabular}{lp{12cm}}
{\tt id\_par}: & identification parameters \\ 
{\tt cmb\_par}: & model combination parameters \\ 
\end{tabular} \\ 

The identification parameter can assume the following forms:
\begin{equation}
 id\_par = [idm idM valM] 
\end{equation}

where [idmX,idMX] is the range in which the best
number of neighbors is searched when identifying
the local model of degree X and where valMX is the
maximum number of neighbors used in validation
for the model of degree X. This means that the
model of degree X identified with k neighbors,
is validated un the first v neighbors, where
v=min(k,valMX).
\begin{equation}
 id\_par = [idm idM] 
\end{equation}

where idmX and idMX have the same role they have in
point 1, and valMX is by default set to idMX:
each model is validated on all the neighbors
used in identification.
\begin{equation}
 id\_par = [c] 
\end{equation}

Here idmX and idMX are obtained according to the
following fotmulas:
\begin{equation}
 idmX = 3 * no_parX * cX     idMX = 5 * no_parX * cX 
\end{equation}

where no\_parX is the number of parameter of the model
of degree X. Recommended choice: cX = 1.
As far as the valMX are concerned, they get the
default value as in point 2.
The default value for cmb\_par is 1 as it will be clear from what
follows.   If given, cmb\_par can assume the following to forms:
\begin{equation}
 cmb\_par = [cmb] 
\end{equation}

where cmbX is the number of models of degree X
that will be included in the local combination.
Each local model will be therfore a combination of
"the best cmb0 models of degree 0",
"the best cmb1 models of degree 1", and
"the best cmb2 models of degree 1" identified
as specified by id\_par.
\begin{equation}
 cmb_par = [cmb] 
\end{equation}

where cmb is the number of models that will be
combined, disregarding any constraint on the degree
of the models that will be considered.  Each local
model will be therfore a combination of "the best
cmb models", identified as specified by id\_par.  
\end{description}
