cf_lattice_pricing: Option pricing with the multinomial model

View source: R/cf_lattice_princing.R

cf_lattice_pricingR Documentation

Option pricing with the multinomial model

Description

Function for pricing an option with a multinomial model

Usage

cf_lattice_pricing(Q, EQ, R, S, option, type = "E")

Arguments

Q

equivalent discrete martingale measure

EQ

discrete version of the equivalent discrete martingale average

R

term structure of the interest rate, could be a fixed value or a multinomial lattice

S

multinomial lattice

option

function defining the option over S

type

option type a character that specifies the king of option, by default 'E' european option, 'A' american option, 'F' futures option, 'S' swap option, 'P' ...

Value

A list with a tree structure of the asset evolution

Author(s)

Pedro Guarderas

See Also

cflattice-class

Examples

s <- 0.3
T <- 0.25
N <- 15
c <- 0.01
u <- exp( s * sqrt( T / N ) )
d <- 1 / u
r <- 0.02
S0 <- 100
K <- 110
R <- exp( r * T / N )
q <- ( R - d ) / ( u - d )
Q <- c( 1 - q, q )
U <- c( d, u )

# K is global
call <- function( S ) {
  max( S - K, 0 )
}

put <- function( S ) {
  max( K - S, 0 )
}

# Equivalent measure
EQ <- function( R, Q, C ) {
  return( sum( R * Q * C ) )
}

S <- cf_lattice( N, U, S0 )

# Pricing zero coupon bond
ZCB <- cf_lattice_pricing( Q, EQ, R, S, identity, type = 'A' )

# Pricing american call
Ca <- cf_lattice_pricing( Q, EQ, R, S, call, type = 'A' )

# Pricing american put
Pa <- cf_lattice_pricing( Q, EQ, R, S, put, type = 'A' )

pedroguarderas/CFINI documentation built on Feb. 16, 2024, 2:17 p.m.