repeated sampling from sobol (or halton) sequence

조회 수: 12 (최근 30일)
Chet Sharma
Chet Sharma 2022년 8월 18일
댓글: Bharath Attoti 2022년 12월 13일
Hello
Very new to the idea of Quasi RN sampling. Starting point:
If I had to sample 20 times from the standard normal (5 random numbers at a time), I would just do this:
for i = 1: 20
x = randn(1, 1:5)
end
How would I do the same from a halton or sobol sequence?
I've been looking at the documentation.....not clear yet. I'm sure its staring at me....just a little help would be awesome!!
  댓글 수: 2
Chet Sharma
Chet Sharma 2022년 8월 18일
Still searching....I tried the following code. What I'm not able to understand is how to change the result of the test2 variable....how do I make it change for each iteration? The code here doesn't quite do it....
for i = 1 : 10
test = haltonset(1000, 'skip', i);
test = scramble(test, 'RR2');
test2 = net(test, 5);
end
Bharath Attoti
Bharath Attoti 2022년 12월 13일
Yes, I am not sure why but even a change in rng seed value does not seem to change the output point set of sobolset and haltonset. I remember getting diffirent results with change in seed in the 2017b version of Matlab. I have upgraded to version 2022b now. Is it the issue with the latest version? Which version are you using?

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

답변 (1개)

Chet Sharma
Chet Sharma 2022년 8월 18일
Looks like the answer may be much simpler:
x1 = RandStream('mt19937ar')
x1 =
mt19937ar random stream Seed: 0 NormalTransform: Ziggurat
x2 = randn(x1, 4, 1)
x2 = 4×1
0.5377 1.8339 -2.2588 0.8622

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by