Last data update: 2014.03.03

R: Plots forward residuals with simultaneous confidence bands
ForwardSearch.plotR Documentation

Plots forward residuals with simultaneous confidence bands

Description

Plots forward residuals with simultaneous confidence bands based on Johansen and Nielsen (2013, 2014).

Usage

ForwardSearch.plot(FS, ref.dist = "normal",
	bias.correct = FALSE, return = FALSE, plot.legend = TRUE,
	col = NULL, legend = NULL, lty = NULL, lwd = NULL,
	main = NULL, type = NULL, xlab = NULL, ylab = NULL)

Arguments

FS

List. Value of the function ForwardSearch.fit.

ref.dist

Character. Reference distribution.

"normal"

standard normal distribution.

bias.correct

Logical. If FALSE do not bias correct variance, so plots have appearance similar to Atkinson and Riani (2000). If TRUE do bias correct variance, so plots start at origin. Default is FALSE.

return

Logical. Default is FALSE: do not return values.

plot.legend

Logical. Default is TRUE: include legend in plot.

col

plot parameter. Vector of 6 colours.

legend

plot parameter. Vector of 6 characters.

lty

plot parameter. Vector of 6 line types.

lwd

plot parameter. Vector of 6 line widths.

main

plot parameter. Character.

type

plot parameter. Charcater for plot type.

xlab

plot parameter. Charcater for x label.

ylab

plot parameter. Charcater for y label.

Value

ref.dist

Character. From argument.

bias.correct

Logical. From argument.

forward.residual.scaled

Vector. Forward residuals scaled by estimated variance. The estimated variance is or is not bias corrected depending on the choice of bias.correct.

forward.asymp.median

Vector. Asymptotic median.

forward.asymp.sdv

Vector. Asymptotic standard deviation. Not divided by squareroot of sample size.

cut.off

Matrix. Cut-offs taken from Table 3 of Johansen and Nielsen (2014).

Author(s)

Bent Nielsen <bent.nielsen@nuffield.ox.ac.uk> 9 Sep 2014

References

Johansen, S. and Nielsen, B. (2013) Asymptotic analysis of the Forward Search. Download: Nuffield DP.

Johansen, S. and Nielsen, B. (2014) Outlier detection algorithms for least squares time series. Download: Nuffield DP.

Examples

#####################
#	EXAMPLE 1
#	using Fulton Fish data,
#	see Johansen and Nielsen (2014).

#	Call package
library(ForwardSearch)

#	Call data
data(Fulton)
mdata	<- as.matrix(Fulton)
n		<- nrow(mdata)

#	Identify variable to reproduce Johansen and Nielsen (2014)
q		<- mdata[2:n		,9]
q_1		<- mdata[1:(n-1) ,9]
s		<- mdata[2:n		,6]
x.q.s	<- cbind(q_1,s)
colnames(x.q.s	)	<- c("q_1","stormy")

#	Fit Forward Search
FS95	<- ForwardSearch.fit(x.q.s,q,psi.0=0.95)

ForwardSearch.plot(FS95)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ForwardSearch)
Loading required package: robustbase
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ForwardSearch/ForwardSearch.plot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ForwardSearch.plot
> ### Title: Plots forward residuals with simultaneous confidence bands
> ### Aliases: ForwardSearch.plot
> 
> ### ** Examples
> 
> #####################
> #	EXAMPLE 1
> #	using Fulton Fish data,
> #	see Johansen and Nielsen (2014).
> 
> #	Call package
> library(ForwardSearch)
> 
> #	Call data
> data(Fulton)
> mdata	<- as.matrix(Fulton)
> n		<- nrow(mdata)
> 
> #	Identify variable to reproduce Johansen and Nielsen (2014)
> q		<- mdata[2:n		,9]
> q_1		<- mdata[1:(n-1) ,9]
> s		<- mdata[2:n		,6]
> x.q.s	<- cbind(q_1,s)
> colnames(x.q.s	)	<- c("q_1","stormy")
> 
> #	Fit Forward Search
> FS95	<- ForwardSearch.fit(x.q.s,q,psi.0=0.95)
> 
> ForwardSearch.plot(FS95)
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>