repeated sampling from sobol (or halton) sequence

10 Ansichten (letzte 30 Tage)
Chet Sharma
Chet Sharma am 18 Aug. 2022
Kommentiert: Bharath Attoti am 13 Dez. 2022
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 Kommentare
Chet Sharma
Chet Sharma am 18 Aug. 2022
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 am 13 Dez. 2022
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?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Chet Sharma
Chet Sharma am 18 Aug. 2022
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

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by