View source: R/PutOptionsOverStrikePrices.R
PutOptionsOverStrikePrices | R Documentation |
This function calculates the value of the a European put option for a list of strike price / sell values, given stock price data and a given future time.
PutOptionsOverStrikePrices(
stock_data,
future_time,
sell_values,
max.p = 5,
max.q = 5,
method = "CSS-ML"
)
stock_data |
Numeric vector of stock prices data. |
future_time |
Numeric constant of the future time |
sell_values |
Numeric vector of the sell values to calculate the put option values at |
max.p |
The maximum order of the autoregressive part of the ARMA model (default is 5) |
max.q |
The maximum order of the moving average part of the ARMA model (default is 5) |
method |
The way that the ARMA model is calculated, accepted values are "ML", "CSS-ML" and "CSS" |
Estimated values of a European put option at different sell values
library(stats)
library(forecast)
n = 100
set.seed(42)
arma_values = arima.sim(n = n, model = list(ar = c(0.6), ma = c(0.5, -0.5)))
linear_model = 5 + 1:n
stock_data = arma_values + linear_model
future_time = 2
sell_values = seq(90, 110, length.out = 5)
PutOptionsOverStrikePrices(stock_data, future_time, sell_values)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.