Simulation-class            package:distr            R Documentation

_C_l_a_s_s "_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 'Simulation' data can be simulated in any
     distribution and size.

_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 'Simulation(filename,
     runs, samplesize, seed, distribution)'. A 'Simulation'-object
     includes a filename, the number of runs, the size of the sample,
     the seed and the distribution of the random numbers. The slot
     'Data' stays empty until the method simulate has been used.

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

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

     '_d_i_s_t_r_i_b_u_t_i_o_n': Object of class '"UnivariateDistribution"': the
          distribution of the random numbers

     '_f_i_l_e_n_a_m_e': Object of class '"character"': the filename the
          simulation 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<- 'signature(object = "Contsimulation")': ERROR: A
          modification of simulated data is not allowed. 

     _d_i_s_t_r_i_b_u_t_i_o_n 'signature(object = "Simulation")': returns the
          distribution 

     _d_i_s_t_r_i_b_u_t_i_o_n<- 'signature(object = "Simulation")': changes the
          distribution 

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

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

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

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

     _s_a_v_e_d_a_t_a 'signature(object = "Simulation")': saves the object
          without the data in the directory of R (After loading the
          data can be reproduced by using simulate.) 

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

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

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

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

     _s_u_m_m_a_r_y 'signature(object = "Simulation")': returns filename,
          seed, number of runs, the size of the sample and a
          statistical summary for each run 

_N_o_t_e:

     Changing distribution, seed, runs or samplesize 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' 'Contsimulation-class' 'plot-methods'
     'print-methods' 'summary-methods' 'simulate-methods'

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

     N=Norm() # N is a standard normal distribution.
     S=Simulation(filename="xyz",runs=10,samplesize=3,seed=setRNG(),distribution=N)
     Data(S) # no data yet
     simulate(S)
     Data(S) # now there are random numbers
     Data(S) # the same data as before because the seed has not changed
     seed(S)=setRNG()
     simulate(S)
     Data(S) # different data
     savedata(S) # saves the object in the directory of R...
     load("xyz") # loads it again...
     Data(S) # ...without the data - use simulate to return it!

