Last data update: 2014.03.03

R: Functions for asymptotic theory of Forward Search
ForwardSearch.pointwise.asymptoticsR Documentation

Functions for asymptotic theory of Forward Search

Description

Computes functions appearing in asymptotic theory of Forward Search based on Johansen and Nielsen (2013).

Usage

ForwardSearch.pointwise.asymptotics(psi, ref.dist = "normal")

Arguments

psi

Number or vector. Takes value(s) in interval 0,1.

ref.dist

Character. Reference distribution

"normal"

Standard normal distribution

Details

The asymptotic theory is developed in Johansen and Nielsen (2013), see Section 2.2.

c and ψ are linked through P(|ε|<c)=ψ, where ε is a random variable with the chosen reference distribution.

ζ is a consistency factor. Its square is defined as the truncated second moment τ = int_{-c}^{c} x^2 f(x) dx divided by ψ.

varpi is the asymptotic standard deviation resulting from Theorem 3.3.

Value

varpi

Number or vector. sdv for forward residuals normalized by variance estimator and multiplied by twice the reference densisty.

zeta

Number or vector. Consistency correction factor.

sdv.unbiased

Number or vector. varpi/2/f.

sdv.biased

Number or vector. varpi/2/f/zeta.

c

Number or vector. c (median in unbiased case).

median.biased

Number or vector. median (in biased case).

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.

Examples

#####################
#	EXAMPLE 1
#	Suppose n=100. Get asymptotic values for grid psi = (1, ... ,n)/n

n	<- 100
psi	<- seq(1,n-1)/n
FS	<- ForwardSearch.pointwise.asymptotics(psi)

#	Plot for biased normalisation
#	- matching choice of Atkinson and Riani (2000)

main <- "Pointwise confidence bands for n=100\n Biased normalisation"
ylab <-	"forward residual asymptotics"
 plot(psi,FS$median.biased,ylim=c(0,3),ylab=ylab,main=main,type="l")
lines(psi,FS$median.biased-2*FS$sdv.biased/sqrt(n))
lines(psi,FS$median.biased+2*FS$sdv.biased/sqrt(n))

#	Plot for unbiased normalisation

main <- "Pointwise confidence bands for n=100\n Unbiased normalisation"
ylab <-	"forward residual asymptotics"
 plot(psi,FS$c,ylim=c(0,3),ylab=ylab,main=main,type="l")
lines(psi,FS$c-2*FS$sdv.unbiased/sqrt(n))
lines(psi,FS$c+2*FS$sdv.unbiased/sqrt(n))

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.pointwise.asymptotics.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ForwardSearch.pointwise.asymptotics
> ### Title: Functions for asymptotic theory of Forward Search
> ### Aliases: ForwardSearch.pointwise.asymptotics
> 
> ### ** Examples
> 
> #####################
> #	EXAMPLE 1
> #	Suppose n=100. Get asymptotic values for grid psi = (1, ... ,n)/n
> 
> n	<- 100
> psi	<- seq(1,n-1)/n
> FS	<- ForwardSearch.pointwise.asymptotics(psi)
> 
> #	Plot for biased normalisation
> #	- matching choice of Atkinson and Riani (2000)
> 
> main <- "Pointwise confidence bands for n=100\n Biased normalisation"
> ylab <-	"forward residual asymptotics"
>  plot(psi,FS$median.biased,ylim=c(0,3),ylab=ylab,main=main,type="l")
> lines(psi,FS$median.biased-2*FS$sdv.biased/sqrt(n))
> lines(psi,FS$median.biased+2*FS$sdv.biased/sqrt(n))
> 
> #	Plot for unbiased normalisation
> 
> main <- "Pointwise confidence bands for n=100\n Unbiased normalisation"
> ylab <-	"forward residual asymptotics"
>  plot(psi,FS$c,ylim=c(0,3),ylab=ylab,main=main,type="l")
> lines(psi,FS$c-2*FS$sdv.unbiased/sqrt(n))
> lines(psi,FS$c+2*FS$sdv.unbiased/sqrt(n))
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>