agg: Function to aggregate results from matrix to matrix

Description Usage Arguments Value Examples

View source: R/lib.R

Description

Defaults to mean, SD, limits, and given quantiles. Used to limit memory consumption from MCMC runs.

Usage

1
agg(mat, q = c(0.05, 0.16, 0.5, 0.84, 0.95))

Arguments

mat

input numeric matrix to summarize

q

quantiles of mat's columns to provide in summary matrix

Value

matrix with each row corresponding to a summary measure and each column corresponding to a column of mat

Examples

1
2
mat <- matrix(rnorm(5e3), ncol=5)
agg(mat)

Example output

            [,1]         [,2]         [,3]         [,4]        [,5]
mean -0.01962100  0.019642145 -0.011597453  0.004514988  0.02715781
sd    1.00830861  1.004603426  0.998132737  0.992718166  0.98872689
min  -2.74979871 -3.054267295 -3.245436456 -2.985479779 -4.15540177
max   3.06522960  3.134079158  3.468209544  2.989133826  2.92093748
q05  -1.61734643 -1.695641206 -1.666814265 -1.619190131 -1.53760171
q16  -1.03191989 -0.926236359 -1.029464738 -1.032989146 -0.95115586
q50  -0.01721718  0.002447291  0.009351124  0.026692242  0.01929360
q84   0.97610873  1.015530078  0.950830270  1.010716849  1.00176280
q95   1.58523002  1.683745025  1.668572948  1.666090128  1.67280816

networkTomography documentation built on May 2, 2019, 3:28 a.m.