README.md

StockPriceSimulator

Introduction

This package provide a way to simulate a fully random stock ticker based on theory provided by __“Stochastic Calculus For Finance ii”, Shreve“__

Functions provided by the package

Key functions

Optionals or peripherals functions

Description of the functions as they was created and defined

sstock()

Summary

It returns a data.frame containing the following variables:

Arguments

Arguments Default Description time_to_maturity 4 Final time up to the Stock Price Path goes seed 1 It fixes initial value of the pseudo random number generation in order to get reproducible experiments. scale 100 Define the partition of the time period. sigma 1

Example of Usage

library(StockPriceSimulator)

## 
## Attaching package: 'StockPriceSimulator'

## The following object is masked from 'package:base':
## 
##     gamma

stock_tick <- sstock()

### sstock()

Summary

It returns a data.frame containing the following variables:

The computed path is based on approximation given by the Itô’s formula.

Arguments

Arguments Default Description time_to_maturity 4 Final time up to the Stock Price Path goes seed 1 It fixes initial value of the pseudo random number generation in order to get reproducible experiments. scale 100 Define the partition of the time period. sigma 1 standard deviation of the stock alpha 0 Mean trend

Example of Usage

library(StockPriceSimulator)
## Call the path generating function from equation:
stock_tick <- sstock(scale = 1000)
## Call the path generating function from Itôs approximation
stock_tick_ito <- sstock_ito(scale = 1000)

delta()

Delta return the position one should take in order to hedge a short position in a call.

theta()

gamma()

Test Black-Scholes-Merton function

# Create a stoch price motion from 0 to 4(Year) with a daily step
S <- sstock(initial_stock_price = 50,
            time_to_maturity = 4,
            scale = 360)
# According to the previous sampled path, the option price is computed
# With option in the money
C <- BSM(stock_path = S)



AnthonyTedde/StockPriceSimulator documentation built on May 17, 2019, 5:39 p.m.