sum_vector: Sum Over Matrix Rows / Columns

Description Usage Arguments Value See Also

View source: R/calculate_mean_matrix.R

Description

Sum over specified matrix rows / columns, possibly weighted. Useful for creating multivariate ARMA processes.

Usage

1
sum_vector(matr, index, constants, weights = FALSE, by_row = TRUE)

Arguments

matr

matrix to sum over rows / columns

index

index of rows / columns to sum. default is to sum over all rows.

constants

constants to multiply the indices before summation. default is 1 for all constants

weights

should treat constants as weights? if true, weights <- weights/sum(weights). default false

by_row

should sum over rows (default) or by columns?

Value

a vector, built from the (possible weighted) sum of specified vectors

See Also

Other sum_arrays: calculate_mean_matrix(), sum_matrix()


itamarfaran/corrfuncs documentation built on Nov. 26, 2021, 12:02 p.m.