| VF_meanwW | VD_meanwW | VE_meanwW |
| VCF_meanwW | VCD_meanwW | VCE_meanwW |
|
| Function | Mean 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/Delphi | uses 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_) |
|
| Description | meanwW = (1 / sum( Wti )) * sum( Xi * Wti )
Notice that, also in the complex version, the weights are always real rather than complex. |
|
|
| Return value | weighted mean of the vector elements (except complex versions in Pascal/Delphi). |
|
|