3.2.3. Simple example
The following piece shows how to generate a sample using the TSampling class.
TUniformDistribution *xunif = new TUniformDistribution("x1", 3., 4.); // 1
TNormalDistribution *xnorm = new TNormalDistribution("x2", 0.5, 1.5); // 2
TDataServer * tds = new TDataServer("tdsSampling", "Demonstration Sampling");
tds->addAttribute(xunif);
tds->addAttribute(xnorm);
// Generate the sampling from the TDataServer object
TSampling *sampling = new TSampling(tds, "lhs", 1000); // 3
sampling->generateSample(); // 4
tds->drawTufte("x1:x2"); // 5
Generation of a design-of-experiments with stochastic attributes
Generating a uniform random variable in [3., 4.]
Generating a gaussian random variable with a mean of 0.5 and a standard deviation of 1.5
Construct the sampler object requesting a sample of 1000 events, using the Lhs algorithm.
Method to generate the sample.
Draw the plot as the right side of Figure 3.3