\section{Glossary}

%M��rittelee dokumentissa k�ytetyt termit. Dokumentin tulee olla my�s alan sanastoa tuntemattoman henkil�n luettavissa.

\subsection{Probabilistic inference}

\textbf{Random variable (synonym: stochastic variable)}: Function which combines events with their probabilities. A numeric variable related to a random phenomenon (for example throwing a dice). The value of the variable is determined if the result of the phenomenon is known, otherwise only the probabilities of different values are known. [Tode04]

\textbf{Discrete random variable}: Random variable with a discrete range.

\textbf{Point probability function}: (Synonym: frequency function) Function $f: R \rightarrow R $ related to discrete random variable X so that $\forall x \in R: f(x) = P \{ X = x \} = $ the probability that the value of $X$ is $x$. [Tode04]
%pistetodenn�k�isyysfunktio. Ainoa l�ytyv� k��nn�s oli frequency function, mutta asiakas halusin point probability functionin.

\textbf{Density function}: $f(x)$ is a density function iff 
\begin{enumerate}
\item $f \geq 0$
\item $f$ is integrable in R and $\int_{-\infty}^\infty f(x)dx = 1$.
\end{enumerate} [Tode04]

\textbf{Cumulative distribution function}: The function $F:R \rightarrow R$ is the cumulative distribution function associated with random variable X iff $F(x)=P \{ X\leq x \} = $ the probability that $X$ is less than or equal to $x$. [Tode04]

\textbf{Continuous distribution}: A random variable has a continuous distribution as its density function $f$ if $\forall a, b \in R: P \{ a \leq X \leq b \} = \int_a^b f(x)dx$ [Tode04]

\textbf{Joint distribution}: If X and Y are random variables, their joint distribution describes how probable all the possible combinations of X and Y are.

\textbf{Independence}: Events A and B are independent, if the probability of B is independent on whether A has happened or not. (For example if A = ``it rains'', B = ``when I throw a dice the result is 6'' and C=``when I throw a dice the result is even'' then A and B are independent but B and C are not.) [Tode04]

%Expectation: The sum of a random variable's values weighted by their probabilities. Expectation represents, in a way, the value that one should expect to get from the variable. 
%An example: the expectation of a d6 (six-sided die) is 6* 1/6 + 5 * 1/6 + 4 * 1/6 + 3 * 1/6 + 2 * 1/6 + 1 * 1/6 = 3.5.

% odotusarvo
% Tarviiko ollenkaan? Ei varmaan ole kovin olennainen..

\textbf{Conditional probability}: If X and Y are random variables, the conditional probability $P \{ X = x | Y = y \}$ means the probability that the value of $X$ is $x$ if it is assumed that the value of $Y$ is $y$. 

\textbf{Bayes's rule}: $P \{ X = x | Y = y \} =  \frac{P \{ Y = y | X = x \} \cdot P \{ X = x \}}{ P\{ Y = y \} }$. The rule is obtained from the observation that $P \{ Y = y | X = x \} \cdot P \{ X = x \} = P \{ X = x$ AND $Y = y \}$

\textbf{Chaining}: Using the Bayes's rule many times consecutively.

\textbf{Bayesian model}: A model which connects dependent random variables to each other by defining dependencies and conditional probabilities. The model defines the joint distribution of the variables.

\textbf{Likelihood function}: $P \{ data | explanation \} $ is called the likelihood function because it defines how likely it is to get such a data if the real conditions are known. (For example if we know that a bird resides at some area, then how likely it is to get the observations we have already got.)

\textbf{Markov random field}: A random field that exhibits the Markovian property:\newline
$\pi( X_i = x_i | X_j = x_j, i \neq j) = \pi(X_i = x_i | \delta_i)$,
Where $\delta_i$ is the set of neighbours for $X_i$. That is, only the adjacent units affect the conditional probability. [Rand]

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

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

Descriptions of these distributions can be found in [Math05].

\textbf{Functional dependence}: A condition between two variables X and Y so that the value of X determines the value of Y unambiguously.

\textbf{Stochastic dependence}: A condition between two variables X and Y so that the value of X doesn't determine the value of Y but influences the probabilities of the possible values.

\textbf{Spatial dependence}: A special case of stochastic dependence where the dependence is related to some spatial structure. (For example towns that are adjacent to each other influence to each other.) The spatially dependent variables form a Markov random field.

\textbf{Prior distribution}: The prior distribution of the parameters describes their assumed joint probability distribution before inferences based on the data are made.

\textbf{Posterior distribution}: The posterior distribution of the parameters describes their joint probability distribution after inferences based on the data are made.

\textbf{Marginal distribution}: The prior or posterior distribution concerning only one parameter.

\subsection{Models and related concepts}

\textbf{Model}: Means: Bayesian model

\textbf{Variable}: A variable is an entity in the model that can have an assigned value from its range of values. Variables and their dependencies form the base of the problem that the software is developed to solve.

\textbf{Parameter}: A parameter is a variable whose value is not defined by data.

\textbf{Adjacency matrix}: The adjacency matrix of a simple graph is a matrix with rows and columns labeled by graph vertices, with a 1 or 0 in position ij according to whether i and j are adjacent or not.

\textbf{Floating point number}: A computer representation of a real number with finite precision.

\subsection{Metropolis-Hastings algorithm}

\textbf{Iteration}: A single round of the algorithm when all the parameters have been updated once.

\textbf{Burn-in-iterations}: The iterations that are run before any output is produced.

\textbf{Thinning factor}: The thinning factor t means that every $t^{th}$ iteration value is used in the 
output and the rest are discarded.

\textbf{Block}: A set of parameters which are defined to be updated together. That is, the proposals are generated to all of them and the acceptance of all the proposals is decided at the same time.

\textbf{Update}: Proposing a value to a parameter and then accepting it (the value changes) or discarding it (the value remains the same).

\textbf{Proposal strategy}: The proposal strategy defines how the next proposed value is generated. Possible choises 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}

\textbf{Proposal distribution}: 
\begin{enumerate}
\item The distribution from which the next proposed value for a parameter is chosen (when using the ``Fixed proposal distribution'' proposal strategy).
\item The distribution that is used in generating proposed values for a parameter by adding a value taken from the distribution to the parameter's current value (when using the ``Random walk'' proposal strategy).
\end{enumerate}

\textbf{Update strategy}: The update strategy describes which variables belong to the same block. (See: Block) The update strategy also includes information about whether the blocks are considered for updates in sequential order, whether the next block to update is chosen at random or whether the block to update is chosen based on the block weights. 

\textbf{Convergence}: The phenomenon that during the simulation the parameter values get closer to the posterior distribution. The speed of the convergence depends on the initial values and other simulation parameters.
