weighted_var: Computes weighted variance

Description Usage Arguments Details Value See Also

View source: R/plot_diffnet2.R

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.


netdiffuseR documentation built on May 29, 2017, 8:19 p.m.

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