Learn R Programming

RTMB (version 1.6)

ADapply: AD apply functions

Description

These base apply methods have been modified to keep the AD class attribute (which would otherwise be lost).

Usage

# S4 method for advector
apply(X, MARGIN, FUN, ..., simplify = TRUE)

# S4 method for ANY sapply(X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE)

Value

Object of class "advector" with a dimension attribute.

Arguments

X

As apply

MARGIN

As apply

FUN

As apply

...

As apply

simplify

As sapply

USE.NAMES

As sapply

Functions

Examples

Run this code
F <- MakeTape(function(x) apply(matrix(x,2,2), 2, sum), numeric(4))
F$jacobian(1:4)

Run the code above in your browser using DataLab