Contsimulation-class {distrSim} | R Documentation |
In an object of type Contsimulation
data can be simulated in any distribution and size. One part
(usually the largest) of the random numbers stems from an ideal distribution, the rest from a contaminating distribution.
Objects can be created by calls of the form Contsimulation(filename, samplesize, runs, seed, distribution.id,
distribution.c, rate)
(observation dimension is deduced from slot distribution.id
).
A Contsimulation
-object includes a filename, the number of runs, the size of the sample, the seed, the distribution
of the ideal and the contaminated data and the contamination rate. The slot Data stays empty until the method simulate has
been used. The same goes for slots Data.id and Data.c.
ind
:"MatrixorNULLorVector"
: Indicator of the same length as the data; saves whether each
element of the data vector is contaminated or notData.id
:"ArrayorNULLorVector"
: – the ideal data Data.c
:"ArrayorNULLorVector"
: – the contaminated data rate
:"numeric"
: the contamination rate, so the probability for each random number
to be contaminated distribution.c
:"UnivariateDistribution"
: the distribution of the ideal data distribution.id
:"UnivariateDistribution"
: the distribution of the contaminated
data seed
:"list"
: the seed the simulation has been generated with name
:"character"
: a name for the Contsimulationfilename
:"character"
: the filename the Contsimulation shall be saved Data
:"ArrayorNULLorVector"
: the simulated data samplesize
:"numeric"
: the size of the sample, so the dimension of the data obsDim
:"numeric"
: the observation dimension of the data runs
:"numeric"
: the number of runs of the data
Class "Dataclass"
, directly.
signature(object = "Contsimulation")
: returns the contaminated data signature(object = "Contsimulation")
: returns the ideal data signature(object = "Contsimulation")
: ERROR: A modification of simulated data is not allowed. signature(object = "Contsimulation")
: returns the the filenamesignature(object = "Contsimulation")
: changes the the filenamesignature(object = "Contsimulation")
: returns the the namesignature(object = "Contsimulation")
: changes the the namesignature(object = "Contsimulation")
: returns the distribution of the contaminated data signature(object = "Contsimulation")
: changes the distribution of the contaminated datasignature(object = "Contsimulation")
: returns the distribution of the ideal data signature(object = "Contsimulation")
: changes the distribution of the ideal data signature(object = "Contsimulation")
: returns the seed signature(object = "Contsimulation")
: changes the seed signature(object = "Contsimulation")
: returns the indicator which saves which data is contaminated signature(.Object = "Contsimulation")
: initialize method signature(object = "Contsimulation")
: returns the contamination rate signature(object = "Contsimulation")
: changes the contamination rate signature(object = "Contsimulation")
: returns the dimension of the observationssignature(object = "Contsimulation")
: returns the version of this package, under which this object was generatedsignature(object = "Contsimulation")
: returns the number of runs signature(object = "Contsimulation")
: changes the number of runs signature(object = "Contsimulation")
: returns the size of the sample signature(object = "Contsimulation")
: changes the size of the sample signature(object = "Contsimulation")
: saves the object without the data in the
directory of R. (After loading the data can be reproduced by using simulate.) signature(x = "Contsimulation")
: generates the random numbers for the simulation signature(x = "Contsimulation")
: produces a plot of the real data matrix; ; for details confer plot-methods
signature(x = "Contsimulation")
: returns filename, seed, the observation dimension,
the number of runs, the size of the sample, the contamination rate and the distributions, and,
if from a version > 1.8, also the package version under which the object was generatedsignature(object = "Contsimulation")
: returns filename, seed, number of runs, the size of the
sample, the rate and a statistical summary for each run of the real dataChanging distributions, seed, runs, samplesize or rate deletes possibly simulated data, as it would not fit to the new parameters.
Thomas Stabla statho3@web.de,
Florian Camphausen fcampi@gmx.de,
Peter Ruckdeschel Peter.Ruckdeschel@itwm.fraunhofer.de,
Matthias Kohl Matthias.Kohl@stamats.de
Dataclass-class
Simulation-class
savedata-methods
plot-methods
simulate-methods
summary-methods
getVersion-methods
N <- Norm() # N is a standard normal distribution. C <- Cauchy() # C is a Cauchy distribution cs <- Contsimulation(filename = "csim", runs = 10, samplesize = 3, seed = setRNG(), distribution.id = N, distribution.c = C, rate = 0.1) simulate(cs) # Each of the 30 random numbers is ideal (N-distributed) with # probability 0.9 and contaminated (C-distributed) with # probability = 0.1 Data(cs) Data.id(cs) Data.c(cs) ind(cs) summary(cs) Data(cs) # different data savedata(cs) # saves the object in the working directory of R... load("csim") # loads it again... Data(cs) # ...without the data - use simulate to return it!