Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, rki), 390 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Algorithm for Detrend=SHUFFLE #472296
04/18/18 23:19
04/18/18 23:19
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
JCL,

1. Could you please share the code or algorithm used in Detrend=SHUFFLE? I'd like to know how Zorro generates shuffled price curves.

2. If I use Detrend=SHUFFLE, do percentage returns have the same mean and standard deviation as original percentage returns?

3. Is it correct to use shuffled prices with Detrend=SHUFFLE for Monte Carlo reality check? I'm concerned that this mode keeps overall trend and price range. Does it mean that simulated prices are correlated in a similar manner as the original prices? I thought that it's important to remove existing correlations in prices for the MonteCarlo analysis.

Thank you!

Last edited by kujo; 04/19/18 01:07.
Re: Algorithm for Detrend=SHUFFLE [Re: kujo] #472308
04/19/18 11:43
04/19/18 11:43
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Detrend=SHUFFLE uses the Fisher-Yates algorithm. Which method a reality check uses depends on the reality check.

Re: Algorithm for Detrend=SHUFFLE [Re: jcl] #472310
04/19/18 13:24
04/19/18 13:24
Joined: Dec 2017
Posts: 129
Halifax, NS
K
kujo Offline OP
Member
kujo  Offline OP
Member
K

Joined: Dec 2017
Posts: 129
Halifax, NS
As I understand, Fisher-Yates algorithm shuffles data without replacement. I generated a couple of shuffled price curves with priceClose() and compared with original curve. I sorted and compared percentage returns (p0/p1-1) and price difference (p0-p1). They are different. I wonder what is shuffled then? I assumed the returns should be the same but shuffled? Mean of returns is different as well.

I want to run the Monte Carlo analysis: generate simulated price curves and run my algo on them to reject the null hypothesis. As I understand, Zorro provides 2 options out-of-the-box: Detrend=SHUFFLE (according to the updated manual it's randomize(SHUFFLE,...) ) and randomize(BOOTSTRAP). The difference is that the first one is shuffling without replacement (used for montecarlo in the Black Book example), the second one is shuffling with replacement (used for Whit Reality Check). Which method can be used for above-mentioned montecarlo analysis? Which one is preferable? What's the difference?




Last edited by kujo; 04/19/18 13:32.

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1