Simulation-class | R Documentation |
In an object of type Simulation
data can be simulated in any distribution and size.
Objects can be created by calls of the form Simulation(filename, samplesize, runs, seed, distribution)
(observation dimension is deduced from slot distribution
).
A Simulation
-object includes a filename, a name for the simulation, 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.
seed
:Object of class "list"
: the seed the simulation has been generated with
distribution
:Object of class "UnivariateDistribution"
: the distribution of the random numbers
filename
:Object of class "character"
: the filename the simulation shall be saved
name
:Object of class "character"
: a name for the Simulation
Data
:Object of class "ArrayorNULLorVector"
: the simulated data
samplesize
:Object of class "numeric"
: the size of the sample
obsDim
:Object of class "numeric"
: the dimension of the observations of the data
runs
:Object of class "numeric"
: the number of runs of the data
version
:Object of class "character"
: the version of this package, under which this object was generated
Class "Dataclass"
, directly.
signature(object = "Simulation")
: returns the simulated data.
signature(object = "Simulation")
: ERROR: A modification of simulated data is not allowed.
signature(object = "Simulation")
: returns the the filename
signature(object = "Simulation")
: changes the the filename
signature(object = "Simulation")
: returns the the name
signature(object = "Simulation")
: changes the the name
signature(object = "Simulation")
: returns the distribution
signature(object = "Simulation")
: changes the distribution
signature(object = "Simulation")
: returns the seed
signature(object = "Simulation")
: changes the seed
signature(object = "Simulation")
: returns the dimension of the observations
signature(object = "Simulation")
: returns the version of this package, under which this object was generated
signature(object = "Simulation")
: returns the number of runs
signature(object = "Simulation")
: changes the number of runs
signature(object = "Simulation")
: returns the size of the sample
signature(object = "Simulation")
: changes the size of the sample
signature(object = "Simulation")
: saves the object without the data in the directory of R
(After loading the data can be reproduced by using simulate.)
signature(.Object = "Simulation")
: initialize method
signature(x = "Simulation")
: produces a plot of the data matrix; for details confer plot-methods
signature(x = "Simulation")
: returns filename, seed, the observation dimension,
the number of runs, the size of the sample, the distribution generating the simulations,
and, if from a version > 1.8, also the package version under which the object was generated
signature(x = "Simulation")
: the same as print
.
signature(x = "Simulation")
: generates the random numbers for the simulation
signature(object = "Simulation")
: returns filename, seed, number of runs, the size of the sample
and a statistical summary for each run
Changing distribution, seed, runs or samplesize 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-oldenburg.de,
Matthias Kohl Matthias.Kohl@stamats.de
Dataclass-class
Contsimulation-class
plot-methods
print-methods
summary-methods
simulate-methods
getVersion-methods
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!
unlink("xyz")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.