The following are simulation models included in the
fdaoutlier
package. Some of these models were curated from
research work related to functional depths and outlier detection for
functional data. This documents presents the model equations as well as
their corresponding functions and parameters in fdaoutlier
.
The parameters of the fdaoutlier
functions have been set to
reasonable default values for ease of use.
This is a typical magnitude model in which outliers are shifted from the ‘normal’ non-outlying observations. The main model is of the form:
Xi(t) = μt + ei(t), and the contamination model model is of the form:
Xi(t) = μt + qki + ei(t) where:
This model can be accessed with the simulation_model1()
function in fdaoutlier
.
library(fdaoutlier)
dtss <- simulation_model1(n = 100, p = 50, outlier_rate = .1,
seed = 50, plot = F)
The returned object is a list containing a matrix of the data and a vector of the indices of the true outliers:
The simulated data can be tuned using additional parameters to
simulation_model1()
. The following parameters modify the
data generated by simulation_model1()
:
mu
: the coefficient μ in the main and contamination
models controlling the mean function.q
: the shift parameter q in the contamination model which
controls how far the outliers are from the mean function.kprob
: the probability that ki = 1, i.e.,
P(ki = 1)
in the contamination modelcov_alpha
: the coefficient α in the covariance function.cov_beta
: the coefficient β in the covariance function.cov_nu
: the coefficient ν in the covariance function.Additional plotting parameters allows for modifying the plot title
(plot_title
), the font size of the title
(title_cex
), toggle on/off the display of the legend
(show_legend
), y-axis label (ylabel
) and
x-axis label (xlabel
).
This model generates non-persistent magnitude outliers, i.e., the outliers are magnitude outliers for only a portion of the domain of the functional data. The main model is of the form: Xi(t) = μt + ei(t), with contamination model of the form: Xi(t) = μt + qkiITi ≤ t ≤ Ti + l + ei(t) where:
A call to simulation_model2()
generates data from this
model:
Additional parameters of simulation_model3()
to which
arguments can be passed are:
mu
: the coefficient μ in the main and contamination
models controlling the mean function.q
: the shift parameter q in the contamination model which
controls how far the outliers are from the mean function.kprob
: the probability that ki = 1, i.e.,
P(ki = 1)
in the contamination model.a
, b
: values specifying the interval [a, b] from which Ti is drawn in
the contamination model.l
: the value of l in the contamination model.cov_alpha
: the coefficient α in the covariance function.cov_beta
: the coefficient β in the covariance function.cov_nu
: the coefficient ν in the covariance function.Additional plotting parameters listed for
simulation_model1()
also applies.
This model generates outliers that are magnitude outliers for a part of the domain. The main model is of the form: Xi(t) = μt + ei(t), with contamination model of the form: Xi(t) = μt + qkiITi ≤ t + ei(t) where:
A call to simulation_model3()
generates data from this
model:
Additional parameters of simulation_model3()
to which
arguments can be passed are:
mu
: the coefficient μ in the main and contamination
models controlling the mean function.q
: the shift parameter q in the contamination model which
controls how far the outliers are from the mean function.kprob
: the probability that ki = 1, i.e.,
P(ki = 1)
in the contamination model.a
, b
: values specifying the interval [a, b] from which Ti is drawn in
the contamination model.cov_alpha
: the coefficient α in the covariance function.cov_beta
: the coefficient β in the covariance function.cov_nu
: the coefficient ν in the covariance function.Additional plotting parameters listed for
simulation_model1()
also applies.
This models generates outliers defined on the reversed interval of the main model. The main model is of the form: Xi(t) = μt(1 − t)m + ei(t), with contamination model of the form: Xi(t) = μ(1 − t)tm + ei(t) where:
A call to simulation_model4()
generates data from this
model:
Additional parameters of simulation_model4()
to which
arguments can be passed are:
mu
: the coefficient μ in the main and contamination
models controlling the mean function.m
: the constant m in the main and contamination
models.cov_alpha
: the coefficient α in the covariance function.cov_beta
: the coefficient β in the covariance function.cov_nu
: the coefficient ν in the covariance function.Additional plotting parameters listed for
simulation_model1()
also applies.
This models generates shape outliers with a different covariance structure from that of the main model. The main model is of the form: Xi(t) = μt + ei(t), with contamination model of the form: Xi(t) = μt + ẽi(t), where:
A call to simulation_model5()
generates data from this
model:
Additional parameters of simulation_model5()
to which
arguments can be passed are:
mu
: the coefficient μ in the main and contamination
models controlling the mean function.cov_alpha
: the coefficient α in the covariance function of
ei(t).cov_beta
: the coefficient β in the covariance function of
ei(t).cov_nu
: the coefficient ν in the covariance function of
ei(t).cov_alpha2
: the coefficient α in the covariance function of
ẽi(t).cov_beta2
: the coefficient β in the covariance function of
ẽi(t).cov_nu2
: the coefficient ν in the covariance function of
ẽi(t).Additional plotting parameters listed for
simulation_model1()
also applies.
This models generates shape outliers that have a different shape for a portion of the domain. The main model is of the form: Xi(t) = μt + ei(t), with contamination model of the form: $$X_i(t) = \mu t + (-1)^u\cdot q + (-1)^{(1-u)}\left(\frac{1}{\sqrt{r\pi}}\right)\exp{(-z(t-v)^w)} + e_i(t)$$ where:
A call to simulation_model6()
generates data from this
model:
Additional parameters of simulation_model6()
to which
arguments can be passed are:
mu
: the coefficient μ in the main and contamination
models controlling the mean function.q
: the constant term q in the contamination model.kprob
: the probability P(u = 1)a
, b
: values specifying the interval of
from which v in the
contamination model is drawn.pi_coeff
: the constant r in the contamination model.exp_pow
: the constant w in the contamination model.exp_coeff
: the constant z in the contamination model.cov_alpha
: the coefficient α in the covariance function.cov_beta
: the coefficient β in the covariance function.cov_nu
: the coefficient ν in the covariance function.Additional plotting parameters listed for
simulation_model1()
also applies.
This model generates pure shape outliers that are periodic. The main model is of the form: Xi(t) = μt + ei(t), with contamination model of the form: Xi(t) = μt + ksin (rπ(t + θ)) + ei(t), where:
A call to simulation_model7()
generates data from this
model:
Additional parameters of simulation_model7()
to which
arguments can be passed are:
mu
: the coefficient μ in the main and contamination
models controlling the mean function.cov_alpha
: the coefficient α in the covariance function of
ei(t).cov_beta
: the coefficient β in the covariance function of
ei(t).cov_nu
: the coefficient ν in the covariance function of
ei(t).sin_coeff
: the coefficient k in the contamination model.pi_coeff
: the coefficient r in the contamination model.a
, b
: values specifying the interval of
from which θ is to be
drawn.Additional plotting parameters listed for
simulation_model1()
also applies.
This model generates pure shape outliers that are periodic. The main model is of the form: Xi(t) = ksin (rπt) + ei(t), with contamination model of the form: Xi(t) = ksin (rπt + v) + ei(t), where:
A call to simulation_model8()
generates data from this
model:
Additional parameters of simulation_model7()
to which
arguments can be passed are:
cov_alpha
: the coefficient α in the covariance function of
ei(t).cov_beta
: the coefficient β in the covariance function of
ei(t).cov_nu
: the coefficient ν in the covariance function of
ei(t).sin_coeff
: the coefficient k in the main and contamination
model.pi_coeff
: the coefficient r in the main and contamination
model.constant
: the value of the constant v in the contamination model.Additional plotting parameters listed for
simulation_model1()
also applies.
Periodic functions with outliers of different amplitude. The main model is of the form: Xi(t) = a1isin π + a2icos π + ei(t), with contamination model of the form: Xi(t) = (b1isin π + b2icos π)(1 − ui) + (c1isin π + c2icos π)ui + ei(t), where:
A call to simulation_model9()
generates data from this
model:
Additional parameters of simulation_model9()
to which
arguments can be passed are:
kprob
the probability P(ui = 1)ai
a vector of 2 values containing a1 and a2 indicating the
interval from which a1i and a2i are drawn in
the main model.bi
a vector of 2 values containing b1 and b2 indicating the
interval from which a1i and a2i are drawn in
the main model.ci
a vector of 2 values containing c1 and c2 indicating the
interval from which c1i and c2i are drawn in
the main model.cov_alpha
: the coefficient α in the covariance function of
ei(t).cov_beta
: the coefficient β in the covariance function of
ei(t).cov_nu
: the coefficient ν in the covariance function of
ei(t).Additional plotting parameters listed for
simulation_model1()
also applies.