View source: R/simulation_models.R
simulation_model9 | R Documentation |
Periodic functions with outliers of different amplitude. The main model is of the form
X_i(t) = a_{1i}\sin \pi + a_{2i}\cos\pi + e_i(t),
with contamination model of the form
X_i(t) = (b_{1i}\sin\pi + b_{2i}\cos\pi)(1-u_i) +
(c_{1i}\sin\pi + c_{2i}\cos\pi)u_i + e_i(t),
where t\in [0,1]
, \pi \in [0, 2\pi]
, a_{1i}
,
a_{2i}
follows uniform distribution in an interval [a_1, a_2]
b_{1i}
, b_{i1}
follows uniform distribution in an interval
[b_1, b_2]
; c_{1i}
, c_{i1}
follows uniform distribution
in an interval [c_1, c_2]
; u_i
follows Bernoulli distribution
and e_i(t)
is a Gaussian processes with zero mean and covariance
function of the form
\gamma(s,t) = \alpha\exp{-\beta|t-s|^\nu}
Please see the simulation models vignette with
vignette("simulation_models", package = "fdaoutlier")
for more details.
simulation_model9(
n = 100,
p = 50,
outlier_rate = 0.05,
kprob = 0.5,
ai = c(3, 8),
bi = c(1.5, 2.5),
ci = c(9, 10.5),
cov_alpha = 1,
cov_beta = 1,
cov_nu = 1,
deterministic = TRUE,
seed = NULL,
plot = F,
plot_title = "Simulation Model 9",
title_cex = 1.5,
show_legend = T,
ylabel = "",
xlabel = "gridpoints"
)
n |
The number of curves to generate. Set to |
p |
The number of evaluation points of the curves. Curves are usually generated
over the interval |
outlier_rate |
A value between |
kprob |
The probability |
ai |
A vector of two values containing |
bi |
A vector of 2 values containing |
ci |
A vector of 2 values containing $c_1i$ and $c_2i$ in the contamination
model. Set to |
cov_alpha |
A value indicating the coefficient of the exponential function
of the covariance matrix, i.e., the |
cov_beta |
A value indicating the coefficient of the terms inside the exponential
function of the covariance matrix, i.e., the |
cov_nu |
A value indicating the power to which to raise the terms inside the exponential
function of the covariance matrix, i.e., the |
deterministic |
A logical value. If |
seed |
A seed to set for reproducibility. |
plot |
A logical value indicating whether to plot data. |
plot_title |
Title of plot if |
title_cex |
Numerical value indicating the size of the plot title relative to the device default.
Set to 1.5 by default. Ignored if |
show_legend |
A logical indicating whether to add legend to plot if |
ylabel |
The label of the y-axis. Set to |
xlabel |
The label of the x-axis if |
A list containing:
data |
a matrix of size |
true_outliers |
a vector of integers indicating the row index of the outliers in the generated data. |
dt <- simulation_model9(plot = TRUE)
dim(dt$data)
dt$true_outliers
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.