We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For Figure 2.6, is the summation not wrong here? In the book, equation (2.36) states that:
where in the code (both Python and MATLAB), the value of s is computed as
s
QuantFinanceBook/PythonCodes/Chapter 02/Fig02_06.py
Lines 31 to 35 in 7b8ca25
but shouldn't it instead be:
s = 0 for i in range(0, len(X) - 1): s = s + np.power(X[i+1] - X[i] - mu * dt, 2)
In our implementation, we get
$$\hat{\mu} = 0.0014 \quad , \quad \hat{\sigma} = 0.0318$$
using
mu = 1/(m * dt) * (X[-1] - X[0]) s = 1/(m * dt) * np.sum([(X[i + 1] - X[i] - mu * dt) ** 2 for i in range(len(X) - 1)]) sigma = sqrt(s)
The text was updated successfully, but these errors were encountered:
Resulting plot:
Sorry, something went wrong.
No branches or pull requests
For Figure 2.6, is the summation not wrong here? In the book, equation (2.36) states that:
where in the code (both Python and MATLAB), the value of
s
is computed asQuantFinanceBook/PythonCodes/Chapter 02/Fig02_06.py
Lines 31 to 35 in 7b8ca25
but shouldn't it instead be:
In our implementation, we get
using
The text was updated successfully, but these errors were encountered: