weighted_var: Computes weighted variance

Description Usage Arguments Details Value See Also

Description

Computes weighted variance

Usage

1
2
3
weighted_var(x, w)

wvar(x, w)

Arguments

x

A numeric vector of length n.

w

A numeric vector of length n.

Details

weighted_variance implements weighted variance computation in the following form:

sum[w(i)'(x(i) - w.mean(x))^2/(1-n)]

where w(i)' = w(i)/sum(w), and w.mean(x)=sum[w(i)'*x(i)].

Value

Numeric scalar with the weighted variance.

See Also

This function is used in diffmap.



Search within the netdiffuseR package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.