question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expected Maximum Value

See original GitHub issue

Thanks for this tool! I really like the presentation and I hope we can make it as accurate as possible.

To that end, I’d like to propose an “Expected Maximum” column similar to the current “Guaranteed Minimum” and “Potential Maximum” columns. The Expected Maximum column would indicate the expected value of the maximum sell price in the remainder of the week. I made my case for including this metric in #170 while discussing the various non-uniformities in prices but, to summarize, it would be the most useful single metric to compare patterns between different islands, and it’s fortunately not challenging to estimate.

Some patterns, like the peak of a small-spike, may have a non-obvious mean when the price distribution is non-uniform, and a naïve estimate based only on the bounds of the valid range could be misleading for users making comparisons. Providing an “Expected Maximum” column makes it much easier to accurately compare your expected profit between one island and another and decide to sell now or wait for the prices on your friend’s island.

The expected maximum of a fluctuating subpattern is the expected maximum among all the remaining high phase days (rate ~ [0.9, 1.4)) or low phase days if no high-phase days remain (high phase 3 has duration 0). That’s min + n*(max-min)/(n+1). It’s above the mean high-phase price because the player has several chances to beat the mean.

The expected maximum of a high-spike subpattern is the expected value of the peak for days before the peak, equal to the current sell price on the falling edge of the peak, and similar to Fluctuating in the low phase.

For a decreasing subpattern the expected maximum is always the current selling price.

The expected maximum of a small-spike subpattern is the expected value of the peak for days before the peak, so rate=1.7 with unknown off-peak rate, or rate=1.4 + (2.0 - oprate)/log((2.0 - 1.4)/(oprate - 1.4)) given the off-peak rate. After the spike it’s always the current selling price since the rate constantly decays.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:17

github_iconTop GitHub Comments

1reaction
abrad45commented, Apr 29, 2020

Thanks for reading my wall of text!

I had to skip your ordered list full of math, but otherwise, any time 😉

I was hoping no one would mention multiple stalk markets 😅

😂 thanks for the laugh

So if you’re a real turnip power user then the entire output could be replaced with a giant <h1>Have you hit a large spike yet?</h1><h2>YES/NO</h2> and almost no other feature can add value.

Yes and no. I use the feature to know what others may benefit from, too. I was simply saying that I think the goal should just be telling people the most they can get on their home island. If they don’t have NSO and no one to Local Play with, then that’s the most they can get, period. If they do have NSO and friends playing the game, then telling them to sell at 78 because it’s only going to go down from there may be awful advice.

It was more about the wording of the feature than specifically saying your algorithm should account for the size of ones’ social group and the likelihood that they’ll have a higher price without knowing any information about their islands 😃 I believe you’d call that a hard-ish problem 😉

1reaction
sobelscommented, Apr 29, 2020

@abrad45 Thanks for reading my wall of text! A few points here:

If, by this, you mean that buying at ~100 bells and selling for ~80 bells is a ~20 bell loss per turnip, and bells are easy to make in the game, I think that’s an odd argument, but fine.

That is what I was driving at. There is a Gambler’s Ruin problem at play like @ZZZZzzzzac noted but I honestly don’t know how frequently it would occur without constructing the sell/hold recommender and running a bunch of simulations with it.

I have a slack channel at work with 30+ members who all check twice daily. People take this fairly seriously, so I think if we’re not sure we can add value with a feature like this, it’d be better to not do than to build a clearly label a feature “experimental” because we aren’t sure how much it’s going to help you but it made some math nerds happy 😉

The Stalk Market Multiverse

I was hoping no one would mention multiple stalk markets 😅

If you want to treat the multi-market problem numerically, the decision becomes hold / sell at A / sell at B / sell at C / … . From what I can tell I think this problem is much harder from an algorithms perspective, but in the limit where we’re at 30+ islands the intuitive answer is obviously to wait for the nearly-inevitable large spike on someone’s island.

So if you’re a real turnip power user then the entire output could be replaced with a giant <h1>Have you hit a large spike yet?</h1><h2>YES/NO</h2> and almost no other feature can add value.

But if you’re in 1, 2, or 3 markets at most like me you struggle to decide whether to sell / hold in many plausible scenarios (like say, you’re both in a fluctuating pattern). Personally the guaranteed minimum / potential maximum don’t really help me. If you have many “high” days left then you should have higher standards for selling - but exactly how high should your standards be? I’m definitely nerding out here but that’s the value I’m chasing after. I’m not sure if a sell/hold oracle is the right way to do it but I’m a solid 80% sure that software could do it better than my feeble brain.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expected Value of Max of IID Variables - Math Stack Exchange
What's the expected value of the maximum of one IID uniform random variable? What is the expected value of the maximum of two?...
Read more >
Finding the Expected Value of the Maximum of n Random ...
Finding the Expected Value of the Maximum of n Random Variables ... Plugging these values into our equation above (and noting we have...
Read more >
How to find the expected value of the maximum of [math] n ...
The expected value of is equal to . The expected value of is equal to . Here both integrals are taken over the...
Read more >
Expected value - Wikipedia
The expected value of a random variable with a finite number of outcomes is a weighted average of all possible outcomes. In the...
Read more >
A Formula for the Expected Value of the Maximum of
for the expected value of the maximum of a collection of n independent, but not iid, normal variables. Since a general formula is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found