| Title: | ARMA Models to Value Stock Options |
|---|---|
| Description: | Providing ways to estimate the value of European stock options given historical stock price data. It includes functions for calculating option values based on autoregressive–moving-average (ARMA) models and generates information about these models. This package is made to be easy to understand and for financial analysis capabilities. |
| Authors: | Brian MacCarvill [aut, cre] |
| Maintainer: | Brian MacCarvill <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0.1 |
| Built: | 2026-05-25 08:24:37 UTC |
| Source: | https://github.com/cran/armaOptions |
This function calculates the value of the a European call option for a list of strike price / buy values, given stock price data and a given future time.
CallOptionsOverStrikePrices( stock_data, future_time, buy_values, max.p = 5, max.q = 5, method = "CSS-ML" )CallOptionsOverStrikePrices( stock_data, future_time, buy_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 |
buy_values |
Numeric vector of the buy values at which to calculate the call option values |
max.p |
The maximum order of the Auto Regressive part of the ARMA model (default is set to 5) |
max.q |
The maximum order of the Moving Average part of the ARMA model (default is set to 5) |
method |
The way that the ARMA model is calculated, accepted values are "ML", "CSS-ML" and "CSS" |
Estimated values of a European call option at different buy values
library(stats) library(forecast) # Create simulated data 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 = 3 buy_values = seq(90, 110, length.out = 5) CallOptionsOverStrikePrices(stock_data, future_time, buy_values)library(stats) library(forecast) # Create simulated data 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 = 3 buy_values = seq(90, 110, length.out = 5) CallOptionsOverStrikePrices(stock_data, future_time, buy_values)
This function calculates the value of the a European call option for a list of future time values, given stock price data and a given buy value.
CallOptionsOverTime( stock_data, future_times, buy_value, max.p = 5, max.q = 5, method = "CSS-ML" )CallOptionsOverTime( stock_data, future_times, buy_value, max.p = 5, max.q = 5, method = "CSS-ML" )
stock_data |
Numeric vector of stock prices data. |
future_times |
Numeric vector of the future times |
buy_value |
Numeric value representing the buy value |
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 call option at different future times
library(stats) library(forecast) # Create simulated data 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_times = c(1,3,5) buy_value = 105 CallOptionsOverTime(stock_data, future_times, buy_value)library(stats) library(forecast) # Create simulated data 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_times = c(1,3,5) buy_value = 105 CallOptionsOverTime(stock_data, future_times, buy_value)
This function calculates the value of a European call option based on stock data, a future time value, and a buy value
europeanCallOptionValue( stock_data, future_time, buy_value, max.p = 5, max.q = 5, method = "CSS-ML" )europeanCallOptionValue( stock_data, future_time, buy_value, 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 |
buy_value |
The numeric buy value of the European call option |
max.p |
The maximum order of the autoregressive part of the ARMA model (default is set to 5) |
max.q |
The maximum order of the moving average part of the ARMA model (default is set to 5) |
method |
The way that the ARMA model is calculated, accepted values are "ML", "CSS-ML" and "CSS" |
Estimate the value of a European call option, determine the probability of making profits, and model an appropriate ARMA model for the given stock data
library(stats) library(forecast) # Create simulated data n = 100 set.seed(42) arma_values = arima.sim(n = n, model = list(ar = c(0.5), ma = c(0.5, -0.5))) linear_model = 5 + 1:n stock_data = arma_values + linear_model buy_value = 105 future_time = 1 europeanCallOptionValue(stock_data = stock_data, future_time, buy_value, max.p = 5, max.q = 5)library(stats) library(forecast) # Create simulated data n = 100 set.seed(42) arma_values = arima.sim(n = n, model = list(ar = c(0.5), ma = c(0.5, -0.5))) linear_model = 5 + 1:n stock_data = arma_values + linear_model buy_value = 105 future_time = 1 europeanCallOptionValue(stock_data = stock_data, future_time, buy_value, max.p = 5, max.q = 5)
This function calculates the value of a European put option based on stock data, a future time value, and a sell value
europeanPutOptionValue( stock_data, future_time, sell_value, max.p = 5, max.q = 5, method = "CSS-ML" )europeanPutOptionValue( stock_data, future_time, sell_value, 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_value |
The numeric sell value of the European put option. |
max.p |
The maximum order of the autoregressive part of the ARMA model (default is set to 5) |
max.q |
The maximum order of the moving average part of the ARMA model (default is set to 5) |
method |
The way that the ARMA model is calculated, accepted values are "ML", "CSS-ML" and "CSS" |
Estimate the value of a European put option, determine the probability of making profits, and model an appropriate ARMA model for the given stock data.
library(stats) library(forecast) # Create simulated data 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 europeanPutOptionValue(stock_data = stock_data,future_time = 5,sell_value = 110,max.p = 5,max.q = 5)library(stats) library(forecast) # Create simulated data 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 europeanPutOptionValue(stock_data = stock_data,future_time = 5,sell_value = 110,max.p = 5,max.q = 5)
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" )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)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)
This function calculates the value of the a European put option for a list of future time values, given stock price data and a given buy value.
PutOptionsOverTime( stock_data, future_times, sell_value, max.p = 5, max.q = 5, method = "CSS-ML" )PutOptionsOverTime( stock_data, future_times, sell_value, max.p = 5, max.q = 5, method = "CSS-ML" )
stock_data |
Numeric vector of stock prices data. |
future_times |
Numeric vector of the future times |
sell_value |
Numeric value representing the sell value |
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 future times
library(stats) library(forecast) # Create simulated data 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 sell_value = 110 future_times = c(1, 3, 5) PutOptionsOverTime(stock_data = stock_data, future_times = future_times, sell_value = sell_value)library(stats) library(forecast) # Create simulated data 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 sell_value = 110 future_times = c(1, 3, 5) PutOptionsOverTime(stock_data = stock_data, future_times = future_times, sell_value = sell_value)