Lambda <- function(x) matrix(c(-0.1, 0.1, 0, -0.1), 2, 2)
R <- function(x, mu) matrix(c(0, 0, 0, mu), 2, 2)
rentefun <- function(x) { 0.01 + 0.001 * x } # Dynamic interest rate
sreserve(0, 80, Lambda, R, 200000, rentefun, 1000)
Run the code above in your browser using DataLab