3.2.3. Simple example
The following piece shows how to generate a sample using the TSampling class.
xunif = DataServer.TUniformDistribution("x1", 3., 4.) # 1
xnorm = DataServer.TNormalDistribution("x2", 0.5, 1.5) # 2
tds = DataServer.TDataServer("tdsSampling", "Demonstration Sampling")
tds.addAttribute(xunif)
tds.addAttribute(xnorm)
# Generate the sampling from the TDataServer object
sampling = Sampler.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