Helper function to compute weighted mean and standard deviation. Deals gracefully whether x is sparse matrix or not.
weighted_mean_sd(x, weights = rep(1, nrow(x)))
A list with components.
vector of weighted means of columns of x
vector of weighted standard deviations of columns of x
Observation matrix.
Optional weight vector.