VF_meanwWVD_meanwWVE_meanwW
VCF_meanwWVCD_meanwWVCE_meanwW
FunctionMean with weights
Syntax C/C++#include <VFstd.h>
float VF_meanwW( fVector X, fVector Wt, ui size );

    (similarly VD_,   VE_)
fComplex VCF_meanwW( cfVector X, fVector Wt, ui size );
    (similarly VCD_,   VCE_)
C++ VecObj#include <OptiVec.h>
T vector<T>::meanwW( const vector<T>& Wt );
fComplex vector<complex<T>>::meanwW( const vector<T>& Wt );
Pascal/Delphiuses VFstd;
function VF_meanwW( X, Wt:fVector; size:UInt ): Single;

    (similarly VD_,   VE_)
procedure VCF_meanwW( var Mean:fComplex; X:cfVector; Wt:fVector; size:UInt );
    (similarly VCD_,   VCE_)
DescriptionmeanwW = (1 / sum( Wti )) * sum( Xi * Wti )
Notice that, also in the complex version, the weights are always real rather than complex.
Error handlingnone
Return valueweighted mean of the vector elements (except complex versions in Pascal/Delphi).
See alsoVF_mean,   VF_sum,   VF_ssq,   VF_ssqdevC,   VF_median,   VF_meanvarwW,   VF_linregresswW

VectorLib Table of Contents  OptiVec home