Among many strategies for financial trading, pairs trading has been playing an important role
in practical and academic frameworks. Loosely speaking, it consists of a statistical arbitrage
tool for identifying and exploiting ineficiencies of two long-term related financial assets. When
a signficant deviation from this equilibrium is observed, a profit might result. In this work,
we propose a pairs trading strategy entirely based on linear state space models designed for
modeling the spread formed with a pair of assets. Once an adequate state space model for
the spread is estimated, we calculate conditional probabilities that the spread will return to its
long-term mean. The strategy is activated upon large values of these conditional probabilities:
if the latter become large, the spread is bought or sold accordingly. Three applications with
real data from the US and Brazilian markets are offered and indicate that a very basic portfolio
consisting on a sole spread already outperforms some of the main market benchmarks.