Is there a way to calculate expected value from probabilistic data?

In summary, the conversation discussed a python simulation of 1,000 games of toss with 50/50 odds and 100,000 consecutive flips. The result showed a normal distribution around the starting balance of 1000, with an average value of 1000. However, when a stop-loss was introduced at a lower balance, there was still no net profit. The participants then discussed the possibility of an inclined stop-loss leading to a change in expected value, but it was determined that this would only reduce the variance and not increase the expected value.
  • #36
Feynstein100 said:
1020 * 0.5 + 980 * 0.5 = 1000
Yes but that is trivial, what @Office_Shredder was asking is more interesting: 1060 * ? + 980 * ? = ?
 
  • Like
Likes jbriggs444
Mathematics news on Phys.org
  • #37
pbuk said:
Yes but that is trivial, what @Office_Shredder was asking is more interesting: 1060 * ? + 980 * ? = ?
Eh idk. In the end it should still come out to 1000. 1060 may be a higher value but it's less likely to happen than 980. These two factors balance each other out and the result is still 1000.
 
  • #38
Hornbein said:
The expected value is not a function of standard deviation.
@BWV
Turns out, there's more to this. I took this from Wikipedia:
1663710083312.png

Here, mu is the mean/expected value. So while mu isn't a function of sigma, the two do interact with each other. It's just that when you change sigma, you also change the probability and the resulting data points, in just such a way that mu remains unchanged. My hunch was correct, in a sense 😀
 
  • #39
This is a general statement that if you want to compute the standard deviation, you have to subtract the mean out. This is actually what prevents them from usually being related - if you adjust the mean by adding some quantity to every outcome, that doesn't affect the standard deviation at all.
 
  • Like
Likes Feynstein100, BWV, Hornbein and 1 other person
  • #40
Feynstein100 said:
Eh idk. In the end it should still come out to 1000. 1060 may be a higher value but it's less likely to happen than 980. These two factors balance each other out and the result is still 1000.
We are trying to solve for the probability ratio. I do not know if @Office_Shredder has a particular approach in mind, but here is how I would attack it.

Let ##p## be the probability of first hitting 980. Then ##1-p## is the probability of first hitting 1060. We are in an infinite random walk (as I recall), so the probability of never hitting either is obviously zero.

We know that the mean of the infinite random walk needs to be 1000 because that is the starting point and every step is unbiased. So we write down an equation: ##980 p + 1060(1-p) = 1000##

Now we just have to solve for p. Easy algebra. Then write down the ratio in the form ##p:1-p##.

If intuition serves, we should find that the sides of the ratio are in inverse proportion to each side's deviation from the mean. The deviations are 20:60 so the probability ratio will be 3:1.

[It feels like there should be some more directly compelling algebra if I'd made a better choice of variables. But I will not change horses mid-stream]

Let us see whether the algebra bears this out...

##980p + 1060 (1-p) = 1000##
##(980 - 1060)p + 1060 = 1000##
##-80p = -60##
##p = \frac{3}{4}##
##1-p = \frac{1}{4}##

Ratio = 3:1

Bingo.
 
  • #41
jbriggs444 said:
We are trying to solve for the probability ratio. I do not know if @Office_Shredder has a particular approach in mind, but here is how I would attack it.

Let ##p## be the probability of first hitting 980. Then ##1-p## is the probability of first hitting 1060. We are in an infinite random walk (as I recall), so the probability of never hitting either is obviously zero.

We know that the mean of the infinite random walk needs to be 1000 because that is the starting point and every step is unbiased. So we write down an equation: ##980 p + 1060(1-p) = 1000##

Now we just have to solve for p. Easy algebra. Then write down the ratio in the form ##p:1-p##.

If intuition serves, we should find that the sides of the ratio are in inverse proportion to each side's deviation from the mean. The deviations are 20:60 so the probability ratio will be 3:1.

[It feels like there should be some more directly compelling algebra if I'd made a better choice of variables. But I will not change horses mid-stream]

Let us see whether the algebra bears this out...

##980p + 1060 (1-p) = 1000##
##(980 - 1060)p + 1060 = 1000##
##-80p = -60##
##p = \frac{3}{4}##
##1-p = \frac{1}{4}##

Ratio = 3:1

Bingo.
Oh.....kay? Don't get me wrong. That was quite interesting but I was kinda expecting a cheat or a workaround of some kind 😅 As it stands, we're right where we started. Conservation of expectation value shall not be violated.
 
  • #42
Feynstein100 said:
Oh.....kay? Don't get me wrong. That was quite interesting but I was kinda expecting a cheat or a workaround of some kind 😅 As it stands, we're right where we started. Conservation of expectation value shall not be violated.
Right. Re-read #31. @Office_Shredder is not trying to prove conservation of expected value. He is trying to use the principle of conservation of expected value to reach a conclusion about the probability of hitting the stop points.

Conservation of expected value is on pretty solid ground (for a reasonable set of assumptions). I took the assumption to be a starting bankroll of 1000 quatloos and a series of unbiased coin flips that result in a gain or loss of 1 quatloo with probability 0.5 each (an unbiased infinite random walk) with stop points at 980 quatloos or 1060 quatloos.
 
  • #43
Office_Shredder said:
This is a general statement that if you want to compute the standard deviation, you have to subtract the mean out. This is actually what prevents them from usually being related - if you adjust the mean by adding some quantity to every outcome, that doesn't affect the standard deviation at all.
Ah okay. It's more nuanced than I'd anticipated. Btw the equations don't tell us how they change when we use a stop-loss to change sigma. I mean, I kind of discovered it empirically from my python code but is there a way to see it happen mathematically? A proof or something? Idk. I tried to read the proof of the optional stopping theorem but it was beyond me. Way too abstract lol.
 
  • #44
jbriggs444 said:
Right. Re-read #31. @Office_Shredder is not trying to prove conservation of expected value. He is trying to use the principle of conservation of expected value to reach a conclusion about the probability of hitting the stop points.
Oh. My bad. I thought we were trying to find a workaround/loophole 😅
 
  • #45
Feynstein100 said:
Oh. My bad. I thought we were trying to find a workaround/loophole 😅
There are none unless you decide to allow shenanigans such as unbounded bets. e.g. a Martingale scheme. There was a reference upthread to a relevant theorem.
 
  • #46
The sum of the expectations is the expectation of the sum. Each bet has zero expectation. So the expectation of the sum of those bets is zero. It doesn't matter how you decide whether or not to make those bets.
 
Last edited:
  • Like
Likes Feynstein100 and jbriggs444
  • #47
Is conservation of expected value is just another way of stating the process is a Martingale - defined as E(T1)=E(Tn) for all n. Not every process would have this attribute
 
  • Like
Likes Feynstein100
  • #48
Feynstein100 said:
@BWV
Turns out, there's more to this. I took this from Wikipedia:
View attachment 314407
Here, mu is the mean/expected value. So while mu isn't a function of sigma, the two do interact with each other. It's just that when you change sigma, you also change the probability and the resulting data points, in just such a way that mu remains unchanged. My hunch was correct, in a sense 😀
If you want to see where the variance influence the mean, change the payoff to + or - 10% of the previous value then compare to another where it is + or - 50% (does not change the mean but the expectation relates to the difference between the mean and median: at + or - 50% you almost surely will go broke if you play long enough even though the expected gain/loss is zero
 
  • #49
BWV said:
Is conservation of expected value is just another way of stating the process is a Martingale - defined as E(T1)=E(Tn) for all n. Not every process would have this attribute
Sorry I didn't get that. Could you explain it again? 😅
 
  • #50
Feynstein100 said:
Sorry I didn't get that. Could you explain it again? 😅
Does this wiki page make it any more clear?
 
  • #51
Office_Shredder said:
The average profit should not be higher @FactChecker the graph they put in the original post is a terrible way of visualizing what is going on.
@jbriggs444
Here's the frequency distribution of outputs at the end of each game:
Frequency1.png

This is without the stop-loss.
Frequency2.png

This is with the stop-loss at 980. The right side actually goes on for quite a while but I wanted the spike at the stop-loss to be visible.
 
  • #52
Rather than play around with this, do you think it would be a good idea to learn about probability and statistics in a more structured way? This would prevent you wasting time going down blind alleys, help you focus on what is important, and perhaps also introduce you to even more interesting problems.

You could look at this open course which covers the material touched on in this post:
https://ocw.mit.edu/courses/18-440-probability-and-random-variables-spring-2014/

Or for a more general introduction to probablity and statistics try here:
https://ocw.mit.edu/courses/18-05-introduction-to-probability-and-statistics-spring-2014/
 
  • Like
Likes Feynstein100
  • #53
pbuk said:
Rather than play around with this, do you think it would be a good idea to learn about probability and statistics in a more structured way? This would prevent you wasting time going down blind alleys, help you focus on what is important, and perhaps also introduce you to even more interesting problems.

You could look at this open course which covers the material touched on in this post:
https://ocw.mit.edu/courses/18-440-probability-and-random-variables-spring-2014/

Or for a more general introduction to probablity and statistics try here:
https://ocw.mit.edu/courses/18-05-introduction-to-probability-and-statistics-spring-2014/
Thanks for the recommendations. I'll check them out. However, I don't see any problem with playing around. There's really no substitute for firsthand experience. For instance, if I hadn't messed around with this, I wouldn't have learned that stop-losses and take-profits don't change the expected value. I can't help but wonder what profound implications that might have for daytrading. But then again, is the stock market inherently probabilistic? I'm inclined to think not. And even if it were, it has a net positive expectation value over time. How does that affect our simulation? Is the simulation even applicable? Those are the kinds of questions that interest me.
 
  • #54
Feynstein100 said:
Thanks for the recommendations. I'll check them out. However, I don't see any problem with playing around. There's really no substitute for firsthand experience. For instance, if I hadn't messed around with this, I wouldn't have learned that stop-losses and take-profits don't change the expected value. I can't help but wonder what profound implications that might have for daytrading. But then again, is the stock market inherently probabilistic? I'm inclined to think not. And even if it were, it has a net positive expectation value over time. How does that affect our simulation? Is the simulation even applicable? Those are the kinds of questions that interest me.

Anyone with a bit of probability knowledge can immediately tell you that giving the stock positive drift means your stop loss order can only lower the expected value. You don't need to run simulations and ponder whether you got the right result when you understand the underlying concepts.
 
  • Like
Likes pbuk
  • #55
Office_Shredder said:
giving the stock positive drift
I don't know what that means 😅 But based on personal experience, stop-losses do seem to make a difference in daytrading. How can we explain that?
 
  • #56
Feynstein100 said:
I don't know what that means 😅 But based on personal experience, stop-losses do seem to make a difference in daytrading. How can we explain that?
You could try following the advice I gave a few days ago.
pbuk said:
@Feynstein100 you don't need to do any maths to see that the stop loss does not change the expected value if returns are symmetrical, you just need to look at the symmetry. Think about the expected value of the investments you sell at 980.

Once you have thought this through, see if you can predict what a stop loss will do in a rising market, then run a simulation.
 
  • #58
pbuk said:
You could try following the advice I gave a few days ago.
Yeah I didn't find that helpful at all. I mean, the whole reason I posted here is because based on the symmetry, I anticipated an increasing expected value then couldn't figure out why that wasn't true.
I have no idea what a stop-loss would do in a bull market. I expect it to not even be relevant because if the market is indeed ascending then the stop-loss shouldn't even be triggered. That's kind of the point, isn't it? In a bull market, a stop-loss is basically non-existent. In a bear market, the stop-loss minimizes your losses. Looks good on paper but how does it fare in reality?
 
  • #59
Feynstein100 said:
Yeah I didn't find that helpful at all. I mean, the whole reason I posted here is because based on the symmetry, I anticipated an increasing expected value then couldn't figure out why that wasn't true.
I have no idea what a stop-loss would do in a bull market. I expect it to not even be relevant because if the market is indeed ascending then the stop-loss shouldn't even be triggered. That's kind of the point, isn't it? In a bull market, a stop-loss is basically non-existent. In a bear market, the stop-loss minimizes your losses. Looks good on paper but how does it fare in reality?
Define bull vs bear market - how do you know which state you are in until after the fact?
 
  • #60
The way I see it, there are only a few ways to make money in the stock market.

You can be smarter than most everyone else. That is hard to arrange. It is even harder if you give up and try to pretend that it's all just random.

You can be faster than most everyone else. Also hard to arrange. Fast switches, routers and algorithms.

You can know more than everyone else. Sometimes, that's doing your homework. Other times, it's called insider trading.

You can manipulate news articles and such and thereby manipulate market prices.

You can buy and hold and trust that the companies whose stock you bought will make make a good return on investment.

You can convince someone else that you are skilled enough so that they will pay you to invest their money for them.

My impression is that day trading is like poker. You make your money off of people that think that they are good enough to make money off of you. But it is a negative sum game. Somebody has to lose.
 
  • Like
Likes BWV
  • #61
BWV said:
Define bull vs bear market - how do you know which state you are in until after the fact?
Well, you don't. That's kind of why we're doing all this? If you knew beforehand whether you were going to get a heads or tails, you wouldn't have to worry about the probabilities now, would you?
 
  • #62
jbriggs444 said:
But it is a negative sum game. Somebody has to lose.
A rising market is not a negative sum game.

Feynstein100 said:
Well, you don't. That's kind of why we're doing all this? If you knew beforehand whether you were going to get a heads or tails, you wouldn't have to worry about the probabilities now, would you?
No we don't have perfect knowledge, so we make assumptions, build a model, make predictions using the model, and test them. This is science.

Just throwing guesses around is not science, it is a waste of time.
 
  • #63
pbuk said:
A rising market is not a negative sum game.
outperforming a rising market is zero sum before fees and expenses, negative sum after
 
  • Like
Likes jbriggs444
  • #64
BWV said:
outperforming a rising market is zero sum before fees and expenses, negative sum after
But the game we are discussing here is the market itself (which by definition when rising is positive sum before fees and expenses), not outperformance of the market.
 
  • #65
pbuk said:
A rising market is not a negative sum game
With daytrading, it is.
 
  • #66
jbriggs444 said:
With daytrading, it is.
That sounds interesting. Would you care to elaborate?
 
  • #67
Feynstein100 said:
That sounds interesting. Would you care to elaborate?
Every time you make a trade, some money rubs off. Trade often enough and the amount of money that rubs off will exceed any reasonable ROI that would accrue from a "buy and hold" strategy.
 
  • #68
jbriggs444 said:
Every time you make a trade, some money rubs off. Trade often enough and the amount of money that rubs off will exceed any reasonable ROI that would accrue from a "buy and hold" strategy.
I don't think that applies to commission-free trading we have these days
 
  • #69
Feynstein100 said:
I don't think that applies to commission-free trading we have these days
Google bid/ask spread
 
  • #70
BWV said:
Google bid/ask spread
No, I know what that is. Unless you're a high-frequency trader, it doesn't really make much of a difference from what I know.
 
<h2>1. What is expected value?</h2><p>Expected value is a mathematical concept that represents the average outcome of a random event over a large number of trials. It is calculated by multiplying each possible outcome by its probability and summing all of these values.</p><h2>2. How is expected value calculated from probabilistic data?</h2><p>Expected value is calculated by multiplying each possible outcome by its probability and summing all of these values. This can be represented by the formula E(X) = Σ x * P(x), where x is the possible outcome and P(x) is the probability of that outcome.</p><h2>3. Can expected value be negative?</h2><p>Yes, expected value can be negative. This can occur when the possible outcomes have a negative value and their probabilities are high enough to outweigh the positive outcomes.</p><h2>4. How is expected value useful in decision making?</h2><p>Expected value can be useful in decision making by providing a way to quantify the potential outcomes of a decision and assess the associated risks. It can help in choosing the option with the highest expected value or in determining the level of risk that is acceptable.</p><h2>5. Are there any limitations to using expected value?</h2><p>Yes, there are limitations to using expected value. It assumes that all possible outcomes are known and that the probabilities assigned to each outcome are accurate. In reality, this may not always be the case and can lead to inaccurate or unreliable results.</p>

1. What is expected value?

Expected value is a mathematical concept that represents the average outcome of a random event over a large number of trials. It is calculated by multiplying each possible outcome by its probability and summing all of these values.

2. How is expected value calculated from probabilistic data?

Expected value is calculated by multiplying each possible outcome by its probability and summing all of these values. This can be represented by the formula E(X) = Σ x * P(x), where x is the possible outcome and P(x) is the probability of that outcome.

3. Can expected value be negative?

Yes, expected value can be negative. This can occur when the possible outcomes have a negative value and their probabilities are high enough to outweigh the positive outcomes.

4. How is expected value useful in decision making?

Expected value can be useful in decision making by providing a way to quantify the potential outcomes of a decision and assess the associated risks. It can help in choosing the option with the highest expected value or in determining the level of risk that is acceptable.

5. Are there any limitations to using expected value?

Yes, there are limitations to using expected value. It assumes that all possible outcomes are known and that the probabilities assigned to each outcome are accurate. In reality, this may not always be the case and can lead to inaccurate or unreliable results.

Similar threads

  • Calculus and Beyond Homework Help
Replies
8
Views
1K
  • Quantum Physics
Replies
7
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • Precalculus Mathematics Homework Help
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
9
Views
6K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
8K
Replies
1
Views
4K
Back
Top