Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check formula for calculating the new state in Process1 #313

Open
bhardwajshivam opened this issue Dec 16, 2023 · 1 comment
Open

Check formula for calculating the new state in Process1 #313

bhardwajshivam opened this issue Dec 16, 2023 · 1 comment

Comments

@bhardwajshivam
Copy link

The code mentions: return Process1.State(price=state.price + up_move * 2 - 1)
Where as its a logistic function of (L-Xt).
Why is up_move multiplied by 2 and subtracted by 1?

@AI-Ahmed
Copy link

AI-Ahmed commented Jan 21, 2024

Hello there @bhardwajshivam,
Given that the $\mathbb{P}[X_{t+1} = X_{t} + 1]$ is the probability of of moving up. Likewise, $\mathbb{P}[X_{t+1} = X_{t} - 1]$ is the probability of moving down. Hence, $\mathbb{P}[X_{t+1} = X_{t} - 1] = 1 - \mathbb{P}[X_{t+1} = X_{t} + 1]$ by the complement rule.

If you rearrange the formula, you can say that $\mathbb{P}[X_{t+1} = X_{t} + 1] + \mathbb{P}[X_{t+1} = X_{t} - 1] = 1$, which is similar is equal to $2\mathbb{P}[X_{t+1} = X_{t} + 1] - 1$.

This is similar to the code you mentioned:

Process1.State(price=state.price + 2 * up_move - 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants