#include <RandomVariables.h>
Inheritance diagram for EmpiricalRandomVariable:
This is the type of random variable to use if you have a raw data set. Samples drawn from the empirical distribution do not need to have the same size as the data set and indeed can be arbitrarily large (sampling with replacement).
Class maintains a reference to the data set array but does not construct a copy of this array. The data are assumed to be of scalar type Real
.
Definition at line 115 of file RandomVariables.h.
Public Member Functions | |
int | getSampleSize () const |
Real * | getDataSet () const |
EmpiricalRandomVariable (Real *data_set, int sample_size) | |
Real | nextValue () |
Static Public Member Functions | |
void | test (int n) |
|
Constructor.
Definition at line 136 of file RandomVariables.h. |
|
Number of data points. Definition at line 124 of file RandomVariables.h. |
|
The array containing the sample data. Definition at line 128 of file RandomVariables.h. References Real. |
|
Sampling from the distribution of X, Samples from the underlying data set with replacement. Implements RandomObject< RangeType, ScalarType >. |
|
Allocates the data set 0,1,...,n-1, then prints a sample of size 200 from the empirical distribution. |