Stopping and restarting latin hypercube sampling

조회 수: 4 (최근 30일)
Alessandro Murgia
Alessandro Murgia 2021년 2월 8일
댓글: carlos lopez 2021년 8월 5일
Hi!
I'm trying to run an analysis, in which my variables are sampled with the latin hypercube function lhdesign.
I'd like to stop my simulation when a stopping criteria is satisfied, therefore I'd like also to sample only the necessary points instead of preparing all the combinations before.
From what I know, random number generation ins't actually random, but it follows a kind of pattern (I'm not an expert).
My question is: if I stop the sampling and then I restart it, does the sampling restart from the last point, or also the generation algorithm restarts?
To be clearer, suppose I need to sample N points (N is not determined, since it depends on when the stopping criteria is satisfied), but I want these points to be sampled in groups of 100. So I sample the first 100 points, the I the computation I need to do, check the criterion, sample the next 100 points and so on.
After the first 100 sample, is the first sample of the second group a kind of 101th sample, or the sampling pattern restarts such that the first sample of the second group is the same of the first sample of the first group?
I know it's not explained ina very clear way, but thank you anyway.

답변 (1개)

Anshika Chaurasia
Anshika Chaurasia 2021년 2월 11일
Hi Alessandro,
On running the following code:
rng default % For reproducibility
X = lhsdesign(10,4)
You will get the same samples eveytime you run above code because of the rng. Moreover, each column of X contains one random number in each interval [0,0.1], [0.1,0.2], [0.2,0.3], [0.3,0.4], [0.4,0.5], [0.5,0.6], [0.6,0.7], [0.7,0.8], [0.8,0.9], and [0.9,1].
On running the following code:
X = lhsdesign(10,4)
You will get different samples eveytime you run above code.
Refer to lhsdesign documentation.
Hope it helps!
  댓글 수: 1
carlos lopez
carlos lopez 2021년 8월 5일
I guess that Alessandro is describing a slightly different situation. Let me illustrate my point:
rng(0);A=lhsdesign(4,3);rng(0);B=lhsdesign(5,3);[[A;zeros(1,3)] B]
First four columns has the answer when we request just three points. The last row has been filled with zeros. From 5th to 8th column we have the output when requesting four points. Alessandro (and me) are interested in arrange thing such that the first three rows (i.e. points) are repeated, irrespective if we request three points, four points or 100.
Is it possible?
Regards
Carlos

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Industrial Statistics에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by