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 is contaminated.
Objects can be created by calls of the form Contsimulation(filename, runs, samplesize, seed, distribution.id,
distribution.c, rate)
.
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.
ind
:"vectororNULL"
: Indicator of the same length as the data; saves whether each
element of the data vector is contaminated or notData.id
:"vectororNULL"
: – the ideal data Data.c
:"vectororNULL"
: – 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 filename
:"character"
: the filename the Contsimulation shall be saved Data
:"vectororNULL"
: the simulated data runs
:"numeric"
: the number of runs of the data samplesize
:"numeric"
: the size of the sample, so the dimension 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 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")
: changes the number of runs signature(object = "Contsimulation")
: changes the size of the sample signature(object = "Contsimulation")
: saves the simulation in the directory of R signature(x = "Contsimulation")
: generates the random numbers for the simulation signature(x = "Contsimulation")
: produces a plot of the real data matrix signature(x = "Contsimulation")
: returns filename, seed, number of runs, the size of the sample,
the rate and the distributions signature(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@uni-bayreuth.de,
Matthias Kohl Matthias.Kohl@stamats.de
Dataclass-class
Simulation-class
savedata-methods
plot-methods
simulate-methods
summary-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 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!