search for: doubleint

Displaying 2 results from an estimated 2 matches for "doubleint".

2007 Aug 23
1
Expedite scalar f(x) evaluation over vectors
Dear R community, I am trying to code a fairly complex equation for optim(). My current approach is too slow for optim(). I have a function that takes a double integral (hopefully correctly) across two terms, e.g., doubleint <- function(c1,c2) {integrate(function(y) { sapply(y, function(y) { integrate(function(x) {a*(c1+x)+b*(c2+x)}, boundsx[1], boundsx[2])$value }) }, boundsy[1],boundsy[2]) } I would like to rapidly evaluate this function over vectors c1 and c2 of equal length where the double integ...
2007 Aug 23
1
Clarification: Expedite scalar f(x) evaluation over vectors
...g Dear R community, I am trying to code a fairly complex equation for optim(). My current approach is too slow for optim(). I have a function that takes a double integral (hopefully correctly) across two terms, e.g., <<note replacement of example function by hypothetical f(x,y)>> doubleint <- function(c1,c2) {integrate(function(y) { sapply(y, function(y) { integrate(function(x) {f(x,y)}, boundsx[1], boundsx[2])$value }) }, boundsy[1],boundsy[2]) } <<I do not have a closed form for the real function>> I would like to rapidly evaluate this function over...