Renewable and Sustainable Energy Reviews, Elsevier, vol. " A review of sensitivity analysis methods in building energy analysis,"
#Constrained latin hypercube sampling series#
Journal of the Royal Statistical Society Series C, Royal Statistical Society, vol. " Multivariate emulation of computer simulators: model selection and diagnostics with application to a humanitarian relief model," " Bootstrap techniques for sensitivity analysis and model selection in building thermal performance analysis,"Īpplied Energy, Elsevier, vol. Tian, Wei & Song, Jitian & Li, Zhanyong & de Wilde, Pieter, 2014.These are the items that most often cite the same works as this one and are cited by the same works as this one. To cite, please cite both the original paper from Deutsch and Deutsch. > new_samples = lhsmdu.inverseTransformSample(p, k) Following is an example for normal distribution.:: > import as ssd You can also use frozen distributions (after setting loc and scale parameters). To do this, you must have a rv_contiuous or rv_discrete distribution instance taken from scipy.stats. In this, the CDF of the distribution of interest is inverted, and then data points corresponding to the uniformly sampled points are picked up. To change the random seed in every run, you can set on top of the program:: > tRandomSeed(None)Īfter uniformly distributed samples have been generated from LHSMDU, you can convert these to samples from arbitrary distributions using inverse tranform sampling. > lhsmdu.sample(2, 20) # Latin Hypercube Sampling with multi-dimensional uniformityĪlternatively, you can also set the seed by using sample with a new seed:: > lhsmdu.sample(2, 20, randomSeed=randSeed) # Latin Hypercube Sampling with multi-dimensional uniformity > tRandomSeed(randSeed) # Latin Hypercube Sampling with multi-dimensional uniformity In order to change this behavior, you can set a new random seed using the following code:: > randSeed = 11 # random number of choice This is because the random seed is a global constant set to a default value by design, so that simulations can be replicated. You will notice that the strata generated are the same each time you run the program again. > plt.scatter(r, r, c="y", label="sample 4") > plt.scatter(q, q, c="b", label="sample 3") > plt.scatter(p, p, c="r", label="sample 2") > r = lhsmdu.sample(2, 20) # Latin Hypercube Sampling with multi-dimensional uniformity > q = lhsmdu.sample(2, 20) # Latin Hypercube Sampling with multi-dimensional uniformity > plt.scatter(o, o, c="y", label="resample 4")Īlternatively, you can choose to get new strata each time, and see the sampling hence:: > p = lhsmdu.sample(2, 20) # Latin Hypercube Sampling with multi-dimensional uniformity > plt.scatter(n, n, c="b", label="resample 3") > plt.scatter(m, m, c="r", label="resample 2") > plt.scatter(k, k, c="g", label="sample 1") You can plot these together and see the sampling from the strata:: This will again generate the same number of samples as before, a nested list with 2 variables, with 20 samples each. For this, you can do:: > m = lhsmdu.resample() You can use the strata generated by the algorithm to sample again, if you so desire. > plt.scatter(l, l, color="r", label="MC") > plt.scatter(k, k, color="g", label="LHS-MDU") To plot and see the difference between Monte Carlo and LHS-MDU sampling for a 2 dimensional system:: > l = lhsmdu.createRandomStandardUniformMatrix(2, 20) # Monte Carlo sampling This will generate a nested list with 2 variables, with 20 samples each. > k = lhsmdu.sample(2, 20) # Latin Hypercube Sampling with multi-dimensional uniformity This is a package for generating latin hypercube samples with multi-dimensional uniformity.
#Constrained latin hypercube sampling install#
$ python setup.py install -user # for this user only. You can install lhsmdu using pip:: $ pip install lhsmduĪlternatively, you can clone on github and then install the package locally:: $ git clone