Displaying 1 result from an estimated 1 matches for "gridsecpp".
2006 Nov 18
2
overhead of function calls
...rithmetic with it (adding
constants, multiplication). With R being a functional programming
language, I implemented this by calling several functions inside the
function:
## RHS of bellman equation
f <- function(knext,k,ei) {
util(consf(knext,k))+quickeval(knext,gridsecpp,Vkbarpp)
}
where quickeval evaluates a spline at knext (on gridsecpp, pp-form
Vkbarpp), util is a function in the environment, and so is consf:
## consumption
consf <- function(knext,k) {
rp*k+W+knext*A
}
A, W, and rp are constants in the environ...