Learn R Programming

LaMa (version 2.0.4)

minmax: AD-compatible minimum and maximum functions

Description

These functions compute the parallel minimum/ maximum of two vector-valued inputs and are compatible with automatic differentiation using RTMB.

Usage

min2(x, y)

max2(x, y)

Value

min2 returns the parallel minimum and max2 the parallel maximum of x and y

Arguments

x

first vector

y

second vector

Examples

Run this code
x <- c(1, 4, 8, 2)
y <- c(2, 5, 3, 7)
min2(x, y)
max2(x, y)

Run the code above in your browser using DataLab