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.
Changing distributions, seed, runs, samplesize or rate deletes possibly simulated data, as it would not fit to the new parameters.
Objects from the Class
Objects can be created by calls of the form
Contsimulation(filename, runs, samplesize, seed, distribution.id,
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
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!