losses | R Documentation |
The losses function calculate gains/losses between portfolio and option price.
losses(option_value, portfolio)
option_value |
numeric vector, price of the option over time. |
portfolio |
numeric vector, value of the portfolio over time. |
A numeric vector, gains/losses during hedging.
x <- generate_scenarios(100, 0.05, 0.3) #real measure time_period <- seq(0, 1, 1/250) option <- call_price(x[, 1], 100, 0, 0.3, time_period, 1) Xi <- Xi_call_price(x[, 1], 100, 0, 0.3, time_period, 1) portfolio <- portfolio_valuation(option[1], 0, Xi, x[, 1]) losses(option, portfolio)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.