| ADapply | R Documentation |
These base apply methods have been modified to keep the AD class attribute (which would otherwise be lost).
## S4 method for signature 'advector'
apply(X, MARGIN, FUN, ..., simplify = TRUE)
## S4 method for signature 'ANY'
sapply(X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE)
## S4 method for signature 'ANY'
Vectorize(FUN, vectorize.args = arg.names, SIMPLIFY = TRUE, USE.NAMES = TRUE)
X, MARGIN, FUN, ... |
See apply |
simplify, USE.NAMES |
See sapply |
vectorize.args, SIMPLIFY |
See Vectorize. |
The Vectorize function is especially fast in RTMB, and recommended to be used to speed up long computations where tape construction is a bottleneck.
Object of class "advector" with a dimension attribute.
apply(advector): As apply
sapply(ANY): As sapply
Vectorize(ANY): As Vectorize
F <- MakeTape(function(x) apply(matrix(x,2,2), 2, sum), numeric(4))
F$jacobian(1:4)
f <- Vectorize(function(x) integrate(dnorm, -Inf, x)$value)
F <- MakeTape(f, numeric(1e3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.