1\name{plot.efp}
2\alias{plot.efp}
3\alias{lines.efp}
4\encoding{latin1}
5\title{Plot Empirical Fluctuation Process}
6\description{Plot and lines method for objects of class \code{"efp"}}
7\usage{
8\method{plot}{efp}(x, alpha = 0.05, alt.boundary = FALSE, boundary = TRUE,
9    functional = "max", main = NULL,  ylim = NULL,
10    ylab = "Empirical fluctuation process", ...)
11\method{lines}{efp}(x, functional = "max", ...)
12}
13
14\arguments{
15  \item{x}{an object of class \code{"efp"}.}
16  \item{alpha}{numeric from interval (0,1) indicating the confidence level for
17     which the boundary of the corresponding test will be computed.}
18  \item{alt.boundary}{logical. If set to \code{TRUE} alternative boundaries
19     (instead of the standard linear boundaries) will be plotted (for CUSUM
20     processes only).}
21  \item{boundary}{logical. If set to \code{FALSE} the boundary will be computed
22     but not plotted.}
23  \item{functional}{indicates which functional should be applied to the
24     process before plotting and which boundaries should be used. If set to \code{NULL}
25     a multiple process with boundaries for the \code{"max"} functional is plotted.
26     For more details see below.}
27  \item{main, ylim, ylab, ...}{high-level \code{\link{plot}} function
28 parameters.}
29}
30
31\details{Plots are available for the \code{"max"} functional for all process types.
32For Brownian bridge type processes the maximum or mean squared Euclidean norm
33(\code{"maxL2"} and \code{"meanL2"}) can be used for aggregating before plotting.
34No plots are available for the \code{"range"} functional.
35
36Alternative boundaries that are proportional to the standard deviation
37of the corresponding limiting process are available for processes with Brownian
38motion or Brownian bridge limiting processes.
39}
40
41\value{\code{\link{efp}} returns an object of class \code{"efp"} which inherits
42from the class \code{"ts"} or \code{"mts"} respectively. The function
43\code{\link{plot}} has a method to plot the
44empirical fluctuation process; with \code{sctest} the corresponding test for
45structural change can be performed.}
46
47\references{Brown R.L., Durbin J., Evans J.M. (1975), Techniques for
48testing constancy of regression relationships over time, \emph{Journal of the
49Royal Statistical Society}, B, \bold{37}, 149-163.
50
51Chu C.-S., Hornik K., Kuan C.-M. (1995), MOSUM tests for parameter
52constancy, \emph{Biometrika}, \bold{82}, 603-617.
53
54Chu C.-S., Hornik K., Kuan C.-M. (1995), The moving-estimates test for
55parameter stability, \emph{Econometric Theory}, \bold{11}, 669-720.
56
57Kr�mer W., Ploberger W., Alt R. (1988), Testing for structural change in
58dynamic models, \emph{Econometrica}, \bold{56}, 1355-1369.
59
60Kuan C.-M., Hornik K. (1995), The generalized fluctuation test: A
61unifying view, \emph{Econometric Reviews}, \bold{14}, 135 - 161.
62
63Kuan C.-M., Chen (1994), Implementing the fluctuation and moving estimates
64tests in dynamic econometric models, \emph{Economics Letters}, \bold{44},
65235-239.
66
67Ploberger W., Kr�mer W. (1992), The CUSUM test with OLS residuals,
68\emph{Econometrica}, \bold{60}, 271-285.
69
70Zeileis A., Leisch F., Hornik K., Kleiber C. (2002), \code{strucchange}:
71An R Package for Testing for Structural Change in Linear Regression Models,
72\emph{Journal of Statistical Software}, \bold{7}(2), 1-38.
73URL \url{http://www.jstatsoft.org/v07/i02/}.
74
75Zeileis A. (2004), Alternative Boundaries for CUSUM Tests,
76\emph{Statistical Papers}, \bold{45}, 123--131.
77}
78
79\seealso{\code{\link{efp}}, \code{\link{boundary.efp}},
80\code{\link{sctest.efp}}}
81
82\examples{
83## Load dataset "nhtemp" with average yearly temperatures in New Haven
84data("nhtemp")
85## plot the data
86plot(nhtemp)
87
88## test the model null hypothesis that the average temperature remains
89## constant over the years
90## compute Rec-CUSUM fluctuation process
91temp.cus <- efp(nhtemp ~ 1)
92## plot the process
93plot(temp.cus, alpha = 0.01)
94## and calculate the test statistic
95sctest(temp.cus)
96
97## compute (recursive estimates) fluctuation process
98## with an additional linear trend regressor
99lin.trend <- 1:60
100temp.me <- efp(nhtemp ~ lin.trend, type = "fluctuation")
101## plot the bivariate process
102plot(temp.me, functional = NULL)
103## and perform the corresponding test
104sctest(temp.me)
105}
106\keyword{hplot}
107