weighted_var {netdiffuseR}R Documentation

Computes weighted variance

Description

Computes weighted variance

Usage

weighted_var(x, w)

wvar(x, w)

Arguments

x

A numeric vector of length nn.

w

A numeric vector of length nn.

Details

weighted_variance implements weighted variance computation in the following form:

iwi(xixˉ)2(1n)% \frac{\sum_i w_i'(x_i - \bar x)^2}{(1-n)}

where wi=wi/iwiw_i'=w_i/\sum_i w_i, and xˉ=iwixi\bar x = \sum_i w_i'x_i.

Value

Numeric scalar with the weighted variance.

See Also

This function is used in diffmap.


[Package netdiffuseR version 1.22.6 Index]