Simulation-class

0th

Percentile

Class "Simulation"

In an object of type Simulation data can be simulated in any distribution and size.

Note

Changing distribution, seed, runs or samplesize 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 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.

Extends

Class "Dataclass", directly.

See Also

Dataclass-class Contsimulation-class plot-methods print-methods summary-methods simulate-methods

Aliases
  • Simulation-class
  • Simulation
  • initialize,Simulation-method
Examples
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!
Documentation reproduced from package distr, version 1.5, License: GPL (version 2 or later)

Community examples

Looks like there are no examples yet.