Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 04/25/26 16:09
Z9 getting Error 058
by jcl. 04/24/26 17:48
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, Grant), 3,308 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
valino, juergenwue, VladMak, Geir, ondrej
19209 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Monte Carlo simulation new feature #436947
02/06/14 06:12
02/06/14 06:12
Joined: Nov 2013
Posts: 123
Mithrandir77 Offline OP
Member
Mithrandir77  Offline OP
Member

Joined: Nov 2013
Posts: 123
I have been reading http://zorro-trader.com/manual/en/montecarlo.htm and I don't understand this part:

Quote:
The first column identifies the confidence level; in the next columns the annual return, the maximum drawdown, and the required capital at that level are listed. The most likely result is at 50% confidence level (here, 202% annual return). This means that half the simulations had a better and half a worse result. The higher the confidence level, the more pessimistic are the results. The result at 100% confidence level is the worst of all simulations; its likeliness is 1/n, where n is the number of simulations.


From what I learnt in probability and statistics course, the confidence level is the probability of the parameter being in the confidence interval. There are three variables: confidence interval, confidence level and number of experiments, if the number of experiments is fixed and you have a too wide confidence interval, you can narrow it by lowering the confidence level. Of course, the more experiments you perform, the more narrow the confidence interval for your parameter is and the more higher the confidence level.

Anyway, this has nothing to do with the probability of the parameter being in the interval in one particular sample:

Quote:
The level of confidence of the confidence interval would indicate the probability that the confidence range captures this true population parameter given a distribution of samples. It does not describe any single sample. This value is represented by a percentage, so when we say, "we are 99% confident that the true value of the parameter is in our confidence interval", we express that 99% of the observed confidence intervals will hold the true value of the parameter. After a sample is taken, the population parameter is either in the interval made or not; it is not a matter of chance. The desired level of confidence is set by the researcher (not determined by data).


http://en.wikipedia.org/wiki/Confidence_interval

So I don't understand from what reasoning did you arrive at these two statements:

Quote:
The most likely result is at 50% confidence level (here, 202% annual return). This means that half the simulations had a better and half a worse result.


Following the definitions I quoted and explained before, 50% confidence level means that in 50% of the experiments (the various equity curves generated -by I would like to know what procedure-) the parameter(s), in this case Anual Return, Max Drawdown and Capital Required were 202%,1940$ and 1760$ respectively.
How do you arrive at "half the simulations had a better and half a worse result" ?

Quote:
The result at 100% confidence level is the worst of all simulations; its likeliness is 1/n, where n is the number of simulations


Here I'm more puzzled, how do you derive that the likeliness of the parameter being at certain value with 100% confidence level is 1/n? From what I quoted, it can't be derived from confidence intervals ("After a sample is taken, the population parameter is either in the interval made or not; it is not a matter of chance").

I would greatly appreciate if you can shed some light on this, whether you are using another definition of Confidence Interval or what, Monte Carlo simulations are a great improvement to strategies but I want to understand how to use it properly. Thanks!

Re: Monte Carlo simulation new feature [Re: Mithrandir77] #436963
02/06/14 15:56
02/06/14 15:56
Joined: Jul 2000
Posts: 28,094
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,094
Frankfurt
The confidence level is no confidence interval, it splits the simulations into two set of results. You can find many explanations of Monte Carlo simulation on the Internet. I've borrowed the description from here: http://www.adaptrade.com/Articles/article-mc.htm.

The "1/n" just results from the fact that the higher the confidence level, the less likely it is to get the same or a worse result. At 100% confidence level, only 1 of n samples was same or worse - that's your 1/n probability.

Re: Monte Carlo simulation new feature [Re: jcl] #436976
02/06/14 20:46
02/06/14 20:46
Joined: Nov 2013
Posts: 123
Mithrandir77 Offline OP
Member
Mithrandir77  Offline OP
Member

Joined: Nov 2013
Posts: 123
Originally Posted By: jcl
The confidence level is no confidence interval, it splits the simulations into two set of results. You can find many explanations of Monte Carlo simulation on the Internet. I've borrowed the description from here: http://www.adaptrade.com/Articles/article-mc.htm.


Thanks for that! I have done a course in which we used Monte Carlo methods, basically you generate many samples from a distribution (uniform, normal, etc) and then plot a bin graph. The amount of times a bin (which could be a value or a range of values) appear divided by the number of samples was the probability.

From what I read in the link you posted it is the same procedure. My confusion came from here:

Quote:
In this way, a probability or confidence level is assigned to each result.


As I thought, they mix the concept of probability with confidence level which have a subtle difference, but anyway what is important is to understand what we are talking about.

Actually, what is being described here is the probability of an interval (which is a set),
Click to reveal..
if U is the universe and A union B = U then P(A) = P(U) - P(B) + P(A intersection B). P(U) = 1 and if the sets are disjoint then P(A intersection B) = 0.
If your Universe is {1,2,3,4,5,6,7} the probability of getting a value less than 4 is P(X < 5) = P(X=1)+P(X=2)+P(X=3)+P(X=4) or which is the same, P(X < 5) = 1 - P(X>=5) = 1 - (P(X=5)+P(X=6)+P(X=7))


so when in the table in http://zorro-trader.com/manual/en/montecarlo.htm
it appears:
Quote:
90% 165% 3080$ 2580$


it means that in 90% of the samples:

1) the AR was at least 165%? or exactly 165%?
2) the DDmax was at most 3080$? or exactly 3080$?
3) the Capital required was at most 2580$? or exactly 2580$?

Please, if it at least/most, correct me if is at least or at most in each of 3.

If it is exactly then, how did you manage to arrive to an exact value? The bins from a Monte Carlo simulation would be a lot (consider the drunk walk problem that models prices)...Do you average them? For instance if you get AR of 163,164,165,166,167% they go to the 165% bin?

Originally Posted By: jcl
The "1/n" just results from the fact that the higher the confidence level, the less likely it is to get the same or a worse result. At 100% confidence level, only 1 of n samples was same or worse - that's your 1/n probability.


Ok, this is like what I put in the spoiler above, but shouldn't it be 99%? Look: (Confidence level/100) = 1 - alpha,

if Confidence level is 100% then alpha is 0 and P(better result) = 1-alpha = 1 , that is you are sure, and P(the same or worse result) = 1 - P(better result) = 1 - 1 = 0 which is never...

if Confidence level is 99% then alpha is 0.01 and P(better result) = 1-alpha = 0.99 , that is you are almost sure, and P(the same or worse result) = 1 - P(better result) = 1 - 0.99 = 0.01 which is almost never...If n = 100 then 1/100 is 0.01

So the 1/n example works with 99% of Confidence level or am I missing something?

Re: Monte Carlo simulation new feature [Re: Mithrandir77] #436989
02/07/14 08:10
02/07/14 08:10
Joined: Jul 2000
Posts: 28,094
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,094
Frankfurt
I never had a statistics course, but I think your description of what you've learned in that course is correct. Only difference is that we have two variable bins here, not many fixed bins as in your course. Maybe that confused you.

I have reworded the online description a little to make it more clear. When you follow your probability interval definition, you can see that at confidence level 99%, the probability to get the same or worse result is (1/n + 1%). And at 100%, it's 1/n.


Moderated by  Petra 

Gamestudio download | 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