\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\selectlanguage{english}

\usepackage[colorlinks=true, citecolor=blue, 
  linkcolor=blue, urlcolor=blue,
  bookmarksopen=false, pdfpagemode=UseOutlines]{hyperref}

\usepackage{Sweave}

\renewcommand{\baselinestretch}{1.3}

\topmargin -1.3cm
\textheight 24cm
\textwidth 15.5cm
\oddsidemargin -0.5cm
\evensidemargin 0.0cm

\title{\textsf{R} Package \textsf{stsm}}
\author{Javier L\'opez-de-Lacalle}
\date{January 2015}

\begin{document}

%\VignetteIndexEntry{stsm-intro}
%\VignetteKeyword{R, structural time series model}
%\VignetteDepends{stsm}

\maketitle

\abstract{
This is a minimal introduction to package \textsf{stsm}. 
Further information is available in the references given below.
}

\section{Introduction}

The example below fits the basic structural time series model 
to the airlines passengers data.

<<>>=
library("stsm")
m <- stsm.model(model = "BSM", y = log(AirPassengers), transPars = "StructTS")
res <- maxlik.td.optim(m = m, KF.args = list(P0cov = TRUE), method = "L-BFGS-B")
round(get.pars(res$model) * 10000, 3)
@
%#   var1   var2   var3   var4 
%#  0.000  7.719  0.000 13.969 

Details about the methodology and algorithms implemented in the package are 
given \href{http://www.jalobe.com/doc/stsm.pdf}{in this document}.

As a preliminary introduction and discussion see these posts:
\href{http://www.jalobe.com/blog/optimization-algorithms-to-fit-a-structural-time-series-model/}{%
optimization algorithms to fit a structural time seriesmodel} and 
\href{http://www.jalobe.com/blog/variations-on-a-maximum-likelihood-procedure/}{%
variations on a maximum likelihood procedure}.

\end{document}
