\HeaderA{fxlm}{Exchange Rate Regression}{fxlm}
\aliasA{bread.fxlm}{fxlm}{bread.fxlm}
\aliasA{coef.fxlm}{fxlm}{coef.fxlm}
\aliasA{estfun.fxlm}{fxlm}{estfun.fxlm}
\aliasA{index.fxlm}{fxlm}{index.fxlm}
\aliasA{time.fxlm}{fxlm}{time.fxlm}
\keyword{regression}{fxlm}
\begin{Description}\relax
Interface to \code{\LinkA{lm}{lm}} for fitting exchange rate regression
models (Frankel-Wei models).
\end{Description}
\begin{Usage}
\begin{verbatim}
  fxlm(formula, data, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{formula}] a \code{"formula"} describing the linear model to be fit.
For details see below.
\item[\code{data}] a \code{"zoo"} time series.
\item[\code{...}] arguments passed to \code{\LinkA{lm}{lm}}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{fxlm} is a function for fitting exchange rate regression models also
known as Frankel-Wei models. It is a simple convenience interface to \code{lm}:
\code{data} is assumed to be a \code{"zoo"} series in which, by default, the
first column is the dependent variable. If \code{formula} is omitted, the first
column is regressed on the remaining columns in \code{data}. The main difference
compared to plain \code{lm} models is that the error variance is reported as
a full parameter (estimated by maximum likelihood) in the \code{coef} method
and the \code{estfun} method (but currently not in the \code{\LinkA{vcov}{vcov}} method). 
Furthermore, the index (also known as the time stamps) of the underlying data set
can be extracted by the \code{time}/\code{index} method.
\end{Details}
\begin{Value}
An object of class \code{"fxlm"} inheriting from \code{"lm"}.
\end{Value}
\begin{References}\relax
Shah A., Zeileis A., Patnaik I. (2005), What is the New Chinese
Currency Regime?, Report 23, Department of Statistics and Mathematics,
Wirtschaftsuniversitaet Wien, Research Report Series, November 2005.

Zeileis A., Shah A., Patnaik I. (2008), Testing, Monitoring, and Dating Structural
Changes in Maximum Likelihood Models, Report 70, Department of Statistics
and Mathematics, Wirtschaftsuniversitaet Wien, Research Report Series,
August 2008.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{lm}{lm}}, \code{\LinkA{fxregimes}{fxregimes}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## load package and data
library("fxregime")
data("FXRatesCHF", package = "fxregime")

## compute returns for CNY (and explanatory currencies)
## for one year after abolishing fixed USD regime
cny <- fxreturns("CNY", frequency = "daily",
  start = as.Date("2005-07-25"), end = as.Date("2006-07-24"),
  other = c("USD", "JPY", "EUR", "GBP"))

## estimate full-sample exchange rate regression
fm <- fxlm(CNY ~ USD + JPY + EUR + GBP, data = cny)
coef(fm)
summary(fm)

## test parameter stability (with double max test)
scus <- gefp(fm, fit = NULL)
plot(scus, aggregate = FALSE)
## which shows a clear increase in the variance in March 2006

## alternative tests: Andrews' supLM ...
plot(scus, functional = supLM(0.1))
## ... or Nyblom-Hansen test (Cramer-von Mises type test)
plot(scus, functional = meanL2BB)
\end{ExampleCode}
\end{Examples}

