Professional Documents
Culture Documents
Quiz 5
Quiz 5
Instructions
Este quiz consta de preguntas de opción múltiple, principalmente para reforzar los conceptos teóricos vistos en clase y
repasar algunas partes de programación importantes para el caso de uso estudiado.
Si alguna pregunta contiene código, es perfectamente válido utilizar R Studio para verificar la respuesta. La mayoría del
contenido ya se vio en clase, pero si hay algo nuevo tenderá a ser algo de código que pueden probar por su cuenta.
Tienes cuatro intentos para resolver este quiz y se debe terminar ANTES de la próxima sesión.
Attempt History
Attempt Time Score
KEPT Attempt 3 10 minutes 100.32 out of 100.32
A <- matrix(NA, 3, 3)
for (j in 1:3)
{
A[,j] <- 1:3
}
A
1 1 1
2 2 2
3 3 3
3 2 1
3 2 1
3 2 1
1 2 3
1 2 3
1 2 3
3 3 3
2 2 2
1 1 1
Which of the following is correct regarding p & q in the context of using binomial trees
to valuate options?
p & q are risk neutral probabilities for the price movements up and down, respectively
p & q are always between 0 and 1 and represent the factor that the price moves either up
or down
A matrix with 1's in the last column, while the rest of has 2's in the top-half & 3's in the
bottom-half
A matrix with 1's in the diagonal, 2's in the top-half & 3's in the bottom-half
A matrix with 1's in the diagonal, 3's in the top-half & 2's in the bottom-half
A matrix with 1's in the first column, while the rest of has 2's in the top-half & 3's in the
bottom-half
In the following code, what do the variables "epic" and "rap" do?
-----------------------------------------------------------------------------------------------------------
binomial<-function(n=10,epic="c",rap="e",s0=42,k=40,t=0.5,vol=0.20,r=0.10)
{
dt<-t/n
u<-exp(vol*sqrt(dt))
d<-1/u
p<-(exp(r*dt)-d)/(u-d)
q<-1-p
st<-matrix(0,n+1,n+1)
for(i in 1:(n+1))
{
for (j in i:(n+1))
{
st[i,j]<-s0*u^(j-i)*d^(i-1)
}
}
op<-matrix(0,n+1,n+1)
for(i in 1:(n+1))
{
if(epic == "c") op[i,n+1]<-max(st[i,n+1] - k, 0)
if(epic == "p") op[i,n+1]<-max(k - st[i,n+1], 0)
}
for(j in n:1)
{
for (i in 1:j)
{
op[i,j]<-(op[i,j+1]*p+op[i+1,j+1]*q)*exp(-r*dt)
if(rap == "a" && epic == "c") op[i,j]<-max(op[i,j],st[i,j]-k)
if(rap == "a" && epic == "p") op[i,j]<-max(op[i,j],k - st[i,j])
}
}
return(op[1,1])
}
They define the option premiums and underlier prices trees, respectively
They define the underlier prices and option premiums trees, respectively
A <- matrix(0,3,3)
counter <- 0
for (j in 1:3)
{
for (i in 1:3)
{
counter<-counter+1
A[i,j]<-counter
}
}
1 2 3
4 5 6
7 8 9
1 4 7
2 5 8
3 6 9
3 2 1
6 5 4
9 8 7
7 4 1
8 5 2
9 6 3
m <- matrix(1,5,4)
dt <- t/n
u <- exp(vol*sqrt(dt))
d <- 1/u
p <- (exp(r*dt) - d)/(u - d)
q <- 1 - p
European Call
American Put
American Call
European Put
Question 8 3.04 / 3.04 pts
In the context of Option Pricing with Binomial Trees, if we increase the number of steps
(n)
The following function works for only one type and style of option... which one?
dt <- t/n
u <- exp(vol*sqrt(dt))
d <- 1/u
p <- (exp(r*dt) - d)/(u - d)
q <- 1 - p
European Call
European Put
American Call
American Put
A <- matrix(NA, 3, 3)
for (i in 1:3)
{
A[i,] <- 1:3
}
1 2 3
1 2 3
1 2 3
3 2 1
3 2 1
3 2 1
3 3 3
2 2 2
1 1 1
1 1 1
2 2 2
3 3 3
In the context of option pricing using binomial trees, which of the following code
portions calculates the payoff of a put option in the last column of an option prices tree?
Consider that s is the tree of simulated spot prices, op is the tree of option premiums, k
is the strike price and n is the number of steps.
op<-matrix(0,n+1,n+1)
for (i in 1:(n+1))
{
op[i,n+1]<-max(s[i,n+1]-k,0)
}
op<-matrix(0,n+1,n+1)
for (i in 1:(n+1))
{
op[i,n+1]<-max(k-s[i,n+1],0)
}
op<-matrix(0,n+1,n+1)
for (i in 1:(n+1))
{
op[n+1,i]<-max(k-s[n+1,i],0)
}
op<-matrix(0,n+1,n+1)
for (i in 1:(n+1))
{
for (j in 1:i)
op[i,j]<-max(k-s[i,j],0)
}
}
--------------------------------------------------------------------------------------------------------------------
if (abs(mkt_price - guess_price)<=tolerance) {
return(guess_vol)
} else return("Implied volatility not found, iterations limit reached")
}
guess_vol
counter
tolerance
maxiter
Which of the following is correct regarding the trees used in the context of the binomial
trees method to valuate options?
The first tree simulates underlier prices and and the second tree calculates option prices
The first tree is built from right-to-left and the second tree is built from left-to-right
As long as each tree is built properly, it doesn't matter which is built first
The first tree simulates option prices and the second tree calculates underlier prices
In the context of the Binomial Trees method for options valuation, what does the
following equation do?
where:
Evaluates the payoffs at the last column of the option prices tree
Discounts the average payoff of the next two nodes to the current node
Chooses the greater between the expected future payoff or the payoff of exercising the
call option immediately
Chooses the greater between the expected future payoff or the payoff of exercising the
put option immediately
Question 15 3.04 / 3.04 pts
In the context of option pricing using binomial trees, which of the following code
portions calculates the payoff of a call option in the last column of an option prices
tree? Consider that s is the tree of simulated spot prices, op is the tree of option
premiums, k is the strike price and n is the number of steps.
op<-matrix(0,n+1,n+1)
for (i in 1:(n+1))
{
op[i,n+1]<-max(k-s[i,n+1],0)
}
op<-matrix(0,n+1,n+1)
for (i in 1:(n+1))
{
for (j in 1:i)
op[i,j]<-max(s[i,j]-k,0)
}
}
op<-matrix(0,n+1,n+1)
for (i in 1:(n+1))
{
op[i,n+1]<-max(s[i,n+1]-k,0)
}
op<-matrix(0,n+1,n+1)
for (i in 1:(n+1))
{
op[n+1,i]<-max(s[n+1,i]-k,0)
}
Which of the following commands stores the length of a one-dimensional array (B) in
variable (n)?
B<-1:5
n<-nrow(B)
n<-ncol(B)
n<-length(B)
ncol(B)<-n
The volatility for which the Black-Scholes price equals the market price:
Annualized volatility
Vega
Daily volatility
Implied volatility
In the context of the Binomial Trees method for options valuation, what does the
following equation do?
op[i,j] <- max((op[i,j+1]*p + op[i+1,j+1]*q)*exp(-r*dt), k - st[i,j])
where:
Discounts the average payoff of the next two nodes to the current node
Chooses the greater between the expected future payoff or the payoff of exercising the
put option immediately
Chooses the greater between the expected future payoff or the payoff of exercising the
call option immediately
Evaluates the payoffs at the last column of the option prices tree
Which of the following is correct regarding the types (Call vs Put) and styles (European
vs American) of options that can be valuated using binomial trees?
The option type and style don't affect the underlier prices tree, only the calculation of the
option prices tree changes
If we use the following code to find the implied volatility and assume that the
blackscholes function is correctly defined, which variable serves as a limit of trials to
avoid an infinite loop in case no solution is found?
--------------------------------------------------------------------------------------------------------------------
if (abs(mkt_price - guess_price)<=tolerance) {
return(guess_vol)
} else return("Implied volatility not found, iterations limit reached")
}
guess_vol
maxiter
lb
ub
1 2 3
0 4 5
0 0 6
4 2 1
5 3 0
6 0 0
3 2 1
5 4 0
6 0 0
1 2 4
0 3 5
0 0 6
m <- matrix("a",5,4)
ncol(m)
5
NULL
20
In the context of the Option Pricing Methods we reviewed, what is the following code
portion doing?
----------------------------------------------
st<-matrix(0,n+1,n+1)
for(i in 1:(n+1))
{
for (j in i:(n+1))
{
st[i,j]<-s0*u^(j-i)*d^(i-1)
}
}
A <- matrix(0,3,3)
counter <- 0
for (i in 1:3)
{
for (j in 1:3)
{
counter<-counter+1
A[i,j]<-counter
}
}
1 2 3
4 5 6
7 8 9
1 4 7
2 5 8
3 6 9
7 4 1
8 5 2
9 6 3
3 2 1
6 5 4
9 8 7
In the context of the Binomial Trees method for options valuation, what does the
following equation do?
where:
Discounts the average payoff of the next up and down nodes to the current node
What method did we use to find the Implied Volatlity in an Option Price, according to
the Black-Scholes formula?
Binary Search
Implied YTM
Binomial Trees
After building the option premiums tree, we find out the fair value of the option. Which
variable contains such option price?
Assume that we are using a coding language where matrices begin at (1,1)
s[0,0]
s[1,1]
o[n+1,n+1]
o[1,1]
Question 29 3.04 / 3.04 pts
Which of the following patterns wouldn't work when calculating the underlier's spot
prices tree?
Calculate the payoffs at the last column and then discount their expected values to the
present
Assign s0 to the top-left position, calculate the first row by multiplying the previous price
by u, then the rest of the diagonals by multiplying each previous element by d
Assign s0 to the top-left position, calculate the main diagonal by multiplying the previous
element by d, then the rest of the row elements by multiplying each previous element by u
Multiply s0 by u elevated to the power of "columns - rows" and by d elevated to the power
of "rows" if the matrix positions start with (0,0) or "rows - 1" if the matrix positions start with
(1,1)
more
less
u & d are risk neutral probabilities for the price movements up and down, respectively
u should be greater than 1 and d should be lower than 1 since they are the factors that the
price moves either up or down
If we use the following code to find the implied volatility and assume that
the blackscholes function is correctly defined, what code lines should replace the words
"metal" and "rap"?
--------------------------------------------------------------------------------------------------------------------
if (abs(mkt_price - guess_price)<=tolerance) {
return(guess_vol)
} else return("Implied volatility not found, iterations limit reached")
}
metal: lb <- guess_price & rap: ub <- guess_price
m <- matrix("a",5,4)
nrow(m)
NULL
20