Latin Hypercube Sampling Software Mac

All that page 3 and onward describes is latin hypercube sampling in general. There is no proposed solution in there for the case of finite discrete sets. The first step of their algorithm converts the continuous variables into discrete ones, and proceeds on the discrete values. If the variables are already discrete, you just skip that first step.

Active2 years, 7 months ago

I am running a simulation on a Linux server:

  1. Is it possible to run a simulation (experiment) on batch mode?
  2. The only document I found was this, but it says nothing about running experiments on batch mode.

Here an example of what I am trying to do:

  • I set a parameter variation experiment using a Latin hypercube sampling (240 parameter combinations):
  • I am saving text files of each run; I am running 10 replications per iteration.

I can run this using a Linux server, after running the application I get a window (XQuartz, I am using a Mac) from which I can manipulate and run the experiment:

  • As far as I keep the window of the experiment open, the simulation will run. If I lose the connection with the server, the simulation will stop, unless I run this in a background mode (i.e., batch mode).

Any ideas? Examples?

sdaza
sdazasdaza

1 Answer

To run AnyLogic (multi- or single-run) experiments in 'batch', the normal method is to export the experiment to a standalone Java application, which can then be run as needed from the command line. This is available only in the Professional edition; looks like you are using the Personal Learning Edition (PLE).

Otherwise, AnyLogic is fundamentally a 'client-based' application. You might find some clever tricks to run it remotely as you suggest, but there is no 'intended' method, and you may be skirting along the edges of the license conditions.

Stuart RossiterStuart Rossiter
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Not the answer you're looking for? Browse other questions tagged javaanylogic or ask your own question.

Latin Hypercube Sampling LHC

JOSE LOPEZ-COLLADO

Latin Hypercube Sampling Software Mac

JULY, 2015

After searching fow a while, I finally found a paper describing the LHC sampling (Swiler and Wyss 2004). LHC is a re-scaling function in the domain of a random uniform variate so to have a better dispersion of the input numbers used to generate the pdf deviates. The paper of Swiler & Wyss presents a detailed example of the algorithm so anybody can check the results and the algorithm itself (pages 2-9 in the paper).

In essence, the sample size ss serves to divide the sampling space into ss categories and then the U values are re-scaled to the new limits:

(* HERE IS THE MATHEMATICA CODE WITH COMMENTS *)

Latin hypercube sampling software mac download

SetDirectory[NotebookDirectory[]];

wdist = WeibullDistribution[1.5, 3];

dname = wdist;

(* ss is the sample size*)

ss= 1500;

(*scaleu is the LHS re-scaling, very simple indeed! *)

scaleu[u_, i_, ss_] := u (1/ss) + ((i - 1)/ss);

(* set function as listable, capable of handling lists*)

SetAttributes[scaleu, Listable];

(*get a list of uniform random numbers*)

un = RandomVariate[UniformDistribution[{0, 1}], ss];

(*Get a sequence of integers, 1,2,3,... ,ss*)

strata = Range[ss];

(*Re-distribute the random numbers using LHC*)

usc = scaleu[un, strata, ss];

Latin Hypercube Sampling Software Mac Download

(*Obtain a random number from the list above, in this example is wdist, a Weibull Distribution with shape and scale parameters of 1.5 and 3 respectively*)

(*Obtain a list of random numbers using LHC, check that we use the inverse of the cumulative density function CDF to translate from the re-scaled U values to their pdf values *)

pvL = Map[InverseCDF[dname, #] &, usc];

(* get some statistics, mean and standard deviation *)

Latin Hypercube Sampling R

mL = Mean[pvL]

2.70744

sdL = StandardDeviation[pvL]

1.83532

(*The next call is is the conventional random sampling, NOT the LHC, it uses the built-in Mathematica function RandomVariate and the distribution name and sample size as arguments *)

pvR = RandomVariate[dname, ss];

(* get the same statistics: mean and standard deviation*)

Latin Hypercube Sampling Python

mR = Mean[pvR]

2.62812

Python Latin Hypercube Sampling

sdR = StandardDeviation[pvR]

1.7902

(* Draw the distributions, Latin Hypercube on the left, regular sampling on the right *)

Latin Hypercube Sampling Gamma Distribution

GraphicsRow[{Histogram[pvL], Histogram[pvR]}]