text:
\section{Introduction}

Several models
for football (soccer) prediction exist (see, e.g.,  \cite{Owen2011,Koopman2015, Volf2009, Titman2015} and references therein).
In this work, we  (i) propose two novel Bayesian
multinomial-Dirichlet models that consider only the number of matches won, drawn or lost by each team as inputs, and (ii)  compare such models with two benchmark models, whose predictions for matches of the Brazilian national championships are published on Internet websites---see \cite{reference13} and \cite{reference14}.
Such models are widely consulted by football fans and consider multiple covariates as inputs.
 As a baseline, we also
make comparisons with  an extension of the Bradley-Terry model \citep{davidson1970}.

Brazilian football championships are disputed by 20~teams that play against each other twice (home and away) and the team with more points after all matches are played is declared champion.
	Therefore, 380 matches are played per championship, 190 in each half.
	The last four teams are relegated to a minor division and the first four play Copa Libertadores (South America champions league).
	Our analysis comprised the championships from 2006 to 2014, because it was only in 2006 that this form of dispute was implemented in the Brazilian national championships.

Our comparisons were  made
using  1710 matches of the first division of the Brazilian football championship. Several  standard metrics (scoring rules) were used for ranking the models, as well as
 other criteria such as the proportion of matches that were ``incorrectly'' predicted by each model and a measure of calibration.

There are several ways to score or classify predictions of categorical events that assume one result out of a discrete set of mutually exclusive possible outcomes, like football matches.
See \cite{constantinou} for a brief survey of such measures applied to football.
We decided to score the predictions for each match in terms of their distances from the truth, \emph{i.e.}, the verified event, once it has occurred, and chose the most used distances in the literature: Brier \citep{brier1950}, logarithmic and spherical.

This paper is organized as follows.
Section \ref{sec::experimental} describes the studied models,
Section \ref{sec::results} reports the predictive performance of the models and a goodness of fit measure.
In Section \ref{sec::remarks} we discuss the results and close with proposals for future research.
The Appendix briefly describes the scoring rules and the criteria used in this work to classify the models.

\section{The Models: Theoretical Background}
\label{sec::experimental}

In the statistical literature, the final outcome of football matches is usually predicted by modeling either the number of goals \citep{Maher82, Dixon97, Lee97, Karlis2003} or the categorical final outcome itself (win, draw or loss of the home team)~\citep{Forrest2000, Koning2000, Brillinger2008, Brillinger2009}.
For a discussion of these two approaches see \cite{Goddard2005}.  In this work, we consider two benchmark models that follow the first approach:  ``Arruda'' (\url{www.chancedegol.com.br}) and ``Lee'' (\url{www.previsaoesportiva.com.br}); the Bradley-Terry model and the models proposed by us follow the second approach.
The predictions of the two benchmark models were published before each matchday.
We use this section to describe these models in some detail.

	\subsection{Benchmark Models}
	\label{sec::Benchmark}

	The benchmark models, Arruda \citep{arruda2000} and Lee \citep{Lee97}, assume that the number of goals $(Y_1, Y_2)$ scored respectively by teams $A$ (home team) and $B$ (away
	team) has a bivariate Poisson distribution \citep{Holgate64} with parameters $(\uplambda_1, \uplambda_2, \uplambda_3)$,
	which has probability mass function given by

	\begin{equation*}
	P(Y_1 = y_1, Y_2 = y_2 | \uplambda_1, \uplambda_2, \uplambda_3) =
	\exp\{-(\uplambda_1 + \uplambda_2 + \uplambda_3)\}
	\sum_{k = 0}^{\min(y_1, y_2)} \dfrac{\uplambda_1^{y_1 - k} \uplambda_2^{y_2 - k} \uplambda_3^k}{(y_1-k)!(y_2 - k)!k!}, \label{eq::pois.biv}
	\end{equation*}
	for $\uplambda_1, \uplambda_2 > 0$ and $\uplambda_3 \geq 0$.

	Both marginal distributions of $(Y_1, Y_2)$ have Poisson
	distributions with dependence parameter $\uplambda_3 \geq 0$. If
	$\uplambda_3 = 0$ the marginal distributions are independent, while if
	$\uplambda_3 > 0$ the marginal distributions are positively
	correlated.
    While the Lee model assumes that $\lambda_3=0$, the Arruda model does not.
    Because of its flexibility, \cite{Karlis2003} argue
	that this distribution is a plausible choice for modeling dependence
	of scores in sports competitions.

	Similar to \cite{Karlis2003} and \cite{Lee97}, both benchmark models
	adopt the following log-linear link functions
	\begin{align*}
	\log(\uplambda_1) &= \upmu + \text{ATT}_A - \text{DEF}_B + \upgamma, \\
	\log(\uplambda_2) &= \upmu + \text{ATT}_B - \text{DEF}_A,
	\end{align*}
	where $\upmu$ is a parameter representing the average number of goals
	in a match, $\text{ATT}_k$ is the offensive strength of team $k$,
	$\text{DEF}_k$ is the defensive strength of team $k$ and $\upgamma$ is
	the home advantage parameter, $k = A, B$. For both the Arruda and Lee models, it is usual to assume the following identifiability constraint
	\begin{equation*}
	\sum_{t = 1}^T \text{ATT}_t  = 0, \quad \sum_{t = 1}^T \text{DEF}_t = 0,\\
	\end{equation*}
	where $T$ is the number of teams of the analyzed championship.

    The predictions of an upcoming matchday are obtained by fitting the model to all relevant previous observed data and then summing up the probabilities of all scores relevant to the win, draw and loss outcomes.
    We should remark, however, that the Arruda model uses results of the previous twelve months to predict future matches, but we have no information about how this is done.
    On the other hand, the Lee model uses only information of the current championship.

    \subsection{Bradley-Terry model}
\label{sec::BTmodel}

The Bradley-Terry paired comparison model \citep{BradleyTerry1952} was primarily developed for modeling the subjective preference of a set of objects when compared in pairs by one or more judges.
Applications of this model include studies of preference and choice behaviour, but also the ranking of competitors and the prediction of outcomes in sports, such as chess, tennis and soccer. We consider an extension of the Bradley-Terry model, the Davidson tie model with multiplicative order effects \citep{davidson1977extending}, that allows us to account for both ties and home-field advantage:

\begin{align}
p^W_{ij} &= P(\mbox{Home team } i \mbox{ beats visiting team } j) = \frac{\gamma \pi_i}{\gamma \pi_i + \pi_j + \nu \sqrt{\pi_i\pi_j}} \nonumber\\
p^D_{ij} &= P(\mbox{Home team } i \mbox{ ties with visiting team } j) = \frac{\nu \sqrt{\pi_i\pi_j}}{\gamma \pi_i + \pi_j + \nu \sqrt{\pi_i\pi_j}} \nonumber\\
p^L_{ij} &= P(\mbox{Home team } i \mbox{ loses to visiting team } j) = 1 - p^W_{ij} - p^D_{ij},
\label{eq:BTmodel}
\end{align}
where $\gamma > 0$ is the home advantage parameter, $\nu > 0$ is the parameter that accomodates for draws and $\pi_i$ is the worth parameter, the relative ability of team $i$. To ensure identifiability, it is commonly assumed that $\pi_i \geq 0$ and $\sum \pi_i = 1$.

Maximum likelihood estimation is performed by numerically maximizing the reparameterized log-likelihood function corresponding to an unrestricted lower dimension parameter space. For every upcoming second-half matchday, MLEs are recalculated using the outcomes of all the previous matches (including first and second-half matches) and then plugged in (\ref{eq:BTmodel}) in order to obtain predictions for the new matchday. For a study on the conditions for the existence and uniqueness of the MLE and the penalized MLE for different extensions of the Bradley-Terry model, see \cite{Yan2016}.

	\subsection{Multinomial-Dirichlet}
	\label{sec::Mn_Dir}

	Now we explain the Bayesian approach developed in this work to calculate the prediction probabilities of an upcoming match of a given team $A$ based on its past performance, \emph{i.e.}, the number of matches it has won, drawn and lost.

	Let us consider the outcome of a given match of team $A$ as a categorical random quantity $X$ that may assume only the values $1$ (if team $A$ wins), $2$ (if a draw occurs), $3$ (if team $A$ loses).
	Denoting by $\uptheta_1, \uptheta_2$ and $\uptheta_3$ (where $\uptheta_3 = 1-\uptheta_1 - \uptheta_2$), the probabilities of win, draw and loss, respectively, the probability mass function of $X$ is
	\[
	P(X=x | \boldsymbol{\uptheta}) = \uptheta_1^{\mathbb{I}_{\{1\}}(x)}
	\uptheta_2^{\mathbb{I}_{\{2\}}(x)}(1 - \uptheta_1 -
	\uptheta_2)^{{\mathbb{I}_{\{3\}}}(x)}, \qquad x \in \mathcal{X},
	\]

	\noindent
	where $\mathcal{X}=\{1,2,3\}$ is the support of $X$,
	$\mathbb{I}_{\{i\}}(x)$ is the indicator function that assumes the
	value 1 if $x$ equals $i$ and 0 otherwise, and $\boldsymbol{\uptheta}
	= (\uptheta_1, \uptheta_2)$ belongs to $\boldsymbol{\Theta} =
	\{(\uptheta_1,\uptheta_2)\in [0,1]^2: \uptheta_1+\uptheta_2 \leq 1 \}$, the~2-simplex.

	Assuming that the outcomes from $n$ matches of team $A$, given $\boldsymbol{\uptheta}$, are i.i.d. quantities with the above categorical distribution, and denoting by $M_1$, $M_2$ and $M_3$ the number of matches won, drawn or lost by team $A$, the random vector $(M_1, M_2, M_3)$ has Multinomial (indeed, trinomial) distribution with parameters $n$ and $\boldsymbol{\uptheta}$ given by

	\[
	P(M_1=n_1,M_2=n_2,M_3=n_3| n, \boldsymbol{\uptheta})=
	{n \choose n_1, n_2, n_3}\uptheta_1^{n_1}\uptheta_2^{n_2}(1-\uptheta_1-\uptheta_2)^{n_3},
	\]
	\noindent
	where $n_1 + n_2 + n_3 = n$.

	Our goal is to compute the predictive posterior distribution of the
	upcoming match, $X_{n+1}$, that is,
	$P(X_{n+1}=x|M_1=n_1,M_2=n_2,M_3=n_3)$, $x\in\mathcal{X}$.
	Suppose that $\boldsymbol{\uptheta}$ has Dirichlet prior distribution
	with parameter $(\upalpha_1,\upalpha_2,\upalpha_3)$, denoted
	$\mathcal{D}(\upalpha_1,\upalpha_2,\upalpha_3)$, with density function
	\[
	\pi(\boldsymbol{\uptheta}|\boldsymbol{\upalpha})=\frac{\Gamma(\upalpha_1+\upalpha_2+\upalpha_3)}{\Gamma(\upalpha_1)\Gamma(\upalpha_2)\Gamma(\upalpha_3)}\uptheta_1^{\upalpha_1-1}\uptheta_2^{\upalpha_2-1}(1-\uptheta_1-\uptheta_2)^{\upalpha_3-1}
	\]
	\noindent for $\upalpha_1$, $\upalpha_2$, $\upalpha_3 > 0$, then the
	posterior distribution of $\boldsymbol{\uptheta}$ is
	$\mathcal{D}(n_1+\upalpha_1,n_2+\upalpha_2,n_3+\upalpha_3)$. Thus, the
	predictive distribution of $X_{n + 1}$ is given by the
	integral
	$$
	P(X_{n + 1} = x | M_1 = n_1, M_2 = n_2, M_3 = n_3) =\\ \int_{\boldsymbol{\uptheta}} P(X_{n
		+ 1} = x | \boldsymbol{\uptheta}) \pi(\boldsymbol{\uptheta} | M_1 = n_1, M_2 = n_2, M_3
	= n_3) d\boldsymbol{\uptheta},
	$$
	which leads to the following probabilities of win, tie and loss:
	\begin{align*}
	P(X_{n+1} = 1 | M_1=n_1,M_2=n_2,M_3=n_3) &=
	\frac{n_1+\upalpha_1}{n+\upalpha_{\bullet}}\\
	& \\
	P(X_{n+1} = 2 | M_1=n_1,M_2=n_2,M_3=n_3) &=
	\frac{n_2+\upalpha_2}{n+\upalpha_{\bullet}} \\
	& \\
	P(X_{n+1} = 3 | M_1=n_1, M_2=n_2, M_3=n_3) &=
	\frac{n_3+\upalpha_3}{n+\upalpha_{\bullet}}
	\end{align*}
	\noindent where $\upalpha_{\bullet} =\upalpha_1+\upalpha_2+\upalpha_3$.
	 In fact, the multinomial-Dirichlet is a classical model used in several applied works and more information about it can be found in \cite{good1965,bernardo1994} and references therein.

In the next subsections, \ref{sec::Mn_Dir1} and \ref{sec::Mn_Dir2}, we propose two multinomial-Dirichlet models (Mn-Dir1 and Mn-Dir2) to predict the second-half matches of the championships given all the previous observed results of the same championship. The first-half results are used to build the prior distribution and the second-half results are applied to assess the predictive power of the models. The homepage that publishes the Arruda model also provides predictions for the first-half matches (using results of the previous twelve months), but we have no specific information about how this is done. Therefore, at the beginning of the championships, we may say that the Dirichlet-multinomial models and the Lee model are handicapped when compared to the Arruda model. Trying to compensate this handicap, we compared the models using just the second-half predictions.

Before we explain and illustrate the Dirichlet-multinomial models with an example, we make two further remarks. The first one is that we will separately consider home and away games for each team, allowing us to take into account the different performances under these conditions. The second remark is that, using the Dirichlet-multinomial approach, it is possible to predict the result of an upcoming match between teams $A$ (home team) and $B$ (away team) using the past performance of either teams. An analogy can be made to a situation where there exist two observers: one only informed about the matches A played at home and the other only informed about the matches B played away, each one providing distinct predictive distributions. Then, we propose to combine these predictive distributions by applying the so-called \textit{linear opinion pooling} method, firstly proposed by \cite{Stone61}, which consists of taking a weighted average of the predictive distributions. This method is advocated by \cite{McConway81} and \cite{Lehrer83} as the unique rational choice for combining different probability distributions. For a survey on different methods for combining probability distributions we refer to \cite{Genest86}.

    \subsection{Model One: Multinomial-Dirichet $1$}
	\label{sec::Mn_Dir1}

	The model $Mn-Dir_1$ is defined as a mixture with equal weights of two Dirichlet distributions: The posterior distributions of teams $A$ and $B$.
	Since teams $A$ and $B$ are the home and away teams, respectively, the two posterior distributions to be mixed are: (i) one considering only the matches $A$ played at home; (ii) another considering only the matches $B$ played away.
	The relevant past performance of teams $A$ and $B$ will be summarized, respectively, by the count vectors ${\bf h} = (h_1, h_2, h_3)$ (team $A$ at home) and ${\bf a} = (a_1, a_2, a_3)$ (team $B$ away), representing the numbers of matches won, drawn and~lost,~respectively.

Predictions are carried out by using a Bayes information updating mechanism. First, we use full-time results from the first-half matches as historical data for construction of the Dirichlet prior: we assign an uniform prior on $\boldsymbol{\uptheta}$ over the 2-simplex, \emph{i.e.}, $\mathcal{D}(1, 1, 1)$, and combine this prior with the data on the first half of the championship, obtaining a posterior Dirichlet distribution through conjugacy that represents the information about $\boldsymbol{\uptheta}$ up to the first half. Then, the posterior of the first half becomes the prior for the second half, which, for every matchday in the second half, will be combined with all the observed second half matches up to that matchday in order to yield posterior predictive distributions. For more on the uniform prior on the simplex, see \cite{good1965} and \cite{agresti2010}.

For instance, consider the match Gr\^emio versus Atl\'etico-PR played for matchday 20 of the 2014 championship, at Gr\^emio~stadium. Table \ref{tab:counts} displays the performances of both teams, home and away, after 19 matches. The~relevant vector of counts to be used are ${\bf h}=(h_1,h_2,h_3)=(6,2,1)$ and ${\bf a}=(a_1,a_2,a_3)=(2,3,4)$. Therefore, Gr\^emio has a $\mathcal{D}(7,3,2)$ posterior for matches played at home and Atl\'etico has a $\mathcal{D}(3,4,5)$ posterior for matches played as visitor (recall that both priors were	$\mathcal{D}(1,1,1)$).

	\begin{table}[H]
	\small
		\begin{center}
			\begin{tabular}{lccccccccc}

				\toprule
				& \multicolumn{3}{c}{\textbf{Home}} & \multicolumn{3}{c}{\textbf{Away}}& \multicolumn{3}{c}{\textbf{Overall}} \\
				\midrule
				Team & W & D & L & W & D & L & W & D & L\\

				Gr\^emio & 6 & 2 & 1 & 3 & 2 & 5 & 9 & 4 & 6\\
				Atl\'etico-PR & 4 & 4 & 2 & 2 & 3 & 4 & 6 & 7 & 6\\
				\bottomrule
			\end{tabular}
			\caption{Gr\^emio and Atl\'etico-PR counts after 19 matchdays (first half).}\label{tab:counts}
		\end{center}
	\end{table}

	Thus, considering $X_{n + 1}$ the random outcome of this match with
	respect to the home team (Gr\^{e}mio), the predictive probabilities
	of $X_{n + 1}$ is obtained by equally weighting the two predictive
	distributions,~resulting
	\begin{align*}
	P(X_{n+1}=1|{\bf h}, {\bf a}) &=
	\frac{1}{2}\left(\frac{h_1+\upalpha_1}{h_{\bullet}+\upalpha_{\bullet}}\right)+\frac{1}{2}\left(\frac{a_3+\upalpha_3}{a_{\bullet}+\upalpha_{\bullet}}\right)=0.5
	\\
	P(X_{n+1}=2|{\bf h}, {\bf a}) &=
	\frac{1}{2}\left(\frac{h_2+\upalpha_2}{h_{\bullet}+\upalpha_{\bullet}}\right)+\frac{1}{2}\left(\frac{a_2+\upalpha_2}{a_{\bullet}+\upalpha_{\bullet}}\right)\simeq0.2917, \\
	P(X_{n+1}=3|{\bf h}, {\bf a}) &= \frac{1}{2}
	\left(\frac{h_3+\upalpha_3}{h_{\bullet}+\upalpha_{\bullet}}\right)+\frac{1}{2}\left(\frac{a_1+\upalpha_1}{a_{\bullet}+\upalpha_{\bullet}}\right)\simeq0.2083.
	\end{align*}
	\noindent where $h_{\bullet}=h_1+h_2+h_3$ and $a_{\bullet}=a_1+a_2+a_3$.

	\subsection{Model Two: Multinomial-Dirichlet $2$}
	\label{sec::Mn_Dir2}

The model $Mn-Dir_2$ is similar to model $Mn-Dir_1$, except that the weights can be different and the chosen prior for $\boldsymbol{\theta}$ is now a symmetric Dirichlet $\mathcal{D}(\alpha,\alpha,\alpha)$, $\alpha > 0$. Thus, the predictive probabilities of $X_{n+1}$ are given by
	\begin{align*}
	P(X_{n+1}=1|{\bf h}, {\bf a}) &=
	w \left(\frac{h_1+\upalpha}{h_{\bullet}+\upalpha_{\bullet}}\right)+(1 - w) \left(\frac{a_3+\upalpha}{a_{\bullet}+\upalpha_{\bullet}}\right) \\
	P(X_{n+1}=2|{\bf h}, {\bf a}) &=
	w \left(\frac{h_2+\upalpha}{h_{\bullet}+\upalpha_{\bullet}}\right)+(1-w) \left(\frac{a_2+\upalpha}{a_{\bullet}+\upalpha_{\bullet}}\right), \\
	P(X_{n+1}=3|{\bf h}, {\bf a}) &= w \left(\frac{h_3+\upalpha}{h_{\bullet}+\upalpha_{\bullet}}\right) + (1-w) \left(\frac{a_1+\upalpha}{a_{\bullet}+\upalpha_{\bullet}}\right).
	\end{align*}

 The values for the weight $w$ and the hyperparameter $\alpha$ are chosen through a cross-validation procedure. Firstly, we considered a grid of 20 equally spaced points in the intervals $[0,1]$ and $(0.001, 20]$ for $w$ and $\alpha$, respectively. Then, for each pair $(w_i,\alpha_i)$, $i=1, \ldots, 400$, the Brier scores of the first-half matches (190 matches) of each championship was computed. The pair of values $(w^*,\alpha^*)$ which provided the smallest score was then chosen to predict the matches of the second half of the same championship. Before this was done, however, the counts of each team were used to update the prior $\mathcal{D}(\alpha^*,\alpha^*,\alpha^*)$ in the same manner as described in Section \ref{sec::Mn_Dir1}.

Table \ref{tab::optimalValues} displays the optimal values of $\alpha$ and $w$ chosen for each championship.
Note that the values are generally not far from those used in the model $Mn-Dir_1$, $\alpha=1$ and $w=1/2$.

\begin{table}[ht]
\centering
		\caption{Optimal values of $\alpha$
        and $w$ for each year in the model $Mn-Dir_2$.}
\begin{tabular}{rrr}
  \hline
 Year & $\alpha^*$ & $w^*$ \\
  \hline
 2006 & 3.16 & 0.53 \\
 2007 & 2.63 & 0.63 \\
 2008 & 1.05 & 0.42 \\
 2009 & 2.63 & 0.42 \\
 2010 & 2.11 & 0.58 \\
 2011 & 2.11 & 0.53 \\
 2012 & 1.58 & 0.53 \\
2013 & 2.63 & 0.79 \\
2014 & 3.16 & 0.63 \\
   \hline
\end{tabular}
\label{tab::optimalValues}
\end{table}

	One may argue that, in this case, data is being used twice in the same model---in the same spirit of empirical Bayes models---and therefore that the computation of weights is arbitrary.
	Even though these critiques are well founded, we believe that every choice to compute weights would be arbitrary.
	Ours was based on plain empirical experience, nothing more.

	\section{Results}
	\label{sec::results}

	Brazilian football championships are disputed by 20~teams that play against each other twice (home and away) and the team with more points after all matches are played is declared champion.
	Therefore, 380 matches are played per championship, 190 in each half.
	The last four teams are relegated to a minor division and the first four play Copa Libertadores (South America champions league).
	Our analysis comprised the championships from 2006 to 2014, because it was only in 2006 that this form of dispute was implemented in the Brazilian national championships.
    The predictions for the models Arruda, Lee, Bradley-Terry and the proposed multinomial ones Mn-Dir1 and Mn-Dir2 were assessed according to their accuracy and calibration. The accuracy of the predictions was measured using different scoring rules (Brier, Spherical and Logarithmic) and also the proportion of errors. For an explanation of the scoring rules, the proportion of errors and calibration see the Appendix.

	As explained above, the Arruda model uses results of the previous twelve months to predict future matches, but we have no information about how this is done.
	This fact puts the Arruda model on a privileged position at the beginning of each championship.
	Hence, trying to put all the models on equal footing, we used the first-half matches to estimate the Lee and Bradley-Terry models, and as prior information for the multinomial-Dirichlet models as described in Sections \ref{sec::Mn_Dir1} and \ref{sec::Mn_Dir2}.
	Thus, the models were compared using only the predictions for matches of the second half, i.e. we effectively scored the predictions made for 1710 matches (190 matches of nine championships).
The Lee and Bradley-Terry models were fitted using the software R and the multinomial-Dirichlet models were fitted using Python. See \cite{r} and \cite{python}.

	Figure~\ref{fig::scores} displays the box plots of the scores and proportion of errors of the six models in study (the lower the score, the more accurate the prediction). According to all scoring rules, all methods presented similar performance, and they were more accurate than the trivial prediction $(1/3,1/3,1/3)$, displayed in the plots
	as an horizontal line.	Using the mean scores and their standard errors displayed in Table \ref{tab::brier}, one can see that none of the 95\% confidence intervals for the mean score contained the score given by the trivial prediction
	(0.67 for the Brier score, 1.10 for the logarithmic score, and -0.58 for the spherical score).
	Figure \ref{fig::scoresYear} shows how the scores varied year by year in average.
	This figure also indicates that all models yielded similar results.

	\begin{figure}[H]
		\centering
		\includegraphics[page=1,scale=0.3]{futebolComparacaoModelosForPaperReview.pdf}
		\includegraphics[page=2,scale=0.3]{futebolComparacaoModelosForPaperReview.pdf}\\
		\includegraphics[page=3,scale=0.3]{futebolComparacaoModelosForPaperReview.pdf}
		\includegraphics[page=4,scale=0.3]{futebolComparacaoModelosForPaperReview.pdf}
		\caption{Scores and proportion of errors of the various predictive methods. Horizontal line represents the score of the trivial prediction $(1/3,1/3,1/3)$.}
		\label{fig::scores}
	\end{figure}

	 \begin{table}[H]
        \begin{center}
                    \caption{Mean and total scores and their standard errors for the 1710 matches.}
            \resizebox{\textwidth}{!}{%
                \begin{tabular}{cccccc}
                \hline
                Score &BT & Arruda & Lee & $Mn-Dir_1$ & $Mn-Dir_2$  \\
                                \hline
                                \hline
                & \multicolumn{5}{c}{Mean Scores} \\ \cline{2-6}
                Brier &0.635 (0.009) & 0.616 (0.007)& 0.629 (0.009)& 0.624 (0.006) & 0.628  (0.005) \\
                Spherical$\times 10$ &  -6.077 (0.062)& -6.191 (0.055)& -6.112 (0.062)& -6.123 (0.048)& -6.098 (0.041)\\
                 Logarithmic & 1.062 (0.014) & 1.027 (0.011) & 1.049 (0.013)  & 1.040 (0.009)  & 1.044 (0.008) \\
                & \multicolumn{5}{c}{Total Scores} \\ \cline{2-6}
                Brier & 1085.9 (14.9) & 1053.2 (12.6)& 1075.5 (14.9)& 1067.59 (10.4) & 1073.5  (8.8)  \\
                Spherical$\times 10$ &  -1039.2 (10.5)& -1058.7 (9.4)&  -1046.9 (10.6)& -1047.0 (8.2)& -1042.7 (7.1) \\
                 Logarithmic & 1816.4 (23.3) &  1755.7 (18.0) & 1793.6 (21.9)  & 1778.8 (15.5)  & 1785.2 (13.0)  \\
                \hline
            \end{tabular}}
            \label{tab::brier}
        \end{center}
    \end{table}

	\begin{figure}[H]
		\centering
        \begin{subfigure}{0.88\linewidth}
		\includegraphics[page=1,scale=0.45]{futebolComparacaoModelosForPaperYear.pdf}
        \caption{}
        \end{subfigure}\\
        \begin{subfigure}{0.55\linewidth}
      	\includegraphics[scale=0.35]{futebolComparacaoModelosForPaperYear2.pdf}
                        \caption{}
 \end{subfigure}
		\caption{Means and standard errors of each measure of performance by year. Plot (b) shows the same information for the Brier scores, but without standard errors.}
		\label{fig::scoresYear}
	\end{figure}

In order to formally check if all models have similar predictive power, we tested the hypotheses that all six models have the same average score.
We did this by using a repeated measures ANOVA, a statistical test that takes into account the dependency between the observations (notice that each match is evaluated by each model).
In order to perform multiple comparisons, we adjusted $p$-values so as to control the false discovery rate.
All  metrics presented significant differences at the level of significance of 5\% ($p$-value $<0.01$ in all cases, see Table \ref{tab::anova}), except for the proportion of errors, where no difference was found. Post-hoc analyses
are displayed in Table \ref{tab::postHoc}. Along with
 Table \ref{tab::brier}, one concludes that,
for the Brier score, differences were found only
between Mn-Dir$_1$ versus BT (the former had better performance), Mn-Dir$_2$ versus Arruda (the former had worse performance), and Arruda versus Lee (the former had better performance).
For the spherical score, post-hoc analyses showed that the differences were found in Mn-Dir$_2$ versus Arruda (the former had worse performance) and BT versus Arruda (the former had worse performance). Finally, for the logarithmic score, post-hoc analyses showed that the differences were found in Mn-Dir$_1$ versus BT (the former had better performance), Mn-Dir$_2$ versus BT (the former had better performance), Lee versus Arruda (the former had worse performance), and Mn-Dir$_2$ versus Arruda (the former had worse performance).

These results therefore indicate that while the multinomial-Dirichlet models presented similar performances, they were better than BT and comparable to Lee.
It is clear that the Arruda model presented the best performance, although the predictions from Mn-Dir$_1$ were not significantly different from it, according to all scoring rules.
Hence, while BT lead to worse predictions than its competitors, Arruda was slightly better than some of its competitors, but roughly equivalent to
Mn-Dir$_1$.

\begin{table}[H]
\centering
\caption{ANOVA comparing the performance
of all prediction models under the various scores.}
\begin{tabular}{rrrrrr}
  \hline
 Score & Factor& num. d.f. & den. d.f. & F-value & p-value \\
  \hline
    \hline
\multirow{2}{*}{Brier} & Intercept &   1 & 8545.00 & 8423.04 & $<$0.01$^*$ \\
&  Model &   4 & 6836 &  5.15  & $<$0.01$^*$ \\   \hline
\multirow{2}{*}{Spherical} & Intercept &   1 & 6836 & 14650.89  & $<$0.01$^*$ \\
&  Model &   4 & 6836 & 3.96 & $<$0.01$^*$ \\   \hline
\multirow{2}{*}{Logarithmic} & Intercept &   1 & 6836 & 10876.28 & $<$0.01$^*$ \\
&  Model &   4 & 6836 &6.76 & $<$0.01$^*$ \\   \hline
Proportion  & Intercept &   1 & 6836 & 2139.93 & $<$0.01$^*$ \\
of Errors &  Model &   4 & 6836 & 0.31 & 0.86 \\   \hline
   \hline
\end{tabular}
\label{tab::anova}
\end{table}

\begin{table}[H]
\centering
\footnotesize
\caption{Post-hoc analyses comparing the performance
of all prediction models under the various scores.}
\begin{tabular}{llllll}
  \hline
Score & Comparison & Estimate & Std. Error & z-value & p-value \\   \hline \hline
\multirow{10}{*}{Brier} & Arruda - BT & -0.02 &  0.00 & -4.59 & $<$0.01$^*$ \\
&  Lee - BT & -0.01 & 0.00 & -1.47 & 0.24 \\
 & Mn-Dir$_1$ - BT & -0.01 & 0.00 & -2.58 & 0.04$^*$ \\
 & Mn-Dir$_2$ - BT & -0.01 & 0.00 & -1.75 & 0.16 \\
 & Lee - Arruda & 0.01 & 0.00 & 3.12 & 0.01$^*$ \\
 & Mn-Dir$_1$ - Arruda & 0.01 & 0.00 & 2.01 & 0.11 \\
 & Mn-Dir$_2$ - Arruda & 0.01 & 0.00 & 2.84 & 0.02$^*$ \\
 & Mn-Dir$_1$ - Lee & -0.00 & 0.00 & -1.11 & 0.36 \\
 & Mn-Dir$_2$ - Lee & -0.00 & 0.00 & -0.28 & 0.79 \\
 & Mn-Dir$_2$ - Mn-Dir$_1$ & 0.00 & 0.00 & 0.83 & 0.48 \\    \hline
\multirow{10}{*}{Spherical}  &Arruda - BT & -0.01 & 0.00 & -3.89 & $<$0.01$^*$ \\
 & Lee - BT & -0.00 & 0.00 & -1.54 & 0.23 \\
 & Mn-Dir$_1$ - BT & -0.00 & 0.00 & -1.55 & 0.23 \\
  &Mn-Dir$_2$ - BT & -0.00 & 0.00 & -0.69 & 0.57 \\
  &Lee - Arruda & 0.01 & 0.00 & 2.35 & 0.06 \\
  &Mn-Dir$_1$ - Arruda & 0.01 & 0.00 & 2.34 & 0.06 \\
  &Mn-Dir$_2$ - Arruda & 0.01 & 0.00 & 3.20 & 0.01$^*$ \\
  &Mn-Dir$_1$ - Lee & -0.00 & 0.00 & -0.02 & 0.99 \\
  &Mn-Dir$_2$ - Lee & 0.00 & 0.00 & 0.85 & 0.59 \\
  &Mn-Dir$_2$ - Mn-Dir$_1$ & 0.00 & 0.00 & 0.87 & 0.59 \\
    \hline
\multirow{10}{*}{Logarithmic} &Arruda - BT & -0.04 & 0.01$^*$ & -5.28 & $<$0.01 \\
 & Lee - BT & -0.01 & 0.01 & -1.99 & 0.08 \\
 & Mn-Dir$_1$ - BT & -0.02 & 0.01 & -3.28 & 0.01$^*$ \\
 & Mn-Dir$_2$ - BT & -0.02 & 0.01 & -2.72 & 0.02$^*$ \\
 & Lee - Arruda & 0.02 & 0.01 & 3.29 & 0.01$^*$ \\
 & Mn-Dir$_1$ - Arruda & 0.01 & 0.01 & 2.01 & 0.08 \\
 & Mn-Dir$_2$ - Arruda & 0.02 & 0.01 & 2.57 & 0.03$^*$ \\
 & Mn-Dir$_1$ - Lee & -0.01 & 0.01 & -1.29 & 0.27 \\
 & Mn-Dir$_2$ - Lee & -0.00 & 0.01 & -0.73 & 0.54 \\
 & Mn-Dir$_2$ - Mn-Dir$_1$ & 0.00 & 0.01 & 0.56 & 0.59 \\
\hline
\end{tabular}
\label{tab::postHoc}
\end{table}

We further illustrate this point in Figure \ref{fig::scores2}, where the plots display the scores of each match for every couple of models considered. The plots show that all methods performed similarly, and that the multinomial-Dirichlet models are the ones that agreed the most.

\begin{figure}[H]
\centering
		\begin{subfigure}{0.48\linewidth}       \includegraphics[page=13,scale=0.48]{futebolComparacaoModelosForPaperReview.pdf}
        \caption{}
		\end{subfigure}
        \begin{subfigure}{0.48\linewidth}      \includegraphics[page=14,scale=0.48]{futebolComparacaoModelosForPaperReview.pdf}
                \caption{}
		\end{subfigure}
\caption{Pairwise comparisons of the various scores. (a): upper right plots display Logarithmic Scores;
lower left plots display Brier Scores. (b): upper right plots display proportion of agreements between methods (i.e., proportion of times the conclusions are the same; see the Appendix); lower left  plots display Spherical Scores. Lines represent} the identity $y=x$.
\label{fig::scores2}
\end{figure}

We also evaluated how reasonable were the predictions by assessing the calibration of the methods considered, i.e., by evaluating how often events which have assigned probability $p$ (for each $0<p<1$) happened (see the Appendix).
If these observed proportions are close to $p$, one concludes that the methods are well-calibrated. The results are displayed in Figure \ref{fig::calibration}. Because the Arruda and multinomial-Dirichlet models have curves that are close to the identity ($45^{\text{o}}$ line), we conclude that these methods are well-calibrated. On the other hand, BT and Lee seem to be poorly calibrated, over-estimating probabilities for the most frequent events.

\begin{figure}[H] \centering
	\includegraphics[page=5,scale=0.3]{futebolComparacaoModelosForPaperReview.pdf}
	\includegraphics[page=6,scale=0.3]{futebolComparacaoModelosForPaperReview.pdf}
	\includegraphics[page=7,scale=0.3]{futebolComparacaoModelosForPaperReview.pdf}\\
	\includegraphics[page=8,scale=0.3]{futebolComparacaoModelosForPaperReview.pdf}
	\includegraphics[page=9,scale=0.3]{futebolComparacaoModelosForPaperReview.pdf}
	\caption{Calibration of the various predictive methods: estimates of
	occurrence frequency obtained by smoothing splines, with 95\%
	confidence bands. Black line is the identity $y=x$. }
	\label{fig::calibration}
\end{figure}

\subsection{Goodness of fit and information measures}

We also evaluated the goodness of fit of each model by computing, for each team $t$, the following statistics:
	$$e^H_t = \sum_{i \in H_t} \widehat{p}_{t,i}\ \ \  \mbox{ and } \ \ \  e^A_t = \sum_{i \in A_t} \widehat{p}_{t,i},$$
	where $\widehat{p}_{t,i}$ is the estimated probability team $t$ wins the $i$-th match,
	$H_t$ is the set of matches team $t$ played as home team, and $A_t$ the set of matches team $t$ played away.
	We then computed a $\chi^2$ statistic
	$$\chi^2_o = \sum_{t} \frac{(e^H_t-o^H_t)^2}{e^H_t}+\frac{(e^A_t-o^A_t)^2}{e^A_t},$$
	where $o^H_t$ is the number of times team $t$ won playing home and $o^A_t$ is the number of times team $t$ won playing away.
	We then compared $\chi^2_o$ to a $\chi^2$
	distribution with 40 degrees of freedom (twice the number of teams of each championship).
	Since we did not fit the Arruda model, this was the only goodness of fit measure we could compute.

	The values of the statistics and their corresponding $p$-values are displayed in Table \ref{tab::goodness}.
	Except for the BT model, all other methods presented
	reasonable goodness of fit, in particular, the multinomial-Dirichlet model 1, which presented the smaller chi-square statistics, thus indicating better fit.

	\begin{table}[H]
		\begin{center}
			\begin{tabular}{cccccc}
				\hline
				Score &BT & Arruda & Lee & $Mn-Dir_1$ & $Mn-Dir_2$  \\
				\hline
				\hline
				$\chi^2_o$ &112.8 & 76.9& 91.5& 61.5 & 77.2 \\
				$p$-value & 0.001 & 0.48 &0.14  & 0.91  & 0.50 \\
				\hline
			\end{tabular}
			\caption{Goodness of fit statistics for the models considered.}
			\label{tab::goodness}
		\end{center}
	\end{table}

To have a deeper understanding about the probabilities given by each method, Figure \ref{fig::probMandante} displays the estimated conditional probability that the home team wins assuming the match will not be a tie.
All models assigned higher probabilities to the home team, showing that they captured the well-known fact known as home advantage, peculiar in football matches and other sport competitions \citep{Pollard86, Clarke95, Nevill99}.
	\begin{figure}[H] \centering
		\includegraphics[page=11,scale=0.4]{futebolComparacaoModelosForPaperReview.pdf}
		\caption{Conditional probability that the home team wins given there
			is no draw. Horizontal line indicates a 50\% probability.}
		\label{fig::probMandante}
	\end{figure}

In order to check how informative the predictions provided by the six models were, we computed the entropy of their predictions.
Recall that the entropy of a prediction $(p_1,p_2,p_3)$ is given by $- \sum_{i=1}^3 p_i \log{p_i}$.
Figure \ref{fig::entropy} presents the box plots of the entropy of each prediction for all the studied models.
Since the entropy values are smaller than 1.09, the plots show that the predictions were typically more informative than the trivial prediction.
Nevertheless, all methods yielded similar entropies on average, that is, none of them provided more informative probabilities.

			\begin{figure}[H]
				\centering
				\includegraphics[page=10,scale=0.3]{futebolComparacaoModelosForPaperReview.pdf}
				\caption{Entropy of the predictions of the various methods. Horizontal line represents the entropy of the trivial prediction $(1/3,1/3,1/3)$.}
				\label{fig::entropy}
			\end{figure}

Summarizing our conclusions we may say that, for the matches considered in our analysis, all the studied models yielded better predictions than the trivial prediction.
In particular the multinomial-Dirichlet models were well-calibrated, while the Lee model was not.
Model Mn-Dir$_1$ presented the best goodness of fit statistic, while models Mn-Dir$_2$ and Arruda showed similar goodness-of-fit.
About the scoring rules, while the Bradley-Terry model yielded worse predictions than its competitors according to all metrics, the Arruda model was the best one according to the three scoring rules considered in this work, but not in every championship.
The scores of the predictions provided by the multinomial-Dirichlet models were, on average, similar to the scores of the Arruda model.

Therefore, we conclude that the
multinomial-Dirichlet models are competitive with standard approaches.

	\section{Final Remarks}
	\label{sec::remarks}

    The benchmark models used in this work were chosen because of their wide popularity among football fans in Brazil, despite the availability of several other models in the literature. Among them, we can cite those that model the match as a stochastic process evolving in time \citep{Dixon98, Volf2009, Titman2015}, those allowing for the team performance parameters to change along the season~\citep{Rue2000,Crowder2002,Owen2011,Koopman2015} and those modeling dependence between number of goals by means of bivariate count distributions \citep{Dixon97, Karlis2003, McHale2007, McHale2011}.
Contrary to the multinomial models we proposed, some of these approaches are able to answer several questions, for instance, they can estimate teams' performance parameters allowing to rank the teams according to their offensive and defensive qualities, and can also predict the number of goals scored in a particular match.

Another critical difference between the benchmark and the multinomial models is that the latter are Bayesian, while the former are not. Not only the way they use past information is different (because of frequentist and Bayesian paradigms), but also the pieces of information used in the analysis (for example, the Arruda model uses results of the previous twelve months, including other championships, while multinomial models use only the previous matches of the current championship). One can argue that this may lead to unfair comparisons, which is true if the interest is on the inferential properties of the models; our interest, however, is on prediction only, the true purpose of all of these models. For prediction comparions, there is not even a need for a probabilistic model, as we have seen in the comparisons with the trivial prediction.

Nonetheless, when we are interested only on predicting the final outcome of future matches, the multinomial-Dirichlet models can perform equally well as their complex counterparts.
The advantage of the first proposed model is that its predictions are obtained through simple calculations, without requiring numerical optimization procedures.
	The importance of such finding is directly related to the models usability in practice: professionals that use the mentioned benchmark models often say that a difficulty they face is that predictions may generate anger in football fans, which is then translated into distrust in subsequent predictions.
    Because of the complexity of some models, they find hard to explain to the lay user how the outcomes were predicted.
	This is where using simple models pays off: the first multinomial model yields results that are easy to explain because they only involve counts of losses, wins and draws, allowing one to offer simple explanations to football fans and journalists about the proposed predictions.

Our work also poses several questions about probabilistic prediction of sport events.
		In particular, based on the fact that the models have similar predictive power on average, one may ask: Is there an irreducible ``randomness'' or ``degree of unpredictability'' implicit in these events?
		Is this degree an indicator of how tight or leveled is the championship being studied?

		A suggestion of future research is to answer these questions by considering more championships and models, and by comparing them using other scoring rules.
		We would also like to test other weighting methods in models $Mn-Dir_1$ and $Mn-Dir_2$ here proposed, and to evaluate their impact on the predictive power of the resulting predictions.

        Another possible extension is to explore different prior distributions for the multinomial-Dirichlet models.
        In this work, we have predicted the second half of the season using a prior based on the first half. However, one can refine prior construction in order to enable first-half predictions. For instance, one can construct priors based on pre-season odds---e.g. odds for winning the championship, finishing in a given position--- or on rankings of the teams---such as Elo rankings---provided by experts before the beginning of each championship and this is equivalent, one may say, to use the results of previous matches from a given time span.

	\section*{Appendix: scoring rules and calibration}
	\label{sec::scoring}

	In this appendix we describe the scoring rules, how we computed the proportion of errors and the calibration measure used in the paper.
	Firstly we provide a definition of proper scoring rules with simple examples to illustrate some of them and afterwards we describe the criterion developed to verify if the models are calibrated.

	One way to fairly rank predictive models is by using proper scoring rules, where
	the score may be interpreted as a numerical measure of how inaccurate a given probabilistic prediction was.

	Formally, let $X$ be a random variable
	taking values in $\mathcal{X}=\{1,2,3\}$ indicating
	the outcome of the match, with 1 standing for home win, 2 for draw and 3 for away win.  Moreover, let $P=(P_1,P_2,P_3)$ denote one's probabilistic prediction
	about $X$, \emph{i.e.}, $P$ lies in the 2-simplex set $\Delta_2=\{(p_1,p_2,p_3):p_1+p_2+p_3=1, \ p_1,p_2,p_3\geq0\}$ (see Figure
	\ref{fig:simplex}).
	A scoring rule is a function
	that assigns a real number (score) $S(x,P)$ to each $x \in \mathcal{X}$
	and $P \in \Delta_2$
	such that
	for any given $x$ in $\mathcal{X}$, the score  $S(x,P)$ is minimized when $P$ is
	$(1,0,0)$, $(0,1,0)$ or $(0,0,1)$ depending if $x$ is 1, 2 or 3, respectively.
	The score $S(x,P)$ can be thought as
	a penalty to be paid when one assigns the
	probabilistic prediction $P$ and outcome
	$x$ occurs. Also, the ``best'' possible score (\emph{i.e.}, the smallest score value) is achieved when the probabilistic prediction for the outcome of the game is perfect. A scoring rule may also be defined to be such that a large value of the score indicates good forecasts.

		\begin{figure}[H]
		\begin{center}
			\begin{tikzpicture}[scale=2,tdplot_main_coords,axis/.style={->},thick]

			\draw[axis] (0, 0, 0) -- (1.4, 0, 0) node [right] {$p_1$};
			\draw[axis] (0, 0, 0) -- (0, 1.4, 0) node [above] {$p_2$};
			\draw[axis] (0, 0, 0) -- (0, 0, 1.4) node [above] {$p_3$};

			\coordinate  (d1) at (1,0,0){};
			\coordinate  (d2) at (0,1,0){};
			\coordinate  (d3) at (0,0,1){};

			\fill[gray!80,opacity=0.2] (d1) -- (d2) -- (d3)-- cycle;

			\draw[-, gray, thick] (0,0,1) -- (1,0,0);
			\draw[-, gray, thick] (0,0,1) -- (0,1,0);
			\draw[-, gray ,thick] (1,0,0) -- (0,1,0);

			\node[fill,circle,inner sep=1.5pt,label={left:$(1,0,0)$}] at (d1) {};
			\node[fill,circle,inner sep=1.5pt,label={south east:$(0,1,0)$}] at (d2) {};
			\node[fill,circle,inner sep=1.5pt,label={left:$(0,0,1)$}] at (d3) {};

			\draw[-latex,thick](d3) to [out=60,in=180] (1,1,2);

			\node[label={right:away team wins}] at (1,1,2) {};

			\draw[-latex,thick](d1) to [out=-90,in=180] (1,1,-1);

			\node[label={right:home team wins}] at (1,1,-1) {};

			\draw[-latex,thick](d2) to [out=-120,in=180] (1,1,-.25);

			\node[label={right:draw}] at (1,1,-.25) {};

			\node[fill, black, circle,inner sep=1.5pt] at (0.25,0.35,0.40) {};

			\draw[-latex,thick](0.25,0.35,0.40) to [out=90,in=180] (1,1,1.2);

			\node[label={right:$(0.25,0.35,0.40)$: prediction}] at (1,.9,1.2) {};

			\end{tikzpicture}
			\caption{Bi-dimensional simplex (gray surface): area of possible forecasts.}\label{fig:simplex}
		\end{center}
	\end{figure}

	Although many functions can satisfy the above scoring rule definition, not all of them encourage honesty and accuracy when assigning a prediction to an event. Those that do enable a fair probabilistic assignment are named \emph{proper scoring rules} \citep{lad}, which we describe in the sequence.

	Consider a probabilistic prediction $P^*=(P_1^*,P_2^*,P_3^*)$ for $X$.
	A proper scoring rule $S$ is a scoring rule  such that the mean score value
	$$E_{P^*}[S(X,P)]=\sum_{x=1}^3 S(x,P)P^*_x$$
	is minimized when $P=P^*$.
	In other words, if one announces
	$P$ as his probabilistic prediction
	and uses $S$ as scoring rule, the lowest
	expected penalty is obtained by reporting $P^*$, the model real uncertainty about $X$.
	Thus, the use of a proper scoring rule encourages the forecaster to announce $P^*$ (the correct one)
	as his probabilistic prediction  rather than some other quantity.

	In what follows, we describe in detail three proper scoring rules we use to assess the considered models.
	We also recall the concept of calibration and propose a way to measure the calibration degree of each model.

	\subsection*{Brier Scoring Rule}

	Let $P=(P_1,P_2,P_3)$ be a probabilistic prediction  for $X$.
	The Brier score for a given outcome $x\in\{1,2,3\}$ is given by
	$$S(x,P)= \sum_{i=1}^3\mathbb{I}(x=i)(1- P_i)^2+\sum_{i=1}^3\mathbb{I}(x\neq i)P^2_i,$$
	where $\mathbb{I}$ is the indicator function.

	We interpret the Brier score in the case where one of three mutually exclusive outcomes happens as in the case of a football match.
	The green surface in Figure \ref{fig:simplex} represents the 2-simplex, \emph{i.e.}, the set of points such that $p_1+p_2+p_3=1$ for non-negative values of $p_1$, $p_2$ and $p_3$.
	The triangle representing the simplex has sides of length $\sqrt{2}$ and its height is $\sqrt{6}/2$.
	Drawing a similar equilateral triangle with height 1 and sides $2\sqrt{3}/3$, it is possible to represent all points of the simplex.
	This new triangle is used to graphically display the forecast as an internal point because the sum of the distances of every point inside it to each side, representing the probability of each event, is always one.
	See Figure \ref{fig:norm_stand}.

	\begin{figure}[H]
		\centering

				\begin{subfigure}[b]{0.48\linewidth}
					\centering

					\begin{tikzpicture}[scale=4]
					\draw [thick](0,0) -- (1.1547,0) -- (0.57735,1)-- (0,0);

					\node[fill, black, circle,inner sep=1.5pt] at (0.63509,0.40) {};
					\node[label={below:$p$}] at (0.63509,0.40) {};

					\draw[dashed,thick] (0.63509,0.40) -- (0.57735,1);

					\draw[decorate,decoration={brace,amplitude=5pt},xshift=-1pt,yshift=0pt] (0.63509,0.40) -- (0.57735,1) node[black,midway,xshift=-0.4cm] {$d$};

					\node[label={below:Home wins}] at (0,-0.05) {};
					\node[label={below:Draw}] at (1.1547,-0.05) {};
					\node[label={above:Away wins}] at (0.57735,1.1) {};

					\node[label={below:$(1,0,0)$}] at (0,0.05) {};
					\node[label={below:$(0,1,0)$}] at (1.1547,0.05) {};
					\node[label={above:$(0,0,1)$}] at (0.57735,0.95) {};

					\draw[dashed,thick] (-.3,1) -- (0.57735,1);
					\draw[dashed,thick] (-.3,0) -- (0,0);
					\draw[decorate,decoration={brace,amplitude=10pt},xshift=-9.5pt,yshift=0pt] (0,0) -- (0,1.01) node[black,midway,xshift=-0.7cm] 			{\large$\frac{\sqrt{6}}{2}$};

					\end{tikzpicture}

					\caption{Brier score, $d$, for victory of away team}
					\label{fig:A}
				\end{subfigure}
		\begin{subfigure}[b]{0.48\linewidth}
			\centering

			\begin{tikzpicture}[scale=4]
			\draw [thick](0,0) -- (1.1547,0) -- (0.57735,1)-- (0,0);

			\node[fill, black, circle,inner sep=1.5pt] at (0.63509,0.40) {};

			\draw[dashed,thick] (0.63509,0.40) -- (0.63509,0);
			\draw[dashed,thick] (0.63509,0.40) -- (0.85159,0.525);
			\draw[dashed,thick] (0.63509,0.40) -- (0.331976,0.575);

			\draw[thick] (0.63509,0.07) -- (0.70509,0.07) -- (0.70509,0);
			\node[fill, black, circle,inner sep=.7pt] at (0.67009,0.035) {};
			\draw[thick] (0.7909695,0.49) -- (0.7559695,0.5506225) -- (0.8165912,0.5856225);
			\node[fill, black, circle,inner sep=.7pt] at (0.8037803,0.5378116) {};
			\draw[thick] (0.3925977,0.54) -- (0.3575977,0.4793783) -- (0.2969759,0.5143783);
			\node[fill, black, circle,inner sep=.7pt] at (0.3447868,0.5271892) {};

			\draw[decorate,decoration={brace,mirror,amplitude=4pt},xshift=-0.7pt,yshift=0pt] (0.63509,0.40) -- (0.63509,0) node[black,midway,xshift=-0.4cm] {$p_3$};

			\draw[decorate,decoration={brace,mirror,amplitude=5pt},yshift=-0.5pt,xshift=0.5pt] (0.63509,0.40) -- (0.85159,0.525) node[black,midway,yshift=-0.5cm,xshift=10pt] {$p_1$};

			\draw[decorate,decoration={brace,mirror, amplitude=5pt},xshift=0.1pt,yshift=0.7pt] (0.63509,0.40) -- (0.331976,0.575) node[black,midway,xshift=5pt,yshift=10pt] {$p_2$};

			\node[label={below:Home wins}] at (0,0) {};
			\node[label={below:Draw}] at (1.1547,0) {};
			\node[label={above:Away wins}] at (0.57735,1) {};

			\draw[dashed,thick] (-.3,1) -- (0.57735,1);
			\draw[dashed,thick] (-.3,0) -- (0,0);
			\draw[decorate,decoration={brace,amplitude=10pt},xshift=-9.5pt,yshift=0pt] (0,0) -- (0,1.01) node[black,midway,xshift=-0.6cm] {\large$1$};

			\end{tikzpicture}

			\caption{Normalized simplex: $p_1+p_2+p_3=1$}
			\label{fig:B}
		\end{subfigure}
		\caption{Standard \textbf{(a)} and normalized \textbf{(b)} simplexes.}
		\label{fig:norm_stand}
	\end{figure}

	The Brier score for the probabilistic prediction $P=(0.25,0.35,0.40)$
	assuming the home team loses, is therefore given by $d^2=(0-0.25)^2+(0-0.35)^2+(1-0.40)^2=0.545$.
	On the other hand, the prediction $P=(0,0,1)$ achieves score  zero, the minimum for this rule.

	It is useful to consider the score of what we will call trivial prediction:
	$P=(1/3,1/3,1/3)$.
	This~assessment will produce a Brier score of $2/3$, no matter what is the final result of the match, providing, thus, a threshold that a good model should consistently beat, meaning, for the Brier score, that the scores of its predictions should be smaller than $0.667$.

	\subsection*{Logarithmic Scoring Rule}

	The logarithmic  score is given by
	$$S(x,P)=- \sum_{i=1}^3\mathbb{I}(x=i)\ln(P_i),$$

	\noindent
	which is the negative log likelihood of the event that occurred.

	The logarithmic score for the prediction
	$P=(0.25,0.35,0.40)$
	when the home team loses is therefore
	$-\ln(0.4)\approx 0.91$.
	On the other hand, the prediction $P=(0,0,1)$ achieves score zero, once again the minimum of this rule.
	Moreover, for the logarithmic score, the trivial prediction gives a score of approximately $1.098$.

	\subsection*{Spherical Scoring Rule}

	The spherical score is given by
	$$S(x,P)=- \frac{1}{\sqrt{\sum_{i=1}^3 P^2_i}}\sum_{i=1}^3\mathbb{I}(x=x_i)P_i,$$

	\noindent
	which is the negative likelihood of the event that occurred, normalized by the square-root of the sum of the assigned squared probabilities.

	The spherical score for the prediction
	$P=(0.25,0.35,0.40)$ assuming the home team loses, is given by
	$-0.4/\sqrt{0.25^2+0.35^2+0.40^2} \approx -0.68$.
	On the other hand, the prediction $P=(0,0,1)$ achieves score  $-1$ instead and, for this rule, the trivial prediction results in a score of approximately $-0.577$.

	\subsection*{Calibration and Proportion of Errors}
	\label{sec::calib}

	Besides scoring rules, there are other criteria used to assess the quality of different predictions. Here~we explore two of them.

	The first one is the proportion of errors made by the model or assessor. This is simply the proportion of mistakes made when considering the highest probability assessment.
	More precisely, the proportion of errors of a sequence of probabilistic predictions for $n$ games, $P^{(1)},\ldots,P^{(n)}$
	with
	$P^{(j)}=(P^{(j)}_1,P^{(j)}_2,P^{(j)}_3)$, is defined by
	$$\frac{1}{n}\sum_{j=1}^n \mathbb{I}\left(X_j \neq \arg \max_{x \in \{1,2,3\}} P^{(j)}_x\right),$$
	where $X_j$ is the outcome of the $j$-th match.

	The second concept we use is that of calibration \citep{Dawid}. Probability assertions are said to be well calibrated at the level of probability $p$ if the observed proportion of all propositions that are assessed with probability $p$ equals $p$.

	Because we typically do not have several predictions with the same assigned probability $p$, we obtain a plot by smoothing (\emph{i.e.}, regressing) the indicator function of whether a given result happened as a function of the probability assigned for that result.
	That is, we estimate the probability that an event occurs given its assigned probability.
	The smoothing was done via smoothing splines \citep{wahba}, with tuning parameters chosen by cross-validation.

		\bibliographystyle{apalike}

redpajama_set_name: RedPajamaArXiv


text:
Q: Trying to pass a FOREIGN KEY of type date is throwing an error I have created a table like so:
CREATE TABLE festival
(
    title text,
    place text,
    sdate date,
    edate date,
    PRIMARY KEY (title)
);

Now, I would like to create another table which would use "title" and "edate" from the festival table.
CREATE TABLE event
(
    title text,
    edate date,
    etime time,
    FOREIGN KEY (title, edate) REFERENCES festival (title, edate),
    PRIMARY KEY (title, edate, etime)
);

I am getting an error:

there is no unique constraint matching given keys for referenced table "festival"

If I only try to pass the title as a foreign key, then it works, however, if I only try to pass the edate as a foreign key, then it fails (meaning the issue is in "edate" for some reason).
Why is this happening?

A: A foreign key relationship should link to the primary key of another table.  So, you should not have edate in the definition:
FOREIGN KEY (title) REFERENCES festival (title),

There is no reason to repeat edate in the two tables, if they are supposed to be the same.  Just keep it in festival and look it up using a join.
I would also recommend that you change festival to be:
CREATE TABLE festival (
    festivalId serial primary key,
    title text unique,
    place text,
    sdate date,
    edate date
);

That is, introduce a synthetic key which can be used for foreign key relationships.  Declare title to be unique.  And then use festivalId in the events table to get both the title and the date.
Note:  This assumes that the primary key on festival should only be on title.  If it is on (title, edate), basically the same logic holds.  In fact, just introduce festivalId and use that to look up all information about the festival.

redpajama_set_name: RedPajamaStackExchange


By now, most of us have heard that trans fatty acids (or trans fats) are harmful to our health. In 2006, the FDA even started requiring trans fats to be listed on food labels so that consumers could be aware of their consumption (see Trans Fats: What Are They, and Why Are They Bad?). But, did you know there's actually a type of trans fat that's incredibly good for us? It's called conjugated linoleic acid (CLA), and it occurs naturally in meat and dairy products (especially from grass-fed animals). In the world of fats, CLA is a rock star with a long, scientifically proven list of benefits!
When ruminant animals (such as cows, sheep, and goats) consume plant foods, bacteria in their rumens convert linoleic acid (an omega-6 fat) into stearic acid (a saturated fat). Several steps are involved in this process, and one stage involves the production of CLA. Some of this CLA never makes it to the fully saturated stage, and instead becomes incorporated into the animal's meat (particularly in the interstitial, non-visible fat distributed along muscle fibers) and milk.
CLA is technically a family of isomers (compounds with the same molecular formula, but with different atom arrangements, giving them different properties). At least 28 CLA isomers exist, but the most prevalent ones are cis-9,trans-11 (which makes up about 80% of the CLA found in food) and trans-10,cis-12 (which is less abundant, but more efficiently oxidized due to the placement of its double bonds). Among our existing CLA research, these two isomers have typically been the focus.
Humans with healthy guts also have a (limited!) capacity to obtain CLA from linoleic acid and alpha-linoleic acid, through bioconversion from bacteria in our intestines (particularly Bifidobacteria strains like B. breve). However, studies have shown that people with celiac disease, gut dysbiosis, and other forms of digestive disease lose the ability to produce CLA in any significant amount… making it extra important to obtain it from dietary sources!
Cancer: In a variety of studies, CLA has been shown to induce apoptosis (programmed death) of colorectal cancer cells, both in animal models and when using human cells. Some studies have also suggested a protective effect against breast and prostate cancer. Scientists are still exploring the mechanisms behind CLA's cancer benefits, but potential routes include peroxisome proliferator-activated receptor gamma (PPARy) activation, enhanced caspase-3 activity in the colon mucosa, and reduced angiogenesis and tumor invasion by inhibiting matrix metalloproteinase-9.
In population studies, people with higher tissue levels of CLA appear to have protection against heart attacks and cardiovascular disease in general. More research is needed in humans to understand the mechanisms at play! Some scientists speculate that the CLA content in dairy is one reason why full-fat dairy products (especially grass-fed) often show up inversely related to heart disease in studies.
CLA appears to have a number of anti-obesity mechanisms, including helping us reduce our food intake via appetite suppression, inhibiting adipose fat production, stimulating the breakdown of fat, and increasing energy expenditure throughout the body (including white adipose tissue, muscle, liver tissue, and lean body mass).
Diabetes: CLA may play a role in insulin regulation! Studies have shown that people with higher levels of CLA in their adipose tissue (suggesting higher dietary intake) have a significantly lower risk of diabetes. Although more research is needed in humans, animal studies have confirmed that CLA can reduce the proinflammatory insulin-resistant state linked to obesity and diabetes, as well as reduce the size of fat cells.
Yep, this amazing naturally-occurring trans fat is definitely worth paying attention to! It doesn't qualify as an essential nutrient (that honor in the fat world belongs to linoleic acid [the shortest omega-6 fat] and alpha-linolenic acid [the shortest omega-3 fat]), but maybe it should!
Now that we know about CLA's many benefits, the question is: how do we get this amazing fat into our lives?! A number of CLA supplements are on the market, but are these better than obtaining CLA from food?
Most CLA supplements consist of one or two of the most common CLA isoforms (cis-9,trans-11 and trans-10,cis-12). While these isoforms definitely provide benefits in a dietary setting, their isolated intake misses out on the matrix of other micronutrients (and even other CLA isoforms!) that we ingest when we consume whole foods. For example, full-fat grass-fed dairy is a rich source of CLA, but it also contains butyrate (an extremely beneficial short-chain fatty acid) and in the case of fermented products, probiotics that can benefit our gut health (among many other things!). Not surprisingly, CLA from supplements doesn't appear as beneficial as CLA obtained from foods. Some studies even suggest adverse effects from supplementation, such as higher CRP (C-reactive protein, a bloodborne marker of inflammation). And, CLA in only one isoform may be particularly unhelpful, because the different isoforms appear to work synergistically to provide benefits. The evidence overwhelmingly points to food-based CLA being optimal!
With that in mind, the best food sources of CLA are grass-fed ruminant meat and dairy—particularly grass-fed beef, grass-fed lamb, butter and cheese from grass-fed cow milk, and other full-fat dairy products. And yes, the grass-fed makes a huge difference! The CLA content of meat and dairy from grass-fed cows is up to 500% higher than meat and dairy from grain-fed cows! In fact, some researchers postulate that the reason why conventional meat is linked to cancer is because of its relative lack of CLA (but also check out The Link Between Meat and Cancer). We also can't "cheat" by buying fattier cuts of grain-fed meat, thinking there will be more CLA because of the higher total fat content: CLA is concentrated in the interstitial fat within muscle meat, not in the visible fat stripes.
My preferred source for grass-fed meat is ButcherBox, which operates on a flexible and convenient subscription basis. I love the fact that I get a box of high quality (and high CLA!) meat delivered straight to my door every single month. Butcher Box sells the highest quality 100% Grass-fed and Grass-finished Beef, Free Range Organic Chicken, and Heritage Breed Pork. You choose whether your carefully-curated box of 8-11 lbs of meat arrives every month or every other month, right to your door! A subscription is $129 a month, and is enough for 20-28 individual meals at around 6oz. per meal. My family LOVES that Butcher Box creates different combinations of meat every box, so we never get bored! Plus, new and unusual cuts of meat come with recipe cards to help inspire us in the kitchen. Of course, if you prefer more control, you can always opt for a custom box, which allows you to choose your cuts. I highly recommend a ButherBox subscription!
Barrett E, et al. "Rapid screening method for analyzing the conjugated linoleic acid production capabilities of bacterial cultures." Appl Environ Microbiol. 2007 Apr;73(7):2333-7. Epub 2007 Feb 2.
Belury MA. "Inhibition of carcinogenesis by conjugated linoleic acid: potential mechanisms of action." J Nutr. 2002 Oct;132(10):2995-8.
Castro-Webb N, et al. "Cross-sectional study of conjugated linoleic acid in adipose tissue and risk of diabetes." Am J Clin Nutr. 2012 Jul;96(1):175-81. doi: 10.3945/ajcn.111.011858. Epub 2012 May 30.
Chin SF, et al. "Dietary sources of conjugated dienoic isomers of linoleic acid, a newly recognized class of anticarcinogens." The Journal of Food Composition and Analysis. Sept 1992;5(3):185-197.
Churruca I, et al. "Conjugated linoleic acid isomers: differences in metabolism and biological effects." Biofactors. 2009 Jan-Feb;35(1):105-11. doi: 10.1002/biof.13.
Coakley M, et al. "Intestinal bifidobacteria that produce trans-9, trans-11 conjugated linoleic acid: a fatty acid with antiproliferative activity against human colon SW480 and HT-29 cancer cells." Nutr Cancer. 2006;56(1):95-102.
Dhiman TR, et al. "Conjugated linoleic acid content of milk from cows fed different diets." J Dairy Sci. 1999 Oct;82(10):2146-56.
Evans M, et al. "Trans-10, cis-12 conjugated linoleic acid increases fatty acid oxidation in 3T3-L1 preadipocytes." J Nutr. 2002 Mar;132(3):450-5.
Gorissen L, "Conjugated linoleic and linolenic acid production kinetics by bifidobacteria differ among strains." Int J Food Microbiol. 2012 Apr 16;155(3):234-40. doi: 10.1016/j.ijfoodmicro.2012.02.012. Epub 2012 Feb 23.
Gorissen L, et al. "Bacterial production of conjugated linoleic and linolenic Acid in foods: a technological challenge." Crit Rev Food Sci Nutr. 2015;55(11):1561-74. doi: 10.1080/10408398.2012.706243.
Heinze VM, et al. "Dietary conjugated linoleic acid and long-chain n-3 fatty acids in mammary and prostate cancer protection: a review." Int J Food Sci Nutr. 2012 Feb;63(1):66-78. doi: 10.3109/09637486.2011.598849. Epub 2011 Jul 15.
Ip MM, et al. "Prevention of mammary cancer with conjugated linoleic acid: role of the stroma and the epithelium." J Mammary Gland Biol Neoplasia. 2003 Jan;8(1):103-18.
Kennedy A, et al. "Antiobesity mechanisms of action of conjugated linoleic acid." J Nutr Biochem. 2010 Mar;21(3):171-9. doi: 10.1016/j.jnutbio.2009.08.003. Epub 2009 Dec 1.
Kim KJ, et al. "ATF3 Mediates Anti-Cancer Activity of Trans-10, cis-12-Conjugated Linoleic Acid in Human Colon Cancer Cells." Biomol Ther (Seoul). 2015 Mar;23(2):134-40. doi: 10.4062/biomolther.2014.107. Epub 2015 Mar 1.
Miner JL, et al. "Conjugated linoleic acid (CLA), body fat, and apoptosis." Obes Res. 2001 Feb;9(2):129-34.
Moloney F, et al. "Antidiabetic effects of cis-9, trans-11-conjugated linoleic acid may be mediated via anti-inflammatory effects in white adipose tissue." Diabetes. 2007 Mar;56(3):574-82.
Smit LA, et al. "Conjugated linoleic acid in adipose tissue and risk of myocardial infarction." Am J Clin Nutr. 2010 Jul;92(1):34-40. doi: 10.3945/ajcn.2010.29524. Epub 2010 May 12.
Wahle KW, et al. "Conjugated linoleic acids: are they beneficial or detrimental to health?" Prog Lipid Res. 2004 Nov;43(6):553-87.
West DB, et al. "Conjugated linoleic acid persistently increases total energy expenditure in AKR/J mice without increasing uncoupling protein gene expression." J Nutr. 2000 Oct;130(10):2471-7.
Whigham LD, et al. "Efficacy of conjugated linoleic acid for reducing fat mass: a meta-analysis in humans." Am J Clin Nutr. 2007 May;85(5):1203-11.
Previous Post: « TPV Podcast, Episode 297: Is There a Connection Between Allergies & Baby Wipes?


OP: Google 'mirror neurons' - it's natural to mimic what you see, like wincing when someone gets punched in the balls or smiling when others are smiling. S'called being human. :) At least your brain's intact?
It's all right, when I watch them at home I find myself talking to my tv. Talk about a major FML moment.
Heyhey, the great hall atmosphere is awesome!
No. That's lame. You can't applaud fictional characters. I hope you were alone.
#6 she probably can. watch out.
nothing wrong with that. harry potter is amazing.


text:
Finance Act 2014
Income Tax, Corporation Tax and Capital Gains Tax
Farm taxation
20. Chapters 1 and 2 of Part 23 of the Principal Act are amended—
(a) in section 657—
(i) in subsection (1), in the definition of "an individual to whom subsection (1) applies", by substituting the following for "but paragraphs (b) and (d) shall not apply in a case where the wife of an individual is treated for tax purposes as not living with her husband, or the civil partner of an individual is treated for tax purposes as not living with his or her civil partner;":
(i) a reference to a trade in paragraphs (a) and (b) does not include a trade—
(I) which is ancillary to the trade of farming, and
(II) which is carried on by the individual or his or her spouse or civil partner on the farm land (within the meaning of section 664) used by the individual for the trade of farming,
(ii) paragraphs (b) and (d) shall not apply in a case where the wife of an individual is treated for tax purposes as not living with her husband, or the civil partner of an individual is treated for tax purposes as not living with his or her civil partner;",
(ii) in subsection (4)(b) by substituting "any of the 4" for "either of the 2",
(iii) by inserting the following after subsection (4):
"(4A) Where an individual was first charged to tax in accordance with subsection (5) for the year of assessment 2014, then the individual shall be charged to tax for the year of assessment 2015 in accordance with that subsection as if a reference in that subsection to 5 years was a reference to 4 years.",
(iv) in subsection (5) by substituting "5 years" for "3 years" in each place,
(v) by substituting the following for subsection (7):
"(7) Subject to subsection (7A), where for a year of assessment an individual is by virtue of subsection (6) chargeable to income tax in respect of profits or gains from farming in accordance with subsection (5) and the individual was so chargeable for each of the 5 years of assessment immediately preceding the year of assessment, he or she may, on including a claim in that behalf with the return required under Chapter 3 of Part 41A for the year of assessment, elect to be charged to tax for that year of assessment in accordance with Chapter 3 of Part 4; but where in the case of an individual subsection (6) does not apply for any year of assessment by reason of paragraph (b)(i) of that subsection, the individual shall be deemed to be entitled to elect and to have duly elected, as respects that year of assessment, in accordance with this subsection.",
(vi) by inserting the following after subsection (7):
"(7A) (a) Where as respects the year of assessment 2015 an individual duly elects or is deemed to have elected in accordance with subsection (7) that subsection shall be construed as if a reference to 5 years in that subsection was a reference to 3 years, and
(b) where as respects the year of assessment 2016 an individual duly elects or is deemed to have elected in accordance with subsection (7) that subsection shall be construed as if a reference to 5 years in that subsection was a reference to 4 years.",
(vii) in subsection (8) —
(I) by substituting the following for paragraph (b):
"(b) there shall be made such assessment or assessments, if any, as may be necessary to secure that the amount of profits or gains from farming on which the individual who, in respect of the year of assessment 2015 duly elects or is deemed to have elected in accordance with subsection (7) is charged for each of the years of assessment 2012 and 2013, shall be not less than the amount on which the individual was charged by virtue of subsection (6) in accordance with subsection (5) for the year of assessment 2014,",
(II) by inserting the following after paragraph (b):
"(c) notwithstanding section 959Z, there shall be made such assessment or assessments, if any, as may be necessary to secure that the amount of profits or gains from farming on which the individual, in the case of an individual referred to in subsection (4A), is charged to tax for each of the 3 years immediately preceding the year preceding the year of assessment as respects which the individual elects or is deemed to have elected in accordance with subsection (7), shall be not less than the amount on which the individual is charged by virtue of subsection (6) in accordance with subsection (5) for the preceding year of assessment, and
(d) in any other case, notwithstanding section 959Z, there shall be made such assessment or assessments, if any, as may be necessary to secure that the amount of profits or gains from farming on which the individual is charged to tax for each of the 4 years immediately preceding the year preceding the year of assessment as respects which the individual elects or is deemed to have elected in accordance with subsection (7), shall be not less than the amount on which the individual is charged by virtue of subsection (6) in accordance with subsection (5) for the preceding year of assessment.",
(viii) by substituting the following for subsection (11):
"(11) Where for any year of assessment a loss is aggregated with profits or gains in accordance with subsection (5)(b) and the amount of the loss is in excess of the profits or gains—
(a) in the case of an individual referred to in subsection (4A), one-quarter of the amount of such excess shall be deemed for the purposes of Chapter 1 of Part 12 to be a loss sustained in the trade of farming in the final year of the 4 years, and
(b) in any other case, one-fifth of the amount of such excess shall be deemed for the purposes of Chapter 1 of Part 12 to be a loss sustained in the trade of farming in the final year of the 5 years,
on the average of the profits or gains of which the individual is to be charged to tax for that year of assessment, and any loss so aggregated shall not be eligible for relief under any provision of the Income Tax Acts apart from this subsection.",
(b) in section 664(1)(a) —
(i) by substituting the following for the definition of "qualifying lessee":
"'qualifying lessee', in relation to a qualifying lessor or qualifying lessors, means, as the case may be—
(i) an individual who—
(I) is not connected with the qualifying lessor or with any of the qualifying lessors, and
(II) uses any farm land leased from the qualifying lessor or the qualifying lessors for the purpose of a trade of farming carried on solely or in partnership,
(ii) a company which—
(I) is not connected with the qualifying lessor or with any of the qualifying lessors,
(II) is not controlled either directly or indirectly by any person who is connected with the qualifying lessor or with any of the qualifying lessors, and
(III) uses any farm land leased from the qualifying lessor or the qualifying lessors for the purpose of a trade of farming carried on solely or in partnership;",
(ii) in the definition of "qualifying lessor" by deleting subparagraph (i),
(iii) in subparagraph (ii)(VIII) of the definition of "the specified amount" by substituting "in the period beginning on 1 January 2007 and ending on 31 December 2014" for "on or after 1 January 2007",
(iv) in the definition of "the specified amount" by inserting the following after subparagraph (ii)(VIII):
"(IX) on or after 1 January 2015—
(A) €40,000, in a case where the qualifying lease or qualifying leases is or are for a definite term of 15 years or more,
(B) €30,000, in a case where the qualifying lease or qualifying leases is or are for a definite term of 10 years or more, other than a case to which clause (A) applies,
(C) €22,500, in a case where the qualifying lease or qualifying leases is or are for a definite term of 7 years or more, other than a case to which either clause (A) or clause (B) applies, and
(D) €18,000, in any other case,",
(v) in subparagraph (iii) of the definition of "the specified amount" by substituting ", (VIII) or (IX)," for "or (VIII),",
(c) in section 664(1)(b) by substituting the following for subparagraph (vi):
"(vi) from a qualifying lease or qualifying leases made in the period beginning on 1 January 2007 and ending on 31 December 2014, and from a qualifying lease made before 1 January 2007, the specified amount shall not exceed—
(I) €20,000, in a case where the qualifying lease or qualifying leases is or are for a definite term of 10 years or more,
(II) €15,000, in a case where the qualifying lease or qualifying leases is or are for a definite term of 7 years or more, other than a case to which clause (I) applies, and
(III) €12,000, in any other case;
(vii) from a qualifying lease or qualifying leases made on or after 1 January 2015, and from a qualifying lease made at any other time, the specified amount shall not exceed—
(II) €30,000, in a case where the qualifying lease or qualifying leases is or are for a definite term of 10 years or more, other than a case to which clause (I) applies,
(III) €22,500, in a case where the qualifying lease or qualifying leases is or are for a definite term of 7 years or more, other than a case to which either clause (I) or clause (II) applies, and
(IV) €18,000, in any other case.",
(d) in section 667B, in paragraph 2 of the Table to that section:
(i) in subparagraph (p) by substituting "Applied Agriculture," for "Applied Agriculture.", and
(ii) by inserting the following after subparagraph (p):
"(q) Bachelor of Science (Honours) in Sustainable Agriculture.",
(e) in section 667C(3A) by substituting the following for paragraph (b):
"(b) Subject to paragraph (c), a specified person shall be entitled to relief in respect of relevant deductions of an amount not exceeding €7,500 in the aggregate in the qualifying period.
(c) In the case of a qualifying period commencing on or after 1 January 2014, a specified person shall be entitled to relief in respect of relevant deductions of an amount not exceeding €15,000 in the aggregate in that qualifying period.".

redpajama_set_name: RedPajamaCommonCrawl


Video is an all-powerful marketing tool, with many unexplored depths.
Discover the gravity and versatility of our hyper-focused expertise.
Our specialty is creating impactful video marketing campaigns with a unique, results-driven approach. Stay up to date on our latest insights, and learn the true value of strategic video marketing through our experiences.
Hit Me With Some Knowledge!


text:
Heinrich Ferdinand Julius von Westernhagen (* 26. Juni 1828 in Teistungen; † 7. April 1905 in Darmstadt) war ein preußischer Generalmajor.

Leben

Herkunft und Familie
Er stammte aus dem eichsfeldischen Uradelsgeschlecht von Westernhagen und war der Sohn des Lewin von Westernhagen auf Teistungen-Oberhof (1800–1870) und dessen Ehefrau Leopoldine, geborene Hofmann (1804–1888).

Er war zweimal verheiratet, in erster Ehe 1856 mit Johanna Frieß-Hasenkamp (1836–1860) und in zweiter 1862 mit Auguste Defoy (1835–1902). Von mehreren Kindern war sein Sohn Heinrich von Westernhagen (1864–1925) ebenfalls Generalmajor und kommandierte im Weltkrieg das Leibgarde-Infanterie-Regiment (1. Großherzoglich Hessisches) Nr. 115.

Werdegang
Westernhagen trat zu Beginn des Jahres 1846 als Füsilier in das 26. Infanterie-Regiment der preußischen Armee ein, wo er im September selbigen Jahres zum Portepeefähnrich und im September 1848 zum Sekondeleutnant avancierte. Er nahm dann am Feldzug in Baden, insbesondere den Gefechten bei Ubstadt, Durlach und Michelbach teil. Im Frühjahr 1851 war er für zwei Monate zur Gewehrfabrik in Sömmerda kommandiert. Im Dezember 1851 wurde er Adjutant des Füsilierbataillons. Er stieg 1857 zum Premierleutnant auf und wurde 1858 Kompanieführer beim II. Bataillon in Burg des 26. Landwehrregiments. 1859 wechselte in gleicher Funktion zum III. Bataillon in Neuhaldensleben. Mit seiner Beförderung zum Hauptmann im Jahre 1860 wurde er auch Kompaniechef im Infanterie-Regiment Nr. 26.

Im Deutschen Krieg nahm er am Gefecht bei Münchengrätz sowie der Schlacht bei Königgrätz, wo er verwundet wurde, teil und wurde im September 1866 mit dem Kronenorden IV. Klasse mit Schwertern ausgezeichnet. 1869 hat er den Charakter als Major erhalten und 1870 das Patent zum Dienstgrad, wobei er gleichzeitig Kommandeur des Ersatzbataillons wurde. Im September 1870 wurde er als Führer zum mobilen Regiment des Füsilierbataillons des Infanterie-Regiment Nr. 26 ernannt und nahm am Deutsch-Französischen Krieg, insbesondere der Belagerung von Paris und dem Gefecht bei Épinay teil. 1871 wurde er in das Regiment einrangiert und Kommandeur des Füsilierbataillons.

Westernhagen avancierte 1875 zum Oberstleutnant und 1879 zum Oberst. Ebenfalls im Jahr 1879 wurde er Kommandeur des Infanterie-Regiments Nr. 117. Er hat 1883 den Kronenorden II. Klasse mit Schwertern erhalten und wurde 1884 mit dem Charakter als Generalmajor mit Pension zur Disposition gestellt.

Literatur
 Genealogisches Taschenbuch der Uradeligen Häuser. 1915. Sechszehnter Jahrgang, Justus Perthes, Gotha 1914, S. 801; 41. Jg., 1940, S. 636.
 Kurt von Priesdorff: Soldatisches Führertum. Band 10, Hanseatische Verlagsanstalt Hamburg, o. O. [Hamburg], o. J. [1942], , S. 258–260, Nr. 3203.

Generalmajor (Königreich Preußen)
Person (Landkreis Eichsfeld)
Person im Deutschen Krieg
Person im Deutsch-Französischen Krieg
Träger des Preußischen Königlichen Kronenordens 2. Klasse
Infanterist (Preußen)
Julius
Deutscher
Geboren 1828
Gestorben 1905
Mann

redpajama_set_name: RedPajamaWikipedia


Decades after "Twin Peaks" premiered, we still ache to wrap ourselves in its world. The Black Lodge Gifts in south Minneapolis helps us do just that.
Artist and owner Nancy Waller poses for portraits at the Black Lodge gift shop on Tuesday, March 6. The shop is themed after David Lynch's television show "Twin Peaks."
Startling window shoppers with a blue-lipped and gold-eyed Laura Palmer mannequin in the window, "Black Lodge Gifts" features a number of Lynchian favorites. The floors are a hand-painted black and white chevron, the walls are covered in red fabric and the "Fire Walk With Me" soundtrack is on repeat.
Waller mans the store in costume (she's done 11 characters so far). Besides posing for photo-ops and reciting scenes from a hand-copied script, she sells homemade plush logs, donuts (with sequin sprinkles) and cherry pie slices to visitors. They fly off the shelf.
A recreation of the fictional town of Twin Peaks' welcome sign stands outside Nancy Waller's Black Lodge, a shop dedicated to David Lynch's series centered around the town.
Anything Lynchian is bound to spark questions, but the success of this pop-up carries a big one.
Why, decades after its inspiration originally premiered and months after the reboot, is this little shop bustling?
It may have something to do with the shop offering a "real-world experience." It's something live tweets and fan message boards can't afford us. Add to that the connection people feel to the show — a deep rooted affinity for all those weirdo Pacific Northwest residents — and you have yourself a hit.
Alex Arnold, a recent University of Minnesota graduate, started watching the show during the winter of his senior year in 2016.
"It was so good. The tone, story, imagery. It's hard to overstate how good I thought it was," Arnold said.
Artist and owner Nancy Waller poses for portraits at the Black Lodge gift shop on Tuesday, March 6. The shop serves as a hub for fans of David Lynch's "Twin Peaks" to meet and analyze the show over coffee and cherry pie.
He watched the whole thing. And then he watched the reboot.
No matter how much he's binged since then, Arnold is still eager to talk about the show — just like the other people who visit Waller's Lodge every day.
Last Friday, patrons included college students who first learned of the show as tweens reading Tavi Gevinson editorials, babies whose parents were searching for a good photo-op and Gary, a new grandfather and longtime fan who just happened to hear about the store during a quick visit to Minneapolis.
Working the one-person operation day after day, Waller isn't sure how long she'll keep the pop-up open. As she says, constant cosplaying might be bad for your health.
But it's here for now. And it proves that David Lynch — though he is the inspiration for this one — isn't the only person who can design a universe.
The shop does feel like a child's game of pretend come true, a glass box in Manhattan or a less consumer-based Wizarding World of Harry Potter.
But it's better. It's hard to explain, but there's more dreaminess to it.


Vibrant and complex aromas of spicy, red berry fruit, cinnamon and clove spice. The same abundant, vibrant fruit is refl ected on the palate which also shows a hint of licorice, sweet cinnamon spice, and subtle cedary French oak.
Separate parcels of fruit were fermented in American oak barriques and roto fermenters. The wine aged in new and seasoned French and American oak hogsheads.
Most of the grapes came from the Coonawarra regions of South Australia's Limestone Coast. These regions are famous for outcrops of red soil that lie above a hard layer of coastal limestone.


text:
Q: jQuery Formula posts 'NaN' although each value is cast I have a table produced dynamically with each row producing something like this:

  January
  <input type="text" name="LIB1" value="0" class="oneInput row0" />
  <input type="text" name="RPI1" value="0" class="oneInput row0" />
  <input type="text" name="LMM1" value="0" class="oneInput row0" />
  0

I need to put the total of each input in the row in the last column when a value is input. Therefore, I placed this function in the document.ready function
$(".oneInput").live('blur', function(){
 var rowID = $(this).parent().parent().attr( 'name' );
 var thisLIB = $("input[name=LIB + rowID]" ).val();
 var thisRPI = $("input[name=RPI + rowID]").val();
 var thisLMM = $("input[name=LMM + rowID]").val();
 var rowTotal = parseFloat(thisLIB) + parseFloat(thisRPI) + parseFloat(thisLMM);
 $(this).parent().parent().find( 'span.screenOneTotal').empty().html( parseFloat(rowTotal) );
});

Despite the fact that I am explicitly casting each value to a float, the value inserted into the last column is "NaN".

A: $("input[name=LIB + rowID]" ).val() does not look right.
Did you mean $("input[name=LIB" + rowID + "]" ).val()?

If your selector fails, then .val() is empty and parseFloat will give you NaN.

A: In addition to Tomalak's answer, an attribute selector should also be enclosed in quotes.  Your example also shows that the row's name attribute is 0 but its children are LIB1, LPT1 and LMM1 so they need to be under a row with name='1'
var thisLIB = $("input[name='LIB" + rowID+"']" ).val();

A: I think you're overcomplicating things (and undercomplicating them at the same time). Your over-complication is that you're looking for three specific things and treating them individually when you could just grab everything that fits a certain pattern and treat them as a group. Your under-complication is that you're not considering failure conditions from parseFloat and the odd (until you're used to it) behavior of NaN.
I think you'd be better off going up the DOM to find the containing
 and the iterating through all the .oneInput elements in that row, then you can use one small chunk of code to convert the string values to sensible numbers the same way:
$(".oneInput").live('blur', function() {
    var $row     = $(this).closest('tr');
    var rowTotal = 0;
    $row.find('input.oneInput').each(function() {
        var n = parseFloat(this.value);
        if(!isNaN(n))
            rowTotal += n;
    });
    // Do whatever you need to do with rowTotal
});

The closest call will go up the DOM to find the containing
, then the find will get all the <input> elements in that row that have a class of oneInput, then loop over those with each, extract each value straight from the <input> DOM element with parseFloat, and add them to a running total in rowTotal if parseFloat finds a number (and isNaN is the what you want to check if parseFloat handed you a NaN).
Something like this: http://jsfiddle.net/ambiguous/DBQL3/


How can I study brain penetration of an drug using invivo animal model?
There are various ways you could do invivo brain pemeability studies.
brain perfusion by Quentin Smith.
chromatography.J Chromatogr A. 2003 Feb 14;987(1-2):277-82.
Vivo Techniques. J Pharmacol Exp Ther. 2003 Sep 9 [Epub ahead of print].
response to a recent inquiry.
crossing of BBB and distribution?
homogenizing may be your own".
are autoradiograms of brain amygdala and in spinal cord anterior horn.


text:
Commemorative T-shirt to benefit Pat Summitt Foundation
The Pat Summitt Foundation on Friday will begin selling a commemorative T-shirt in retail stores across the state and on the foundation's website - patsummitt.org - to honor Summitt's life and raise money for the fight against Alzheimer's disease.
Commemorative T-shirt to benefit Pat Summitt Foundation The Pat Summitt Foundation on Friday will begin selling a commemorative T-shirt in retail stores across the state and on the foundation's website - patsummitt.org - to honor Summitt's life and raise money for the fight against Alzheimer's disease. Check out this story on knoxnews.com: https://www.knoxnews.com/story/sports/college/university-of-tennessee/womens-sports/2016/06/30/commemorative-tshirt-to-benefit-pat-summitt-foundation/91018338/
the Knoxville News Sentinel Published 5:30 p.m. ET June 30, 2016
The Pat Summitt Foundation with Bacon & Co. of Knoxville have produced a memorial T-shirt honoring the life and career of Pat Summitt. The Foundation's shirt is the only one authorized to use her name and image for this purpose since her death. Most of the proceeds from the sale of the shirts will go to her foundation.
The Pat Summitt Foundation on Friday will begin selling a commemorative T-shirt in retail stores across the state and on the foundation's website — patsummitt.org — to honor Summitt's life and raise money for the fight against Alzheimer's disease.
'Almost' 100 percent of proceeds from shirt sales will go to the Pat Summitt Foundation, according to a news release.
The orange shirt, which won't be unveiled until Friday, depicts Summitt reaching toward the statue of herself that sits at Pat Summitt Plaza on Tennessee's campus. The illustration also includes the Knoxville skyline, colored in Lady Vols blue, and Summitt's signature.
(In addition to being available at retail outlets statewide and from the foundation website, you can order the T-shirt here. Short-sleeve, long-sleeve and youth short-sleeve styles are available.)
The T-shirt will be available for a limited time only.
'We're excited to be able to make this commemorative shirt to honor our founder Pat Summitt,' foundation executive director Patrick Wade said in a release.
' … All proceeds will benefit our campaign commitment to the Pat Summitt Alzheimer's Clinic which will open at The University of Tennessee Medical Center in Knoxville late this year.'
Summitt died Tuesday at age 64, five years after being diagnosed with early onset Alzheimer's disease. She won eight national championships and 1,098 games during her 38-year career, which ended in April 2012.
The Pat Summitt Foundation, a Fund of East Tennessee Foundation, was established by Summitt in November 2011. Dedicated to winning the fight against Alzheimer's disease, its mission is to award grants to exemplary nonprofit organizations that advance research for treatment and a cure, provide support for patients and caregivers, and educate the public.
In January 2015, The Pat Summitt Foundation formed a strategic partnership with the University of Tennessee Medical Center to create The Pat Summitt Alzheimer's Clinic.
Grant Ramey covers Tennessee men's basketball. Follow him at twitter.com/GrantRamey


A NEW facility at the Royal Observatory, Greenwich (ROG) is to be named after Strabane's most famous scientist, Annie Maunder.
Announced last month, the move comes after it was revealed that the ROG is to start studying the sky again after a break of 60 years.
British astronomy's historic home has installed new state-of-the-art telescopes in Altazimuth Pavilion, which has also undergone a restoration. And it is this new facility which will be named after Maunder, one of the first female scientists to work at the ROG.
In the past few decades, stargazing has moved out of urban areas where you can get darker skies. However a combination of new technology and cleaner air means that astronomers will be able to use the Royal Observatory Greenwich again.
Working alongside her husband Edward Walter Maunder, she is known the world over for her recording of the dark sun spots which pepper the sun.
Today, she has a crater on the far side of the moon named in her honour.
The ground floor of the Altazimuth Pavilion will also have an exhibition space, with a section dedicated to telling the story of Annie Maunder.


text:
Q: Powershell merge two tables with good performance I have two tables each originating from seperate SQL-queries. The first one E has 7 columns and the second S has 3. The first column is the identifier. I want to include the values from S into E so that I can run an alogrithm for each row and export all values in one csv.
With now 2600 rows the matching takes ~4-5 minutes. Is there a more efficient way to do this? I want to be able to run the script very regularly and for more than 10,000 entries.
foreach($row in $E){
    $ID = $row.ID
    $mS = $S | ?{ $_.ID -match ("^"+$ID+"$")}
    $value1 = $mS.value1
    $value2 = $mS.value2
    $row.value1 = $value1
    $row.value2 = $value2
}


Picture this: a family-owned business dating back to the Civil War era, responsible for a sauce so iconic you may very well have put it on your eggs this morning (or used its byproducts in everyday first-aid products like Ben-Gay). Forget apple pie—Tabasco sauce is a distinctly all-American food, with a fascinating history and a touch of the antebellum South in every bottle.
The McIlhenny Company and just over 200 employees make Tabasco on Avery Island, Louisiana. The names McIlhenny (as in the sauce's inventor, Edmund McIlhenny) and Avery (Judge Avery, McIlhenny's father-in-law) are on every bottle, belying the stalwart ties every bottle has to the bayou country from which it comes.
Each bottle of sauce passes through the Avery Island production facility, under the watchful eyes of "the family," as they're called. Every morning, CEO Tony Simmons or Senior Vice President Harold "Took" Osborn, the two family members currently working for the company, must approve the 180 barrels of mashed, aged peppers going into production that day.
Both Simmons, who took over as company head after the death of his cousin, Paul McIlhenny, earlier this year, and Osborn are great-great-grandsons of Edmund McIlhenny. Only those related to the original Averys and McIlhennys can approve the barrels. Only family members can own land on the island (though there is subsidized housing leased to employees). And only family members or those who they have given shares to can own any part of the company itself.
In some ways, it's novel: a large brand that's still bound by such strong family ties. In others, it's a little tightly wound: a conversation with Simmons revealed a Godfather-esque oversight of all young family members to see which ones would or would not be future-executive material.
The family backstory, now kept by the company's full-time historian, goes back to the pre-Civil War era, when the Averys settled on the island. It was here that Edmund McIlhenny developed the recipe for the pepper sauce that is still followed today. But the island today produces more bottles every day than McIlhenny made in his entire life. While the aging time has extended from 30 days in stone jars to three years in used bourbon barrels, but the mashed pepper to salt to vinegar ratios remain virtually unchanged.
Where Edmund McIlhenny first found the peppers is still a mystery, but the same pepper (Capsicum frutescens variety tabasco)—and only that pepper — is still used today. In fact, since the peppers are not grown commercially by anyone else, there is no funding for research on increasing yield of the plant, disease prevention for it, or a mechanized picking procedure.
The company does some of their own research and development on Avery Island, not always successfully: for example, a prototype machine currently stationed in the fields proved unable to match the peppers to the precise shade of red they must be before getting picked. As a result, all of the peppers are hand-picked, with employees checking the hue of the plant against a colored stick.
Luckily for fans of the sauce, the one part of the Tabasco puzzle that doesn't come directly from the island is the peppers themselves. Tabasco manages pepper farms throughout Latin America and a few in Africa, where peppers are grown and picked to spec before being sent to the production facility.
And then what happens? Check out the slide show to see how Tabasco sauce is made!


text:
Rams News: Bobby Wagner Advocates Against Potential Rule Change Of Ejecting Players For Illegal Hits
Rams News: Matthew Stafford Was On Headset Communicating With Baker Mayfield Against Raiders
The NFL, like every major professional sports league, has continually looked to change or improve existing rules in order to make a better product for fans.
Player safety is always at the forefront of these changes, as evidenced by the league's recent emphasis on how concussions are handled. In relation to concussions, the NFL has also recently discussed implementing changes to illegal hits including roughing the passer calls.
NFL executive Troy Vincent said at the league's annual meeting that the competition committee would consider making roughing the passer calls reviewable and in turn potentially ejecting offending players. Word of the potential rule change was met with mixed reviews especially from Los Angeles Rams linebacker Bobby Wagner who voiced his opinion via his Twitter account:
NFL does not need to eject players for hits like college. That's why I stopped watching college.
— Bobby Wagner (@Bwagz) December 14, 2022
Wagner knows a thing or two about tackles as he is one of the NFL's most renowned enforcers in the middle of the field. From Wagner's point of view, there's nothing wrong with the current rule where players are assessed a foul and the offense is rewarded a free first down.
Roughing the passer calls have drawn the ire of fans in recent years as it has resulted in some very questionable calls that have swung the tides of games. It's understandable that the league would like to protect quarterbacks from serious injury, but it's arguably gone too far in their favor as pass rushers are given even less leeway to make hits despite clean technique.
For the time being, the current rules will be in place as any changes would need to be voted on at the league meeting next offseason. Between now and then, expect more players like Wagner to come out and weigh in on the topic.
Bobby Wagner moves to 10th all-time in tackles
While the Rams' 2022 season has gone down the drain due to numerous injuries and inconsistent play, Wagner has been one of the team's lone bright spots. Despite being in his first year with Los Angeles and having to learn a new scheme, Wagner remained as dominant as ever for the defense.
In the win against the Las Vegas Raiders, Wagner recorded 14 tackles (six solo). It was a gutty performance from Wagner, and in the process he moved to 10th all-time in tackles as well as recorded his 11th consecutive season recording over 100 tackles.