Random Trading

Discussion in 'Trading' started by jperl, Aug 13, 2002.

  1. That kind of depends on what distribution you assume and it's volatility parameter. The % of deviations should not be a function of the sample size. The stability of that estimate - should certainly be, but not the %-tage itself. Hope this helps.
     
    #11     Aug 13, 2002
  2. jperl

    jperl

    ________________________________________________
    originally posted by Vladiator

    That kind of depends on what distribution you assume and it's volatility parameter..."
    __________________________________________________

    You've introduced two new terms here, 'distribution' and 'volatility'
    Want to explain a little further and how it applies to the coin flip question?
     
    #12     Aug 13, 2002
  3. breakin

    breakin

    you might want to look a pascal's triangle, he made it to do just that, try to get an edge on a betting game that had 50/50 odds.

    Im not a math major but im sure you could find info on the specifics somewhere on the web

    hope that helps
     
    #13     Aug 13, 2002
  4. CalTrader

    CalTrader Guest

    <<I would like to pose a question here for those of you familiar with the mathematics of random numbers. I will pose it in terms of coin flipping, but you could easily ask the question in terms of buying and selling equities:

    If you flip an unweighted coin 100 times, it should come up heads about 50 times out of the 100. Suppose you do this experiment and you find that it comes up heads 60 times and tails 40 times. What is your expectation for heads and tails in the next 100 flips?

    The answer should be 50 heads and 50 tails for the next 100 flips. What concerns me however is that the expectation for the total of 200 flips is 100 heads and 100 tails, so one might expect that for the second 100 flips, the expectation is 40 heads and 60 tails, not 50 heads and 50 tails.

    Can anyone enlighten me on this subject. In particular what is the error in the expectation value and how does it relate to the number of flips. (I am thinking that it is something like 1/square root of the number of flips or about 10% for 100 flips)
    <<

    Mathematical Expectation is the value of the probability density (or distribution) at x - where x is a continuous or discrete random variable - and is computed by either a discrete sum or integral of xF(x) where F9x) is the probability density (distribution) function.

    Coin flips of a balanced coin can be modeled by assuming a binomial distribution for the probability density function. That is your random variable has a binomial distribution for its probability distribution.
     
    #14     Aug 13, 2002
  5. jperl

    jperl

    Okay CalTrader, so what's the answer to my question?

    If I flip a coin 200 times and it comes up heads only 80 times, whats the error associated with this result. Is this a random result?
     
    #15     Aug 13, 2002
  6. BKuerbs

    BKuerbs

    You are right: there are two random variables resp their distributions involved.

    The original questions refers to the probability of events in flipping coins, which may be interpreted as a representation of winners and losers. That is the first random variable/distribution of interest: the distribution of winners(losers).

    In trading, this distribution may be misleading: you might have a system with 80% winners, but lose money. So the second random variable/distribution is introduced: the distribution of profits(losses). This should be of greater interest than the former one when doing simulations, running tests etc. The value of expectancy of this distribution will tell you more than the value of expectancy of the winner/loser distribution.

    @jperl
    Sorry for introducing new terms and concepts. http://www.statsoft.com/textbook/stathome.html offers an electronic textbook with an explanation of concepts.

    The coin flip is described by a binomial distribution (you have only two results). The value of expectancy is computed as (n*p). n = number of throws, p probability of outcome. p does not have to be 0.5. So with 100 flips you get a value of expectancy (big surprise) 100*0.5 = 50. The variance you asked for is computed as (n*p*(1-p)). That is (100*0.5*(1-0.5)) = 25. For practical purposes you have to take the square root of the variance, in your case this is 5. Add/subtract this value to the value of expectancy to arrive at an interval your result will fall into with a certain probability.

    This means if you do a lot of series of 100 coin flips, in at least 75% of these series you will have between 40 and 60 heads, in 89% of these series between 35 and 65 heads, and in 94% between 30 and 70 heads (this is just chebycheff's inequality applied). So getting 80 heads in 100 flips looks rather unlikely.

    The probability of an event for the binomial distribution is described by B(x,n,p) = (n over x)*(p**x)*((1-p)**(n-x)). (n over x) is called the binomial coefficient computed as n!/((n-x)!*x!). n! is defined as n! = 1*2*.....(n-1)*n, 0!=1!=1.

    If you want to know the probability of getting at least 80 heads in a row of 100 flips you have got to sum B(100,80,0.5), B(100,81,0.5), .... B(100,100,0.5). Doing this by hand will be rather tedious and error-prone, there are tables and programs to do this. The result is something like 0.000000000557954 (hope I did not mistype it..).


    Regards

    Bernd Kuerbs
     
    #16     Aug 14, 2002
  7. robplayer

    robplayer

    #17     Aug 14, 2002
  8. Nice comprehensive analysis. jperl referred to 200 coin tosses (not 100) however, so getting 80 heads is within 3 standard deviations and is therefore not that unlikely.

    Edit: In fact approximating the normal distribution, we get the probability of 80 heads or less in 200 coin tosses to be about .0024.
     
    #18     Aug 14, 2002
  9. MUChris

    MUChris

    Hey bro,

    The reason that the expectation for the next 100 flips is called independence. Its one of the cornerstones of probablility. You see, no matter what has transpired in the past, the expectation of the next coin flip is .5 for heads and .5 for tails. If you flipped a coin 100 times and landed on heads 99, the probability for it landing on heads would still be 50/50.

    To give the coin a little personality, it just doesn't give a SH*t what it did in the past, because it has no effect on its future.

    Now with the stock market this theory doesn't work because there are too many variables. To use the coin example to express this, lets say you were flipping acoin in a 30 mph east wind and were flipping the coin clockwise while facing north. In that case if you found a variation in your coin flipping expectation, it may be because of the external factor, the wind. The problem with the stock market is that there are infinite random variations that effect the result of the stocks movement, so in reality the stock does NOT have a random 50/50 expectation, but rather a ZERO expectation, because I cannot determine the probability of it going in either direction.

    Chris

    P.S. Sorry if this was too long winded an answer, and if it was too short winded or vague PM me and we'll talk more about it.
     
    #19     Aug 14, 2002
  10. jperl

    jperl

    Okay BKuerbs, this is what I was looking for. So if I understand this correctly, If I toss a coin 100 times I should expect 50 heads with a standard deviation of about 5. In other words I should see somehthing like 50 heads +- 5. In 10000 tosses I would expect to see 5000 heads +- 50. So the percentage deviation from the theoretical expectation decreases with increasing number of flips.( 10% for 100 tosses, 1% for 10,000 tosses).

    Now here is an interesting thing about stock price direction which I am sure that most of you are aware of, but worth repeating. If you pick any stock and look at the number of up days(an up day defined as the day's close>previous day's close) compared to the number of down days over say a 100 day period, you find that the number of up days is around 50!! It doesn't matter whether price action is rising or falling or just oscillating. The deviation of the number of up days from 50 is not large, typically falling in the range 40 to 60.

    According to what BKuerbs has said, if stock price direction is random, I should expect the number of up days to fall in the range of 45 to 55.
    Question for all of you: What is your interpretation of this observation?
     
    #20     Aug 14, 2002