Hello,
I am on Julia 0.3.9, I am trying to implement an American Binomial Spread
Options model. I got it working, but am wondering if there is a different
solution, perhaps cleaner one.
I am doing the following to populate the options value's array, and then
loop over the array to simulate the exercise conditions in the tree:
for i in range(N-1, -1, N) ## the outer loop is counting down walking
back in the tree
for j in range(-i, 2, i+1)
for k in range(-i, 2, i+1)
C[k+(N+1), j+(N+1)] = "some value" ## so in order to position
the value to the right location in the Array, I need to adjust the index
with (N+1)
end
end
end
The question really is, can I create a matrix and change the indexing like
A = eye(), so that when A[0, 0] would be the center of the matrix?
Thanks
Sven