\subsection{Simulation requirements}

This section lists requirements related 
to the calculation of the program and the simulation parameters. \newline

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S1\\
& \\
Name: & The algorithm used\\
& \\
Description: & The program must be able to run simulations using the Metropolis-Hastings algorithm. \\
& \\
Rationale: & \\
& \\
Priority: & Essential \\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S2\\
& \\
Name: & Choice of algorithm\\
& \\
Description: & The user could be able to choose to use the Gibbs sampling algorithm 
for desired blocks instead of the Metropolis-Hastings.\\
& \\
Rationale: & \\
& \\
Priority: & Conditional\\
& \\
Stability: & Unstable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S3\\
& \\
Name: & Setting the number of updates\\
& \\
Description: & The user must be able to define the number of the updates for each block. That is, the simulation ends when every parameter has been updated at least that many times. (Note that update doesn't necessarily mean that the value changes.) It must also be possible to define a default number of updates which is used for each block if no other value is given.
\\
Rationale: & The user wants to regulate how long the simulation will take.\\
& \\
Priority: & Essential \\
& \\
Stability: & Unstable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S4 \\
& \\
Name: & Setting the number of burn-in iterations \\
& \\
Description: & The user must be able to set the number of burn-in 
iterations: That is, the number of iterations that are run before any output 
is produced. \\
& \\
Rationale: & It takes a while until the iteration values actually conform to the posterior distribution.\\
& \\
Priority: & Essential \\
& \\
Stability: & Stable \\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S5\\
& \\
Name: & Setting the thinning factor \\
& \\
Description: & The user must be able to set the thinning factor. The 
thinning factor t means that every $t^{th}$ iteration value is used in the 
output and the rest are discarded. \\
& \\
Rationale: & Even if the proposals aren't accepted and the iteration values remain the same for many iterations the thinning factor ensures that the output contains more variance and describes the posteriori distribution better.\\
& \\
Priority: & Essential \\
& \\
Stability: & Stable \\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S6\\
& \\
Name: & Setting the blocks \\
& \\
Description: & The user must be able to define which variables belong to the same block; that is, the likelihood of their values is considered as a whole for an update, rather than considering each variable separately. The blocks must be read from a text file.\\
& \\
Rationale: & The user might want to regulate which parameters are updated at the same time.\\
& \\
Priority: & Conditional\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S7\\
& \\
Name: & Setting the update strategy \\
& \\
Description: & The user must be able to set the update strategy. The update strategy defines whether the parameters / blocks are considered for updates in sequential order or whether the next parameter / block to update is chosen at random. If random update is chosen, block weights are used to choose a block to be updated (see S8).\\
& \\
Rationale: & \\
& \\
Priority: & Conditional\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S8\\
& \\
Name: & Setting the weight of the blocks \\
& \\
Description: & It could be possible to define the importance of the blocks. In the update phase the next parameter / block to update could be chosen according to the importance values.\\
& \\
Rationale: & Some parameters might be more important to update than the others.\\
& \\
Priority: & Optional\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S9\\
& \\
Name: & Setting the proposal strategies for variables\\
& \\
Description: & The user must be able to choose the proposal strategy for each parameter. Possible choices are 
\begin{enumerate}
\item Fixed proposal strategy: The next proposed values for a parameter is taken from its proposal distribution.
\item Random walk: The next proposed value for a parameter is created by adding a value taken from the proposal distribution to the current value of the parameter.
\end{enumerate}
\\
& \\
Rationale: & \\
& \\
Priority: & Essential\\
& \\
Stability: & Unstable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S10\\
& \\
Name: & Proposal distributions\\
& \\
Description: & The user must be able to set the proposal distributions for each parameter group. If the proposal distribution for a parameter is not given, the prior distribution of the parameter is used as fixed proposal distribution (see S9).\\
& \\
Rationale: & \\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S11\\
& \\
Name: & Setting initial values \\
& \\
Description: & The user must be able to set the initial values for the parameters whose values are not fixed in data. If the initial values are not given, the program must display an error message. (The program doesn't have to generate the initial values by itself.)\\
& \\
Rationale: & The initial values affect the convergence of the simulation run.\\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S12\\
& \\
Name: & Defining parameters to output\\
& \\
Description: & The user must be able to define which parameters are output during the simulation. \\
& \\
Rationale: & It's not reasonble to output all parameters. The user might want to gain information about a small subset of all parameters.\\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

% S13 moved to OP8

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S14\\
& \\
Name: & Informing the user about the progress\\
& \\
Description: & While simulating, the program must display information about the progress; that is, the number of the current iteration, or a percentage of iterations done. \\
& \\
Rationale: & The simulations can last for long time, so the user would possibly like to know how much of the simulation is already done and estimate how much time the rest of the simulation might take.\\
& \\
Priority: & Essential\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline
Id: & S15\\
& \\
Name: & Soft stop\\
& \\
Description: & The user could be able to stop the simulation so that the remaining iteration is run and the output files are written so that it's possible to continue the simulation. \\
& \\
Rationale: & If the user stops the appication (for example by pressing Ctrl + c), it might not be possible to continue the simulation and the output files might be only partially written. \\
& \\
Priority: & Optional\\
& \\
Stability: & Stable\\
& \\
Source: & Marja Hassinen\\
\hline
\end{tabular}
\vspace{.5cm}

\begin{tabular}[]{| l p{10cm} |}
\hline

Id: & S16\\
& \\
Name: & Parameters in random walk\\
& \\
Description: & The parameters of proposal distribution can depend on the variable's previous value in random walk proposal strategy. \\
& \\
Rationale: & \\
& \\
Priority: & Optional\\
& \\
Stability: & Stable\\
& \\
Source: & Marko Salmenkivi\\
\hline
\end{tabular}
\vspace{.5cm}


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