View source: R/matrix_interpolation.R
matrix_interpolation | R Documentation |
The matrix_interpolation function interpolate values for vector.
matrix_interpolation(Value_matrix, ds, dt, I, asset_price, time, End_Time)
Value_matrix |
numeric matrix, returns from finite different algorithm or delta_finite_difference function. |
ds |
numeric value, step size of the asset price. |
dt |
numeric value, step size of the time. |
I |
numeric value, number of steps in the stock price. |
asset_price |
numeric vector, the price of the asset over the life of the option. |
time |
numeric vector, actual time. |
End_Time |
numeric value, end time of the option. |
If asset price is bigger then I*ds, we take value from this element of the matrix where asset_price = I*ds.
A numeric vector, interpolated value of option price or numbers of asset when asset_price is an argument.
ds <- finding_parameters(100, 0.3, 600, 5)[1] dt <- finding_parameters(100, 0.3, 600, 5)[2] option <- finite_difference_explicit(ds, dt, 600, 0, 0.3, 1, call_payoff, 100) matrix_interpolation(option, ds, dt, 600, c(259, 150), c(0, 0.5), 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.