Constant-Proportion Portfolio Insurance
Simulate constant-proportion portfolio insurance (CPPI) for a given price path.
CPPI(S, multiplier, floor, r, tau = 1, gap = 1)
S |
numeric: price path of risky asset |
multiplier |
numeric |
floor |
numeric: a percentage, should be smaller than 1 |
r |
numeric: interest rate (per time period tau) |
tau |
numeric: time periods |
gap |
numeric: how often to rebalance. 1 means every timestep, 2 means every second timestep, and so on. |
Based on Dietmar Maringer's MATLAB code (function CPPIgap, Listing 9.1).
See Gilli, Maringer and Schumann, 2011, chapter 9.
A list:
V |
normalised value (always starts at 1) |
C |
cushion |
B |
bond investment |
F |
floor |
E |
exposure |
N |
units of risky asset |
S |
price path |
Original MATLAB code: Dietmar Maringer. R implementation: Enrico Schumann.
Chapter 9 of Gilli, M., Maringer, D. and Schumann, E. (2019) Numerical Methods and Optimization in Finance. 2nd edition. Elsevier. https://www.elsevier.com/books/numerical-methods-and-optimization-in-finance/gilli/978-0-12-815065-8
Schumann, E. (2019) Financial Optimisation with R (NMOF Manual). http://enricoschumann.net/NMOF.htm#NMOFmanual
tau <- 2 S <- gbm(npaths = 1, timesteps = tau*256, r = 0.02, v = 0.2^2, tau = tau, S0 = 100) ## rebalancing every day sol <- CPPI(S, multiplier = 5, floor = 0.9, r = 0.01, tau = tau, gap = 1) par(mfrow = c(3,1), mar = c(3,3,1,1)) plot(0:(length(S)-1), S, type = "s", main = "stock price") plot(0:(length(S)-1), sol$V, type = "s", main = "value") plot(0:(length(S)-1), 100*sol$E/sol$V, type = "s", main = "% invested in risky asset") ## rebalancing every 5th day sol <- CPPI(S, multiplier = 5, floor = 0.9, r = 0.01, tau = tau, gap = 5) par(mfrow = c(3,1), mar = c(3,3,1,1)) plot(0:(length(S)-1), S, type = "s", main = "stock price") plot(0:(length(S)-1), sol$V, type = "s", main = "value") plot(0:(length(S)-1), 100*sol$E/sol$V, type = "s", main = "% invested in risky asset")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.