\subsection{Model requirements}

These are the requirements related to the statistical models. This section contains the requirements that define the expressive power of the model definition language.

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & M1 \\
& \\
Name: & Using models\\
& \\
Description: & The program must run simulations on models which are described with the model description language (specified later). \\
& \\
Rationale: & \\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & M2 \\
& \\
Name: & Defining variables whose values are taken from data\\
& \\
Description: & The model description language must be able to express variables whose values are taken from the data and specify where the values are found (the file name of the data file and the location in the data file). It must also be possible to define a distribution for such a variable (M12).\\
& \\
Rationale: & \\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & M3 \\
& \\
Name: & Defining parameters whose values are not taken from data\\
& \\
Description: & The model description language must be able to express that there are parameters whose values are not taken from the data. If the parameter is stochastic, it must also be possible to define a distribution for such a variable (M12). If the parameter is deterministic, it must be possible to define an equation that determines the value of the parameter.\\
& \\
Rationale: & \\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}


\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & M4 \\
& \\
Name: & Defining dependencies\\
& \\
Description: & The model description language must be able to express dependencies between two entities, each either a variable or a parameter. The dependencies can be functional or stochastic (special case: spatial dependencies (M7)). \\
& \\
Rationale: & \\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & M5 \\
& \\
Name: & Equations\\
& \\
Description: & The model description language must be able to express functional dependencies as equations. The left side of the expression is a single parameter but the right side must be able to include basic arithmetic operations (+, -, *, /), logarithm, sum, product and power expressions. \\
& \\
Rationale: & Equations are a natural way to express functional dependencies.\\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & M6 \\
& \\
Name: & Defining variable/parameter repetition structures\\
& \\
Description: & The model description language must be able to express a structure of variables/parameters which are related to the same entity. This entity structure must then be automatically repeated for a specified number of times, for example to span the length of a data file.\\
& \\
Rationale: & \\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & M7 \\
& \\
Name: & Defining spatial relations\\
& \\
Description: & The model description language must be able to express the meaning ``all adjacent units'' in mathematical expressions used in dependencies (M4). An adjacency matrix defines the entities that are neighbours to each other and form a network of spatial relationships. It must be possible to specify the file name of the adjacency matrix. \\
& \\
Rationale: & \\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}


\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & M9 \\
& \\
Name: & Reading models from text files\\
& \\
Description: & The program must be able to read a model (described with the specific description language) from a text file.\\
& \\
Rationale: & It's reasonable to store the models into text files because they can then be easily edited without any special tools.\\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & M10\\
& \\
Name: & The distributions used\\
& \\
Description: & The model must be able to express at least the following distributions:

Discrete distributions: 
\begin{itemize}
\item Uniform distribution
\item Binomial distribution
\item Geometric distribution
\item Poisson distribution
\end{itemize}

Continuous distributions:
\begin{itemize}
\item Uniform distribution
\item Normal distribution
\item Multinomial distribution
\item Exponential distribution
\item Binormal distribution
\item Lognormal distribution
\item Gamma distribution
\item Beta distribution
\item Dirichlet distribution
\end{itemize}

\\
& \\
Rationale: & These distributions are frequently used in statistical models.\\
& \\
Priority: & Essential\\
& \\
Stability: & Unstable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & M11 \\
& \\
Name: & Distributions defined by the user\\
& \\
Description: & The program should be able to use a distribution defined by the user. The distributions are defined as Fortran modules which include all the subroutines which are needed in the calculation.\\
& \\
Rationale: & \\
& \\
Priority: & Conditional\\
& \\
Stability: & Stable \\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & M12 \\
& \\
Name: & Defining distributions\\
& \\
Description: & The model description language must be able to express distributions given in M10. It must be possible to use these for parameters and data variables. \\
& \\
Rationale: & \\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

%\begin{itemize}
%\item The program must be able to run simulations on models that include spatial, statistical and functional dependencies.
%\item The model description language must be able to define what variables are data, and where they may be found in the data.
%\item It must be possible to define parametrised distribution for variables. Possible distributions include...?
%\item The model must be stored in a text file, which the program processes.
%\item The model description language must be able to express all the properties of the model unambiguously.
%\item It must be possible to add comments to the model desription.
%\item Whitespace at the beginning or end of a line must not affect the output in any way.
%\item Empty lines must not effect the output in any way.
%\item The model descripting commands will be separated by carriage returns.
%\item If the model has syntactical or semantical errors, the program must report the error. The error report will include...?
%\end{itemize}

% \begin{tabular}[]{| l p{10cm} |}
% \hline
%		Name: & \\
% & \\
%		Description: & \\
% & \\
%		Priority: & \\
% \hline
%	\end{tabular}
% \vspace{.5cm}

