[HN Gopher] Probability 101, the intuition behind martingales an...
       ___________________________________________________________________
        
       Probability 101, the intuition behind martingales and solving
       problems with them
        
       Author : cpp_frog
       Score  : 120 points
       Date   : 2023-02-23 11:30 UTC (11 hours ago)
        
 (HTM) web link (codeforces.com)
 (TXT) w3m dump (codeforces.com)
        
       | sn41 wrote:
       | Many have been asking for an intuitive explanation of
       | martingales. The following is the historical context, which helps
       | understand some of the motivation.
       | 
       | suppose you have a fair coin, and you bet 1 dollar that it comes
       | up heads. if it does, then you get 2 dollars, and you gain 1
       | dollar and exit.
       | 
       | suppose you lose. then put $2 on the next being head. if you win,
       | you get double, for a gain of $4-($2+$1)=$4-$3=$1.
       | 
       | on third toss, put $4. if it comes up heads, you get $8. the gain
       | is $8-$7=$1.
       | 
       | so every time you lose, double the previous bet. you can exit
       | with $1 gain on your first win.
       | 
       | this was the original, flawed, martingale strategy. what's wrong?
       | 
       | then we realize that there is one outcome where you lose all your
       | stake. On that path, your loss is exponential in the number of
       | rounds!
       | 
       | another way to state that is that the expectation of the money
       | after any round is $1, your initial stake. This is where the
       | insight of expected value being preserved comes from.
        
         | kqr wrote:
         | Confusingly, while this betting strategy is the original
         | "Martingale", it's not really what's meant by the term in
         | probability theory.
         | 
         | An intuitive explanation of martingale in the more technical
         | sense is simply that "your best guess for the future value of a
         | series is its current value". I.e. on average it won't deviate
         | up or down from where it is now, regardless of past values.
         | 
         | But, crucially, that applies at any given time. It means that
         | every time the value moves up and down, you should reset your
         | expectation and believe that whatever value it is now is the
         | new normal.
         | 
         | Some things that are not martingales are
         | 
         | - processes that are biased to move more up than down, or vice
         | versa,
         | 
         | - processes that are mean-reverting, i.e. when they have gone
         | up for a while they are likely to go down again, and
         | 
         | - more generally, processes whose future value can be predicted
         | better by using more information about their recent past.
        
           | sn41 wrote:
           | Thank you for these nice intuitions, especially the negative
           | examples. I liked the second point.
        
       | spapas82 wrote:
       | This gives a mathematical martingale. I only know the betting
       | strategy martingale
       | https://en.m.wikipedia.org/wiki/Martingale_(betting_system)
        
       | hintymad wrote:
       | It's pretty amusing that smart people would think that sigma
       | algebra and the concept of space, let alone equivalent space and
       | random variables in the language of sigma algebra, were
       | "intuitive" in a Prob 101 _tutorial_.
        
       | ajkjk wrote:
       | it's crazy how unhelpful all the sigma algebra theory is for
       | this. It changes none of the logic or intuition; it just
       | obfuscates the hole theory and makes it inaccessible.
        
         | thomasahle wrote:
         | I agree a "Probability 101" article shouldn't use sigma
         | algebras. It definitely cuts off 99.9% of the people that might
         | benefit from the article.
         | 
         | Not that sigma algebras don't have a place. If you are actually
         | doing advanced things with martingales, sigma algebras are nice
         | clean framework to express what you are doing.
        
           | throwaway81523 wrote:
           | It looks like a good article for those who are already
           | studying theoretical probability. For laypeople, not so much.
           | 
           | I haven't yet figured out what the author is doing with the
           | sigma algebra machinery. I had thought that the event set of
           | a probability space was intuitively the power set of the
           | sample set, and that the machinery of sigma algebras was only
           | added to avoid pathologies like non-measurable sets (think
           | Banach-Tarski paradox). Maybe there is more to it?
           | 
           | I would like to understand this better and I do plan to read
           | the article, but I had found the Wikipedia article on
           | martingales to be reasonably understandable a while back. The
           | good thing about this article is it shows applications.
        
       | FreeTrade wrote:
       | The trouble with mathematical approaches to gambling is that
       | while the expected value is taken into account, the emotional
       | value of a bet is rarely considered.
       | 
       | Take a lottery for example - from an expected value point of view
       | it is of course foolish to play most of the time. But the
       | emotional value to the player - he can spend a few dollars and
       | spend the night imagining what he might do with his winnings.
       | That's good value!
       | 
       | With that in mind, I plan to play the martingale next time i go
       | to Las Vegas. I will place a bet of a hundred dollars and rebet
       | until I win a hundred dollars or lose 6300 dollars.
       | 
       | When I win I shall enjoy dinner and drinks courtesy of the casino
       | and feel very good 63 out of 64 nights. Once in a while I'll lose
       | $6300 and feel terrible, but emotional value is summed quite
       | differently to expected value, so it won't out weight the wins.
        
         | throwaway81523 wrote:
         | You want to read about the Kelly criterion for that. Russ
         | O'Connor has a good article explaining why the lottery is a bad
         | deal on that basis: http://r6.ca/blog/20090522T015739Z.html
        
         | Keegs wrote:
         | "The expected value is negative so playing the lottery is
         | silly" also misses that someone looking for a way out of
         | poverty and seeing a lack of alternatives might judge the
         | opportunity cost of his 2 dollars and 5 minutes worth the
         | vanishingly small chance of getting a payout. The choice gets
         | harder to defend the more you play, but I think it's in bad
         | taste to say lotteries are a tax on people bad at math.
        
           | IIAOPSW wrote:
           | Being in poverty and lacking in numeracy and other
           | educational basics correlate. What you point out is no
           | contradiction.
        
         | arcticfox wrote:
         | > Once in a while I'll lose $6300 and feel terrible, but
         | emotional value is summed quite differently to expected value,
         | so it won't out weight the wins.
         | 
         | I'm not sure I'd trade two months of "free" dinners for one day
         | of getting smacked $6300...! To each their own I guess.
        
       | MrPatan wrote:
       | One of my first programs calculated the odds of losing everything
       | with a martingale strategy for a desired outcome and starting
       | capital.
       | 
       | It needed so much capital to get to a safe enough point that it'd
       | be better to just put the money in the bank (but thinking back,
       | this was back before 0 interest rates, so there's another lesson
       | there for you....)
        
       | outside1234 wrote:
       | Is there a slightly less dense version of this for those of us a
       | bit more removed from uni maths somewhere? Willing to read three
       | times as much text to get the same insight. :)
        
         | hansvm wrote:
         | Martingales are a representation of a class of "do a random
         | thing 'forever'" problems, with a self-similarity constraint
         | and also the restriction that your reward is finite, both of
         | which prevent them from being applied to most problems but make
         | them vastly more computationally tractable. That they're well
         | studied means we know some of those features.
         | 
         | The author then mentions a few of those computational
         | properties (like "Azuma's inequality") and gives a smattering
         | of problems where directly applying them and ignoring most of
         | the rest of the article would help build an intuition.
         | 
         | The rest of the article is useful mostly because it puts all of
         | the above in a more rigorous context and because if you're
         | closer to uni maths it'll help provide some sort of intuition
         | for why the restrictions were necessary and what sort of things
         | might or might not be achievable with them. There's probably a
         | less dense version somewhere, but I'm not quite sure what it
         | would be. Hopefully this short summary helps you know what to
         | look for when you find it.
        
         | nerdponx wrote:
         | The article posted here is kind of a crash course in
         | mathematical probability, so don't feel bad for being
         | intimidated or overwhelmed.
         | 
         | The Wikipedia page gives a succinct explanation: https://en.m.w
         | ikipedia.org/wiki/Martingale_(probability_theo....
         | 
         | > ... the conditional expected value of the next observation,
         | given all the past observations, is equal to the most recent
         | observation.
         | 
         | The book _Introduction to Probability Models_ by Sheldon Ross
         | is a solid undergraduate-level introduction to this material.
         | Martingales are covered in chapter 10.
         | 
         | It does use plenty of math notation, but none of the abstract
         | stuff here about triples, filtrations, etc. It might be a bit
         | slow at first as you "reactivate" the mathy parts of your
         | brain, but as long as you read with a pencil and notepad handy
         | you should be able to work through it.
         | 
         | There's actually a full upload of the 11th edition (current is
         | the 12th I believe) on some university course webpage:
         | http://mitran-lab.amath.unc.edu/courses/MATH768/biblio/intro...
        
       | dataflow wrote:
       | The one thing I've never seen any "introduction" to martingale
       | cover is why you should (intuitively) be able to deduce anything
       | useful about them at all, given the expectation is defined not to
       | change (to clarify, I meant expected not to change). Especially
       | when the first example is often the stock market, and everyone
       | knows you can't predict movements of the stock market...
        
         | CrazyStat wrote:
         | >given the expectation is defined not to change.
         | 
         | To be clear, in a martingale the expectation is equal to the
         | current value. It changes as the current value changes (i.e. as
         | time passes).
         | 
         | >Especially when the first example is often the stock market,
         | and everyone knows you can't predict movements of the stock
         | market...
         | 
         | Not being able to predict movements is exactly what "the
         | expectation is equal to the current value" looks like. If you
         | had information that changed your expectation to be different
         | from the current value, that would be predicting a movement in
         | one direction or the other.
        
           | chinaman425 wrote:
           | [dead]
        
         | JustFinishedBSG wrote:
         | > given the expectation is defined not to change.
         | 
         | Sure the unconditional expectation doesn't change, but that's
         | kinda useless because it's the expectation given that you know
         | nothing. The interesting part is studying what is next given
         | what I know right now i.e conditional expectations. And the
         | martingale assumption i.e. "my best guest for tomorrow is the
         | same as right now" is honestly a pretty sensible assumption for
         | many things.
         | 
         | If I tell you $TSLA is at 200 right now, it's not unreasonable
         | to assume it will be around 200 tomorrow.
         | 
         | If it's raining right now, it doesn't seem too far fetched to
         | guess it will probably be raining in 1 minute.
         | 
         | etc.
         | 
         | And because you can prove so many things on martingales, it is
         | often very very useful and powerful when you have something
         | that isn't quite a martingale to think of a way to make it a
         | martingale, prove _whatever_ and then go back to the original
         | object.
        
           | kqr wrote:
           | > If it's raining right now, it doesn't seem too far fetched
           | to guess it will probably be raining in 1 minute.
           | 
           | That's a bit of an unfair example, though. If the Tesla stock
           | is at 200 right now, the martingale property implies that I
           | should expect it to be at 200 not just next minute or
           | tomorrow, but also next week, two years from now, next
           | decade, and so on. A martingale is not restricted in its time
           | scale.
           | 
           | (This is using clearly expectation in the technical sense.
           | The stock price may well go up, or go down, but we can't tell
           | which or how much, so in the grand scheme of things, we're
           | better off assuming it won't move at all.)
        
             | mizzlr_ wrote:
             | To expect a value of 200 means to have the average of 200
             | from this point in time onwards, assuming stock price is
             | random walk. Not that the value tomorrow will be exactly
             | 200. It could be 200, 201, 199, 202, 198 etc. the average
             | expected is 200. If you possess no external knowledge such
             | as insider information, then random walk is a sensible and
             | obvious choice for stock price.
        
             | ChainOfFools wrote:
             | yeah there's a built in assumption that the behavior of the
             | function we're estimating with martigale is continuous near
             | the limit of the guess, and thus predictable over the
             | interval of the guess and the prediction.
        
         | time_to_smile wrote:
         | > everyone knows you can't predict movements of the stock
         | market...
         | 
         | That's why you use a distribution to model the distribution of
         | future possible prices given the information you have today.
         | 
         | The entire point of modeling the market as a martingale: you
         | _don 't_ know what the future price is, but you do know a
         | pretty good deal about where the price might go at various
         | point in the future. Perhaps the single most important thing
         | you know is that the future price is _expected_ to be the same
         | as the current price (ignoring the risk-free rate).
         | 
         | The Martingale property is very important to understand about
         | stocks because if you are certain that the expected price of a
         | stock is less than its current value you should sell, if you
         | believe it will be more you should buy. An entire market
         | thinking like this means that the current price should be equal
         | to the expected future price.
         | 
         | Additionally these models don't "predict" future prices, but
         | rather represent what the _market believes_ about future prices
         | given the current price and other information. This is
         | essential to properly modeling risk and pricing assets.
        
       | nerdponx wrote:
       | I like to see good math topics, but I really can't stand when the
       | example problems are either totally fanciful or totally abstract.
       | I'm too stupid for that. Give me an example of a practical
       | problem in business, finance, engineering, social science, etc.
       | that I can solve with this tool. Does the "dance party" problem
       | have an analogue in real-world allocation and planning problems?
       | Does a gambler gambling an _infinite_ number of times have
       | practical applications in finance? Etc.
        
         | Swizec wrote:
         | > Does a gambler gambling an infinite number of times have
         | practical applications in finance?
         | 
         | If you're running a sovereign investment fund (or Softbank?),
         | that's a lot like gambling with an infinite runway. Hopefully
         | you're using part of that infinite runway to hire people with
         | actual chops in probability and don't need this article.
        
           | chinaman425 wrote:
           | [dead]
        
         | cjohnson318 wrote:
         | I agree, I kept looking for an example of solving the problem
         | that the post opened with: "how much longer until XYZ happens".
         | Maybe I missed it?
        
           | jrumbut wrote:
           | I was expecting survival analysis to show up at some point.
           | 
           | Perhaps it did, at some point I started to skim.
        
       | behnamoh wrote:
       | I wouldn't call this "intuition", more like a detailed and
       | thorough explanation of the topic.
        
       | chasebank wrote:
       | Let's say I'm applying martingale on an index like SPY or QQQ,
       | which I plan to hold otherwise in a tax free retirement account.
       | If I run out of cash to double down, I'm in the same position as
       | I would be otherwise, except I've averaged down my entry price.
       | When the index eventually comes back up, you profit, and resume
       | martingale. How could this be a losing strategy on an asset you
       | plan to hold otherwise?
        
       ___________________________________________________________________
       (page generated 2023-02-23 23:01 UTC)