weighted.var {factormodel}R Documentation

weighted.var

Description

This function is to compute an unbiased sample weighted variance.

Usage

weighted.var(x, w = NULL)

Arguments

x

A vector to compute a variance, var(x)

w

A weight vector

Value

Returns an unbiased sample weighted variance

Author(s)

Yujung Hwang, yujungghwang@gmail.com

Examples

## If you do not specify weights, 
## it returns the usual unweighted sample variance
weighted.var(x=c(1,3,5)) 

weighted.var(x=c(1,3,5),w=c(0.1,0.5,0.4))


[Package factormodel version 1.0 Index]