Contsimulation-class          package:distr          R Documentation

_C_l_a_s_s "_C_o_n_t_s_i_m_u_l_a_t_i_o_n"

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     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.

_S_l_o_t_s:

     '_i_n_d': Object of class '"vectororNULL"': Indicator of the same
          length as the data; saves whether each element of the data
          vector is contaminated or not

     '_D_a_t_a._i_d': Object of class '"vectororNULL"': - the ideal data 

     '_D_a_t_a._c': Object of class '"vectororNULL"': - the contaminated
          data 

     '_r_a_t_e': Object of class '"numeric"': the contamination rate, so
          the probability for each random number to be contaminated 

     '_d_i_s_t_r_i_b_u_t_i_o_n._c': Object of class '"UnivariateDistribution"': the
          distribution of the ideal data 

     '_d_i_s_t_r_i_b_u_t_i_o_n._i_d': Object of class '"UnivariateDistribution"': the
          distribution of the contaminated data 

     '_s_e_e_d': Object of class '"list"': the seed the simulation has been
          generated with 

     '_f_i_l_e_n_a_m_e': Object of class '"character"': the filename the
          Contsimulation shall be saved 

     '_D_a_t_a': Object of class '"vectororNULL"': the simulated data 

     '_r_u_n_s': Object of class '"numeric"': the number of runs of the
          data 

     '_s_a_m_p_l_e_s_i_z_e': Object of class '"numeric"': the size of the sample,
          so the dimension of the data 

_E_x_t_e_n_d_s:

     Class '"Dataclass"', directly.

_M_e_t_h_o_d_s:

     _D_a_t_a._c 'signature(object = "Contsimulation")': returns the
          contaminated data 

     _D_a_t_a._i_d 'signature(object = "Contsimulation")': returns the ideal
          data 

     _D_a_t_a<- 'signature(object = "Contsimulation")': ERROR: A
          modification of simulated data is not allowed. 

     _d_i_s_t_r_i_b_u_t_i_o_n._c 'signature(object = "Contsimulation")': returns the
          distribution of the contaminated data 

     _d_i_s_t_r_i_b_u_t_i_o_n._c<- 'signature(object = "Contsimulation")': changes
          the distribution of the contaminated data

     _d_i_s_t_r_i_b_u_t_i_o_n._i_d 'signature(object = "Contsimulation")': returns
          the distribution of the ideal data 

     _d_i_s_t_r_i_b_u_t_i_o_n._i_d<- 'signature(object = "Contsimulation")': changes
          the distribution of the ideal data 

     _s_e_e_d 'signature(object = "Contsimulation")': returns the seed 

     _s_e_e_d<- 'signature(object = "Contsimulation")': changes the seed 

     _i_n_d 'signature(object = "Contsimulation")': returns the indicator
          which saves which data is contaminated 

     _i_n_i_t_i_a_l_i_z_e 'signature(.Object = "Contsimulation")': initialize
          method 

     _r_a_t_e 'signature(object = "Contsimulation")': returns the
          contamination rate 

     _r_a_t_e<- 'signature(object = "Contsimulation")': changes the
          contamination rate 

     _r_u_n_s<- 'signature(object = "Contsimulation")': changes the number
          of runs 

     _s_a_m_p_l_e_s_i_z_e<- 'signature(object = "Contsimulation")': changes the
          size of the sample 

     _s_a_v_e_d_a_t_a 'signature(object = "Contsimulation")': saves the
          simulation in the directory of R 

     _s_i_m_u_l_a_t_e 'signature(x = "Contsimulation")': generates the random
          numbers for the simulation 

     _p_l_o_t 'signature(x = "Contsimulation")': produces a plot of the
          real data matrix 

     _p_r_i_n_t 'signature(x = "Contsimulation")': returns filename, seed,
          number of runs, the size of the sample,  the rate and the
          distributions 

     _s_u_m_m_a_r_y '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 data

_N_o_t_e:

     Changing distributions, seed, runs, samplesize or rate deletes
     possibly simulated data, as it would not fit to the new
     parameters.

_A_u_t_h_o_r(_s):

     Thomas Stabla Thomas.Stabla@uni-bayreuth.de,
      Florian Camphausen Florian.Camphausen@uni-bayreuth.de,
      Peter Ruckdeschel Peter.Ruckdeschel@uni-bayreuth.de,
      Matthias Kohl Matthias.Kohl@uni-bayreuth.de

_S_e_e _A_l_s_o:

     'Dataclass-class' 'Simulation-class' 'savedata-methods'
     'plot-methods' 'simulate-methods' 'summary-methods'

_E_x_a_m_p_l_e_s:

     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!

