simData {probout} | R Documentation |
Simulates observations for outlier determination.
Description
Simulates observations from a mixture model based on information on
partitions from the leader
function.
Usage
simData( leaderInstance, nsim=NULL, model=c("diagonal","spherical"), seed=NULL)
Arguments
leaderInstance |
A single component from a call to |
nsim |
The number of observations to be simulated. Only the radius and centroids
are returned of |
model |
For multivariate data, a vector of character strings indicating the type of
Gaussian mixture model covariance to be used in generating the simulated
observations (see |
seed |
An optional integer argument to |
Details
The following models are available for multivariate data:
"spherical" | : | spherical, varying volume |
"diagonal" | : | diagonal, varying volume and shape |
An ellipsoidal model is also possible, but has not yet been implemented.
If nsim = 0
or leaderInstance$radius == 0
, no observations are
simulated, and only the radius and partition centroids are returned.
Value
A list with the following components:
radius |
The value of the radius associated with |
location |
The vector or matrix of centroids of the partitions. If a matrix, rows correspond to the partitions and columns to the variables. |
index |
A vector of integer values giving the index of the partition associated with each simulated observation. |
offset |
A vector of numeric values giving offset for the simulated observations from their associated centroids. |
weight |
A vector of numeric values between 0 and 1 giving the proportion of data observations in each partition. |
scale |
The scale (variance) of the mixture components in a univariate or spherical model. Set to 1 for each component in the diagonal model. |
shape |
A matrix giving the variances of the mixture component in a diagonal model. The rows correspond to the dimensions of the data, while the columns correspond to the mixture components (partitions). |
References
C. Fraley, Estimating Outlier Probabilities for Large Datasets, 2017.
See Also
Examples
radius.default <- LWradius(nrow(faithful),ncol(faithful))
lead <- leader(faithful, radius = c(0,radius.default))
# (simulated) data for outlier statistic (no simulation for radius = 0)
sim <- lapply( lead, simData)
# components of simData output
lapply( sim, names)