Learn R Programming

ForwardSearch (version 1.0)

ForwardSearch.stopped: Forward estimators after m steps

Description

A Forward Search gives a sequence of regression estimators. This function gives the regression estimators when stopped at m.

Usage

ForwardSearch.stopped(FS, m)

Arguments

FS
List. Value of the function ForwardSearch.fit.
m
Integer. Stopping time.

Value

ranks.selected
Vector. Ranks of m observations in the selected set.
ranks.outliers
Vector. Ranks of n-m observations that are not selected. These are the "outliers". It is the complement to ranks.selected.
beta.m
Vector. Least squares estimator based on ranks.selected.
sigma2.biased Scalar.
Scalar. Least squares residual variance based on ranks.selected. Value is *not* bias corrected.

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

Run this code
#####################
#	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.stopped(FS95,107)

Run the code above in your browser using DataLab