Learn R Programming

CVXR (version 1.0-14)

mean.Expression: Arithmetic Mean

Description

The arithmetic mean of an expression.

Usage

# S3 method for Expression
mean(x, trim = 0, na.rm = FALSE, ...)

Value

An Expression representing the mean of the input.

Arguments

x

An Expression object.

trim

(Unimplemented) The fraction (0 to 0.5) of observations to be trimmed from each end of \(x\) before the mean is computed.

na.rm

(Unimplemented) A logical value indicating whether missing values should be removed.

...

(Unimplemented) Optional arguments.

Examples

Run this code
A <- Variable(2,2)
val <- cbind(c(-5,2), c(-3,1))
prob <- Problem(Minimize(mean(A)), list(A == val))
result <- solve(prob)
result$value

Run the code above in your browser using DataLab