Learn R Programming

RcppFastAD (version 0.0.4)

quadratic_expression: Compute the value and derivate of a quadratic expression X' * Sigma * X

Description

Compute the value and derivate of a quadratic expression X' * Sigma * X

Usage

quadratic_expression(X, Sigma)

Value

A list with two elements for the expression evaluated for X and Sigma as well as

Arguments

X

A 2 element vector

Sigma

A 2 x 2 matrix

Examples

Run this code
X <- c(0.5, 0.6)
S <- matrix(c(2, 3, 3, 6), 2, 2)
quadratic_expression(X, S)

Run the code above in your browser using DataLab