Package lhs. R topics documented: January 4, 2018

Similar documents
The lhs Package. October 22, 2006

An introduction to design of computer experiments

Package ECctmc. May 1, 2018

Package acebayes. R topics documented: November 21, Type Package

Package RankAggreg. May 15, 2018

Package GADAG. April 11, 2017

Package ibm. August 29, 2016

Package SSLASSO. August 28, 2018

Package clustering.sc.dp

Package dkdna. June 1, Description Compute diffusion kernels on DNA polymorphisms, including SNP and bi-allelic genotypes.

Package crochet. January 8, 2018

Package geogrid. August 19, 2018

Package mgc. April 13, 2018

Package ccapp. March 7, 2016

Computer Experiments. Designs

Package RCEIM. April 3, 2017

Package raker. October 10, 2017

Package qap. February 27, Index 5. Solve Quadratic Assignment Problems (QAP)

Package Numero. November 24, 2018

2 MOLHD-package. Index 19. Multiple objective Latin hypercube design. Package: MOLHD Type: Package Version: 0.1 Date: Lisense: LGPL

Package CALIBERrfimpute

Package blocksdesign

Package diffusr. May 17, 2018

Package extweibquant

Package libstabler. June 1, 2017

Package fastdummies. January 8, 2018

Package glinternet. June 15, 2018

Package MixSim. April 29, 2017

Package RCA. R topics documented: February 29, 2016

Package DPBBM. September 29, 2016

Package StVAR. February 11, 2017

Package PUlasso. April 7, 2018

Package Rtsne. April 14, 2017

Package SAMUR. March 27, 2015

Package bisect. April 16, 2018

Package sfc. August 29, 2016

Package rhor. July 9, 2018

Package filematrix. R topics documented: February 27, Type Package

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package rngtools. May 15, 2018

Package stapler. November 27, 2017

Package FastImputation

Package jointdiag. September 9, 2017

Package RobustGaSP. R topics documented: September 11, Type Package

Package mrm. December 27, 2016

Package SCORPIUS. June 29, 2018

Package bootlr. July 13, 2015

Package bayesdp. July 10, 2018

Quasi-Monte Carlo Methods Combating Complexity in Cost Risk Analysis

Package palmtree. January 16, 2018

Package canvasxpress

Package slam. February 15, 2013

Package iterators. December 12, 2017

Package projector. February 27, 2018

Package NORTARA. February 19, 2015

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package wskm. July 8, 2015

Package PhyloMeasures

Package deductive. June 2, 2017

Package zoomgrid. January 3, 2019

Package crossrun. October 8, 2018

Package kamila. August 29, 2016

Package flsa. February 19, 2015

Package sure. September 19, 2017

Package CuCubes. December 9, 2016

Package LCMCR. R topics documented: July 8, 2017

Package subplex. April 5, 2018

Package GenSA. R topics documented: January 17, Type Package Title Generalized Simulated Annealing Version 1.1.

Package MmgraphR. R topics documented: September 14, Type Package

Package blocksdesign

Package gridgraphics

Package mixsqp. November 14, 2018

Package ebdbnet. February 15, 2013

Package milr. June 8, 2017

Package Rsomoclu. January 3, 2019

Package spark. July 21, 2017

Package tbart. February 20, 2015

Package mmpa. March 22, 2017

Package FractalParameterEstimation

Package polychaosbasics

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package GGMselect. February 1, 2018

Package ECOSolveR. February 18, 2018

Package treedater. R topics documented: May 4, Type Package

Package LVGP. November 14, 2018

Package matchingr. January 26, 2018

Package hsiccca. February 20, 2015

Package rmatio. July 28, 2017

Package wrswor. R topics documented: February 2, Type Package

Package anesrake. April 28, 2018

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package strat. November 23, 2016

Package TBSSurvival. January 5, 2017

Nonparametric Importance Sampling for Big Data

Package infutil. R topics documented: February 20, Version 1.0 Date Title Information Utility Author Kristian E.

Package mcmcse. February 15, 2013

Package lpsymphony. February 6, 2018

Package waver. January 29, 2018

Package splithalf. March 17, 2018

Package EMDomics. November 11, 2018

Transcription:

Package lhs January 4, 2018 Version 0.16 Date 2017-12-23 Title Latin Hypercube Samples Author [aut, cre] Maintainer <bertcarnell@gmail.com> Depends R (>= 3.3.0) Suggests RUnit Provides a number of methods for creating and augmenting Latin Hypercube Samples. License GPL (>= 2) URL http://lhs.r-forge.r-project.org BugReports http://r-forge.r-project.org/projects/lhs/ NeedsCompilation yes Repository CRAN Date/Publication 2018-01-04 16:54:37 UTC R topics documented: lhs-package......................................... 2 augmentlhs........................................ 2 geneticlhs......................................... 3 improvedlhs........................................ 5 maximinlhs........................................ 6 optaugmentlhs...................................... 8 optimumlhs........................................ 9 optseededlhs....................................... 10 randomlhs......................................... 11 Index 13 1

2 augmentlhs lhs-package The Latin Hypercube Sample (lhs) Package This package provides a number of methods for creating and augmenting Latin Hypercube Samples For a complete list of functions, use library(help="lhs"). randomlhs, geneticlhs, improvedlhs, maximinlhs, and optimumlhs to generate Latin Hypercube Samples. optaugmentlhs, optseededlhs, and augmentlhs to modify and augment existing designs. augmentlhs Augment a Latin Hypercube Design Augments an existing Latin Hypercube Sample, adding points to the design, while maintaining the latin properties of the design. augmentlhs(lhs, m=1) lhs m The Latin Hypercube Design to which points are to be added The number of additional points to add to matrix lhs Augments an existing Latin Hypercube Sample, adding points to the design, while maintaining the latin properties of the design. Augmentation is perfomed in a random manner. The algorithm used by this function has the following steps. First, create a new matrix to hold the candidate points after the design has been re-partitioned into (n + m) 2 cells, where n is number of points in the original lhs matrix. Then randomly sweep through each column (1... k) in the repartitioned design to find the missing cells. For each column (variable), randomly search for an empty row, generate a random value that fits in that row, record the value in the new matrix. The new matrix can contain more filled cells than m unles m = 2n, in which case the new matrix will

geneticlhs 3 contain exactly m filled cells. Finally, keep only the first m rows of the new matrix. It is guaranteed to have m full rows in the new matrix. The deleted rows are partially full. The additional candidate points are selected randomly due to the random search for empty cells. Stein, M. (1987) Large Sample Properties of Simulations Using Latin Hypercube Sampling. Technometrics. 29, 143 151. randomlhs, geneticlhs, improvedlhs, maximinlhs, and optimumlhs to generate Latin Hypercube Samples. optaugmentlhs and optseededlhs to modify and augment existing designs. a <- randomlhs(4,3) a augmentlhs(a, 2) geneticlhs Latin Hypercube Sampling with a Genetic Algorithm Draws a Latin Hypercube Sample from a set of uniform distributions for use in creating a Latin Hypercube Design. This function attempts to optimize the sample with respect to the S optimality criterion through a genetic type algorithm. geneticlhs(n=10, k=2, pop=100, gen=4, pmut=.1, criterium="s", verbose=false) n k pop gen The number of partitions (simulations or design points) The number of replications (variables) The number of designs in the initial population The number of generations over which the algorithm is applied

4 geneticlhs pmut criterium verbose The probability with which a mutation occurs in a column of the progeny The optimality criterium of the algorithm. Default is S. Maximin is also supported Print informational messages. Default is FALSE Latin hypercube sampling (LHS) was developed to generate a distribution of collections of parameter values from a multidimensional distribution. A square grid containing possible sample points is a Latin square iff there is only one sample in each row and each column. A Latin hypercube is the generalisation of this concept to an arbitrary number of dimensions. When sampling a function of k variables, the range of each variable is divided into n equally probable intervals. n sample points are then drawn such that a Latin Hypercube is created. Latin Hypercube sampling generates more efficient estimates of desired parameters than simple Monte Carlo sampling. This program generates a Latin Hypercube Sample by creating random permutations of the first n integers in each of k columns and then transforming those integers into n sections of a standard uniform distribution. Random values are then sampled from within each of the n sections. Once the sample is generated, the uniform sample from a column can be transformed to any distribution by using the quantile functions, e.g. qnorm(). Different columns can have different distributions. S-optimality seeks to maximize the mean distance from each design point to all the other points in the design, so the points are as spread out as possible. Genetic Algorithm: 1. Generate pop random latin hypercube designs of size n by k 2. Calculate the S optimality measure of each design 3. Keep the best design in the first position and throw away half of the rest of the population 4. Take a random column out of the best matrix and place it in a random column of each of the other matricies, and take a random column out of each of the other matricies and put it in copies of the best matrix thereby causing the progeny 5. For each of the progeny, cause a genetic mutation pmut percent of the time. The mutation is accomplished by swtching two elements in a column Stocki, R. (2005) A method to improve design reliability using optimal Latin hypercube sampling Computer Assisted Mechanics and Engineering Sciences 12, 87 105. Stein, M. (1987) Large Sample Properties of Simulations Using Latin Hypercube Sampling. Technometrics. 29, 143 151.

improvedlhs 5 randomlhs, improvedlhs, maximinlhs, and optimumlhs to generate Latin Hypercube Samples. optaugmentlhs, optseededlhs, and augmentlhs to modify and augment existing designs. geneticlhs(4, 3, 50, 5,.25) improvedlhs Improved Latin Hypercube Sample Draws a Latin Hypercube Sample from a set of uniform distributions for use in creating a Latin Hypercube Design. This function attempts to optimize the sample with respect to an optimum euclidean distance between design points. improvedlhs(n, k, dup=1) n k dup The number of partitions (simulations or design points) The number of replications (variables) A factor that determines the number of candidate points used in the search. A multiple of the number of remaining points than can be added. Latin hypercube sampling (LHS) was developed to generate a distribution of collections of parameter values from a multidimensional distribution. A square grid containing possible sample points is a Latin square iff there is only one sample in each row and each column. A Latin hypercube is the generalisation of this concept to an arbitrary number of dimensions. When sampling a function of k variables, the range of each variable is divided into n equally probable intervals. n sample points are then drawn such that a Latin Hypercube is created. Latin Hypercube sampling generates more efficient estimates of desired parameters than simple Monte Carlo sampling. This program generates a Latin Hypercube Sample by creating random permutations of the first n integers in each of k columns and then transforming those integers into n sections of a standard uniform distribution. Random values are then sampled from within each of the n sections. Once the sample is generated, the uniform sample from a column can be transformed to any distribution by using the quantile functions, e.g. qnorm(). Different columns can have different distributions. This function attempts to optimize the sample with respect to an optimum euclidean distance between design points. Optimumdistance = fracnn 1.0 k

6 maximinlhs Beachkofski, B., Grandhi, R. (2002) Improved Distributed Hypercube Sampling American Institute of Aeronautics and Astronautics Paper 1274. This function is based on the MATLAB program written by John Burkardt and modified 16 Feb 2005 http://www.csit.fsu.edu/~burkardt/m_src/ihs/ihs.m randomlhs, geneticlhs, maximinlhs, and optimumlhs to generate Latin Hypercube Samples. optaugmentlhs, optseededlhs, and augmentlhs to modify and augment existing designs. improvedlhs(4, 3, 2) maximinlhs Maximin Latin Hypercube Sample Draws a Latin Hypercube Sample from a set of uniform distributions for use in creating a Latin Hypercube Design. This function attempts to optimize the sample by maximizing the minium distance between design points (maximin criteria). maximinlhs(n, k, method="build", dup=1, eps=0.05, maxiter=100, optimize.on="grid", debug=false) n k method dup The number of partitions (simulations or design points) The number of replications (variables) build or iterative is the method of LHS creation. build finds the next best point while constructing the LHS. iterative optimizes the resulting sample on [0,1] or sample grid on [1,N] A factor that determines the number of candidate points used in the search. A multiple of the number of remaining points than can be added. This is used when method="build"

maximinlhs 7 eps maxiter optimize.on debug The minimum percent change in the minimum distance used in the iterative method The maximum number of iterations to use in the iterative method grid or result gives the basis of the optimization. grid optimizes the LHS on the underlying integer grid. result optimizes the resulting sample on [0,1] prints additional information about the process of the optimization Latin hypercube sampling (LHS) was developed to generate a distribution of collections of parameter values from a multidimensional distribution. A square grid containing possible sample points is a Latin square iff there is only one sample in each row and each column. A Latin hypercube is the generalisation of this concept to an arbitrary number of dimensions. When sampling a function of k variables, the range of each variable is divided into n equally probable intervals. n sample points are then drawn such that a Latin Hypercube is created. Latin Hypercube sampling generates more efficient estimates of desired parameters than simple Monte Carlo sampling. This program generates a Latin Hypercube Sample by creating random permutations of the first n integers in each of k columns and then transforming those integers into n sections of a standard uniform distribution. Random values are then sampled from within each of the n sections. Once the sample is generated, the uniform sample from a column can be transformed to any distribution by using the quantile functions, e.g. qnorm(). Different columns can have different distributions. Here, values are added to the design one by one such that the maximin criteria is satisfied. Stein, M. (1987) Large Sample Properties of Simulations Using Latin Hypercube Sampling. Technometrics. 29, 143 151. This function is motivated by the MATLAB program written by John Burkardt and modified 16 Feb 2005 http://www.csit.fsu.edu/~burkardt/m_src/ihs/ihs.m randomlhs, geneticlhs, improvedlhs and optimumlhs to generate Latin Hypercube Samples. optaugmentlhs, optseededlhs, and augmentlhs to modify and augment existing designs. maximinlhs(4, 3, dup=2) maximinlhs(4, 3, method="build", dup=2) maximinlhs(4, 3, method="iterative", eps=0.05, maxiter=100, optimize.on="grid") maximinlhs(4, 3, method="iterative", eps=0.05, maxiter=100, optimize.on="result")

8 optaugmentlhs optaugmentlhs Optimal Augmented Latin Hypercube Sample Augments an existing Latin Hypercube Sample, adding points to the design, while maintaining the latin properties of the design. This function attempts to add the points to the design in an optimal way. optaugmentlhs(lhs, m=1, mult=2) lhs m mult The Latin Hypercube Design to which points are to be added The number of additional points to add to matrix lhs m*mult random candidate points will be created. Augments an existing Latin Hypercube Sample, adding points to the design, while maintaining the latin properties of the design. This function attempts to add the points to the design in a way that maximizes S optimality. S-optimality seeks to maximize the mean distance from each design point to all the other points in the design, so the points are as spread out as possible. Stein, M. (1987) Large Sample Properties of Simulations Using Latin Hypercube Sampling. Technometrics. 29, 143 151. randomlhs, geneticlhs, improvedlhs, maximinlhs, and optimumlhs to generate Latin Hypercube Samples. optseededlhs and augmentlhs to modify and augment existing designs.

optimumlhs 9 a <- randomlhs(4,3) a optaugmentlhs(a, 2, 3) optimumlhs Optimum Latin Hypercube Sample Draws a Latin Hypercube Sample from a set of uniform distributions for use in creating a Latin Hypercube Design. This function uses the Columnwise Pairwise (CP) algorithm to generate an optimal design with respect to the S optimality criterion. optimumlhs(n=10, k=2, maxsweeps=2, eps=.1, verbose=false) n k maxsweeps eps verbose The number of partitions (simulations or design points) The number of replications (variables) The maximum number of times the CP algorithm is applied to all the columns. The optimal stopping criterion Print informational messages Latin hypercube sampling (LHS) was developed to generate a distribution of collections of parameter values from a multidimensional distribution. A square grid containing possible sample points is a Latin square iff there is only one sample in each row and each column. A Latin hypercube is the generalisation of this concept to an arbitrary number of dimensions. When sampling a function of k variables, the range of each variable is divided into n equally probable intervals. n sample points are then drawn such that a Latin Hypercube is created. Latin Hypercube sampling generates more efficient estimates of desired parameters than simple Monte Carlo sampling. This program generates a Latin Hypercube Sample by creating random permutations of the first n integers in each of k columns and then transforming those integers into n sections of a standard uniform distribution. Random values are then sampled from within each of the n sections. Once the sample is generated, the uniform sample from a column can be transformed to any distribution by using the quantile functions, e.g. qnorm(). Different columns can have different distributions. S-optimality seeks to maximize the mean distance from each design point to all the other points in the design, so the points are as spread out as possible. This function uses the CP algorithm to generate an optimal design with respect to the S optimality criterion.

10 optseededlhs Stocki, R. (2005) A method to improve design reliability using optimal Latin hypercube sampling Computer Assisted Mechanics and Engineering Sciences 12, 87 105. randomlhs, geneticlhs, improvedlhs and maximinlhs to generate Latin Hypercube Samples. optaugmentlhs, optseededlhs, and augmentlhs to modify and augment existing designs. optimumlhs(4, 3, 5,.05) optseededlhs Optimum Seeded Latin Hypercube Sample Augments an existing Latin Hypercube Sample, adding points to the design, while maintaining the latin properties of the design. This function then uses the columnwise pairwise (CP) algoritm to optimize the design. The original design is not necessarily maintained. optseededlhs(seed, m=1, maxsweeps=2, eps=.1, verbose=false) seed m maxsweeps eps verbose The number of partitions (simulations or design points) The number of additional points to add to matrix seed The maximum number of times the CP algorithm is applied to all the columns. The optimal stopping criterion Print informational messages Augments an existing Latin Hypercube Sample, adding points to the design, while maintaining the latin properties of the design. This function then uses the CP algoritm to optimize the design. The original design is not necessarily maintained.

randomlhs 11 Stein, M. (1987) Large Sample Properties of Simulations Using Latin Hypercube Sampling. Technometrics. 29, 143 151. randomlhs, geneticlhs, improvedlhs, maximinlhs, and optimumlhs to generate Latin Hypercube Samples. optaugmentlhs and augmentlhs to modify and augment existing designs. a <- randomlhs(4,3) a optseededlhs(a, 2, 2,.1) randomlhs Random Latin Hypercube Draws a Latin Hypercube Sample from a set of uniform distributions for use in creating a Latin Hypercube Design. This sample is taken in a random manner without regard to optimization. randomlhs(n, k, preservedraw) n k preservedraw The number of partitions (simulations or design points) The number of replications (variables) Default:FALSE. Ensures that two subsequent draws with the same n, but one with k and one with m variables (k<m), will have the same first k columns if the seed is the same.

12 randomlhs Latin hypercube sampling (LHS) was developed to generate a distribution of collections of parameter values from a multidimensional distribution. A square grid containing possible sample points is a Latin square iff there is only one sample in each row and each column. A Latin hypercube is the generalisation of this concept to an arbitrary number of dimensions. When sampling a function of k variables, the range of each variable is divided into n equally probable intervals. n sample points are then drawn such that a Latin Hypercube is created. Latin Hypercube sampling generates more efficient estimates of desired parameters than simple Monte Carlo sampling. This program generates a Latin Hypercube Sample by creating random permutations of the first n integers in each of k columns and then transforming those integers into n sections of a standard uniform distribution. Random values are then sampled from within each of the n sections. Once the sample is generated, the uniform sample from a column can be transformed to any distribution by using the quantile functions, e.g. qnorm(). Different columns can have different distributions. and D. Mooney Stein, M. (1987) Large Sample Properties of Simulations Using Latin Hypercube Sampling. Technometrics. 29, 143 151. geneticlhs, improvedlhs, maximinlhs, and optimumlhs to generate Latin Hypercube Samples. optaugmentlhs, optseededlhs, and augmentlhs to modify and augment existing designs. # draw a Latin hypercube randomlhs(4, 3) # transform a Latin hypercube X <- randomlhs(5, 2) Y <- matrix(0, nrow=5, ncol=2) Y[,1] <- qnorm(x[,1], mean=3, sd=0.1) Y[,2] <- qbeta(x[,2], shape1=2, shape2=3) # check the preservedraw option set.seed(1976) X <- randomlhs(6,3,preservedraw=true) set.seed(1976) Y <- randomlhs(6,5,preservedraw=true) all(abs(x - Y[,1:3]) < 1E-12) # TRUE

Index Topic design augmentlhs, 2 geneticlhs, 3 improvedlhs, 5 lhs-package, 2 maximinlhs, 6 optaugmentlhs, 8 optimumlhs, 9 optseededlhs, 10 randomlhs, 11 augmentlhs, 2, 2, 5 8, 10 12 geneticlhs, 2, 3, 3, 6 8, 10 12 improvedlhs, 2, 3, 5, 5, 7, 8, 10 12 latin hypercube (randomlhs), 11 lhs (lhs-package), 2 lhs-package, 2 maximinlhs, 2, 3, 5, 6, 6, 8, 10 12 optaugmentlhs, 2, 3, 5 7, 8, 10 12 optimumlhs, 2, 3, 5 8, 9, 11, 12 optseededlhs, 2, 3, 5 8, 10, 10, 12 randomlhs, 2, 3, 5 8, 10, 11, 11 13