From b672be1b8656564da81a7da409928f1a5671553a Mon Sep 17 00:00:00 2001
From: Hu Zhao <zhao@mbd.rwth-aachen.de>
Date: Tue, 4 Apr 2023 17:26:18 +0200
Subject: [PATCH] docs: add description of Latin hypercube sampling

---
 docs/source/sampler/latin.rst | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/docs/source/sampler/latin.rst b/docs/source/sampler/latin.rst
index 060f9d6..736cc39 100644
--- a/docs/source/sampler/latin.rst
+++ b/docs/source/sampler/latin.rst
@@ -1,6 +1,27 @@
 Latin Hypercube Sampling
 ========================
 
+Latin hypercube sampling is one type of space-filling sampling method. It is often
+used to draw input points for emulator training. The following figure gives a
+three-dimensional example.
+
+.. image:: ../_static/latin_hypercube_sampling_sketch.png
+   :width: 800
+   :alt: an illustration of Latin hypercube sampling
+   :align: center
+
+Three random variables :math:`X`, :math:`Y`, and :math:`Z` consist of
+a three-dimensional space. If we want to draw :math:`6` samples from this space
+using Latin hypercube sampling, we first divide the range of each variable into
+:math:`6` equally probable intervals as shown on the left. In each interval,
+we pick a value for the corresponding variable. Then we shuffle the picked values
+of each variable (e.g. :math:`x_1` to :math:`x_6`) as shown in the middle. Last,
+each combination gives us one sample of the three variables as shown on the right.
+It should be noted that each sample excludes any other samples from the intervals
+that it locates in. This can be straightforwardly extended to draw :math:`M` samples
+from :math:`N`-dimensional space consisting of :math:`N` random variables.
+  
+
 LHS Class
 ---------
 
@@ -11,4 +32,9 @@ The :class:`.LHS` class is imported by::
 Methods
 ^^^^^^^
 .. autoclass:: psimpy.sampler.latin.LHS
-    :members: sample
\ No newline at end of file
+    :members: sample
+
+
+.. warning:: The :class:`.LHS` class considers each random variable being uniformly
+    distributed in its range. If this is not the case, one needs to transform picked
+    samples accordingly. 
\ No newline at end of file
-- 
GitLab