Description Usage Arguments Value See Also Examples
Fit NOIS to data and return a NOIS_fit
object
1 2 3 |
data |
A |
x |
The name of the column in |
y |
The name of the column in |
CV_method |
The type of cross-validation to use. Possible types are |
first_h |
Bandwidth for first model fit. Only used when |
pool_h |
Bandwidth for pooled model fit. Only used when |
local_q |
Fraction of points detected as outliers for each unpooled fit. |
pool_q |
Pooled outlier detection. For numerics \in (0, 1), this is the fraction of points detected as outliers. For integers ≥ 1 this is the number of points detected as outliers. |
tol |
Tolerance for each unpooled fit. |
maxit |
Maximum number of iterations for each individual kernel smoothing fit. |
... |
Additional arguments passed to the |
An object of class 'NOIS_fit
' that is a list with the following components.
|
A |
|
Unpooled NOIS fits. |
|
The unpooled γ estimates. |
|
The pooled γ estimate. |
|
Fraction of points detected as outliers for each unpooled fit. |
|
Pooled outlier detection. For numerics \in (0, 1), this is the fraction of points detected as outliers. For integers ≥ 1 this is the number of points detected as outliers. |
|
The positions of the clean observations. |
codeCV |
A list with cross-validation information. |
codeconv |
A list with convergence information. |
Other NOIS CV functions: LOOCV_grid
,
MCV_grid
, PCV_grid
1 2 3 4 5 6 7 8 9 10 11 12 13 | ###generate some random data and introduce outliers
set.seed(123)
npts <- 100
nout <- floor(.1*npts)
xt <- seq(from=0, to=2*pi, length.out=npts)
gaussnoise <- rnorm(npts)
outliers <- sample(floor(npts/2):npts, size=nout)
randpts <- runif(nout, min=5, max=7)
yt <- sin(xt) + gaussnoise
yt[outliers] <- yt[outliers] + randpts
sine_data <- data.frame(x = xt, y = yt)
###fit NOIS to this data
sine_fit <- NOIS_fit(sine_data, 'x', 'y', pool_q = .1, CV_method = 'LOOCV')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.