Weighted Mean

Global Algorithm - One-Dimensional Algorithm

Weighted Mean of a data set is similar to the mean, but the values in the data set are weighted differently. The basic formula is stated as follows:

μweighted=Ni=1wiYiNi=1wi,

where Yi is the ith value in the data set, N is the length of the data vector and μweighted is the weighted mean value.

Input Parameters

Parameter Type Constraint Description Remarks
Y YRN NN Input data vector of length N  
W WRN NN Input weighting vector of length N If wi=1 , the algorithm simplifies to μweighted=wiYi .

Output Parameters

Parameter Type Constraint Description Remarks
μweighted μweightedR   Weighted mean value of data Y The result is sensitive to improper values such as ‘nan’, ‘inf’, ‘null’, etc.

Single Steps using the Algorithm