vec_mean: Vector Mean

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/linearAlgebra-vec_mean.R

Description

Calculates the mean of a vector. If the input is a matrix, the function vectorizes the matrix before calculating the mean.

Usage

1

Arguments

x

Numeric vector or n by 1 matrix.

Details

The vector mean is given by

\frac{1}{n} ≤ft( \mathbf{1}_{n}^{\prime} \mathbf{x} \right)

Value

A vector of length 1.

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Vectorization Functions: diag_of_vech(), vechnames(), vechsnames(), vechs(), vech(), vec()

Examples

1
2
3
x <- rnorm(100)
vec_mean(x)
vec_mean(matrix(x, ncol = 1))

jeksterslab/linearAlgebra documentation built on Dec. 20, 2021, 10:10 p.m.