View source: R/plot_diffnet2.r
weighted_var | R Documentation |
Computes weighted variance
weighted_var(x, w)
wvar(x, w)
x |
A numeric vector of length |
w |
A numeric vector of length |
weighted_variance
implements weighted variance computation
in the following form:
%
\frac{\sum_i w_i'(x_i - \bar x)^2}{(1-n)}
where w_i'=w_i/\sum_i w_i
, and
\bar x = \sum_i w_i'x_i
.
Numeric scalar with the weighted variance.
This function is used in diffmap
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.