Description Usage Arguments Details Value Author(s) References Examples
View source: R/ForwardSearch.r
Execute the Forward Search Algorithm. Based on Johansen & Nielsen (2013).
1 | ForwardSearch.fit(x.1, y, psi.0 = 0.5, m.0 = NULL, beta.0 = NULL)
|
x.1 |
Matrix of dimension n x (dim.x -1). Design matrix for regressors apart from constant. |
y |
Vector of dimension n. Dependent variable. |
psi.0 |
proportion of observations in initial set of set of selected observations.
Default is 0.5.
Initial set has |
m.0 |
Number of observations in initial set of selected observations.
Default is NULL.
If value is given this overrides |
beta.0 |
Vector of dimension dim.x.
Initial estimator for regression coefficient.
Default is NULL, which results in Least Trimmed Squares estimator
through |
Dimensions: n is the number of observations. dim.x is the number of regressors (including intercept).
Default is initial estimator is the Least Trimmed Squares estimator of
Rousseeuw (1984)
implemented as ltsReg
in package robustbase
.
The breakdown point of the initial Least Trimmed Squares estimator
and the size of the initial sub-sample are both
given by psi.0
. Alternatively, a Least Trimmed Squares estimator
with a particular breakdown point can be entered through the argument beta.0
.
forward.beta |
Matrix of dimension n x p. Forward Search estimates of beta. |
forward.sigma2.biased |
Matrix of dimension n x 1. Forward Search estimates of sigma. Values are *not* bias corrected. |
forward.residual |
Matrix of dimension n x 1. Forward Search estimates of forward residuals. Values are *not* bias corrected. |
m.0 |
Number of observations in initial set of selected observations. |
y |
Vector of dimension n. Dependent variable from argument. |
x |
Matrix of dimension n x dim.x. Design matrix for regressors. Dependent variable from argument augmented with constant. First column is constant. |
Bent Nielsen <bent.nielsen@nuffield.ox.ac.uk> 9 Sep 2014
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.
Rousseeuw, P.J. (1984) Least median of squares regression. Journal of the American Statistical Association 79, 871-880.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #####################
# 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.