Giter Site home page Giter Site logo

mb706 / lhs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bertcarnell/lhs

0.0 1.0 0.0 22.79 MB

Provides a number of methods for creating and augmenting Latin Hypercube Samples and Orthogonal Array Latin Hypercube Samples

License: GNU General Public License v3.0

R 15.72% C++ 76.82% C 1.67% Shell 0.37% TeX 4.38% CMake 0.44% Dockerfile 0.59%

lhs's Introduction

This package provides a number of methods for creating and augmenting Latin Hypercube Samples and Orthogonal Array Latin Hypercube Samples.

Linux & MacOS Windows Code Coverage CRAN Downloads CRAN
Build Status Build status Coverage status CRAN status

Visit the webpage here

See the Doxygen documentation here

The reverse dependency checks for lhs can be found here.

Installation

You can install the released version of lhs from CRAN with:

install.packages("lhs")

You can also install the development version of lhs from here with:

# install.packages("devtools")
devtools::install_github("bertcarnell/lhs")

Examples

Create a random LHS with 10 samples and 3 variables:

require(lhs)
set.seed(1776)
X <- randomLHS(n = 10, k = 3)

Create a design that is more optimal than the random case:

A <- geneticLHS(10, 3, pop = 100, gen = 5, pMut = 0.1)
B <- maximinLHS(10, 3, method = "build", dup = 5)
D <- maximinLHS(10, 3, method = "iterative", optimize.on = "result", eps = 0.01, maxIter = 300)
E <- improvedLHS(10, 3, dup = 5)
G <- optimumLHS(10, 3, maxSweeps = 10, eps = 0.01)
data.frame(method = c("random","genetic","maximin","maximin","improved","optimum"),
           mean_dist = c(mean(dist(X)), mean(dist(A)), mean(dist(B)),
                         mean(dist(D)), mean(dist(E)), mean(dist(G))),
           min_dist = c(min(dist(X)), min(dist(A)), min(dist(B)),
                        min(dist(D)), min(dist(E)), min(dist(G))))
Method Mean Distance Minimum Distance
random 0.7067224 0.2708864
genetic 0.7189860 0.4058587
maximin 0.7295788 0.3611274
maximin 0.7245922 0.3974934
improved 0.7028446 0.3871904
optimum 0.7289469 0.4597657

Augment an existing design:

Y <- randomLHS(10, 5)
Z <- augmentLHS(Y, 2)

Build an orthogonal array LHS:

# a 9 row design is returned because a 10 row design is not possible with these algorithms
W9 <- create_oalhs(10, 3, bChooseLargerDesign = FALSE, bverbose = FALSE)

# a 16 row design is returned because a 10 row design is not possible with these algorithms
W16 <- create_oalhs(10, 3, bChooseLargerDesign = TRUE, bverbose = FALSE)

Help

R-Help Examples of using the LHS package

Other

lhs package announcement: R-pkgs New R-Packages: Triangle and LHS

lhs's People

Contributors

bertcarnell avatar mb706 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.