## Inverse Variance Weighted Mean

version 1.0.0.0 (1.25 KB) by
Inverse Variance Weighted Mean

Updated 19 Jun 2018

Inverse-variance weighted means are typically used in statistical analysis, especially to account for variation in uncertainties within an aggregated or compiled dataset.
y = ivwmean(x,var) returns the Inverse Variance Weighted Mean of the elements of "x" weighted by the inverse of the variance "var"

NOTE
Each element of "x" requires a corresponding variance, and hence the size of "var" must match that of "x".

SYNTAX
y = ivwmean(x,var)

EXAMPLE
x = [ 1.2; 1.3; 1.4; 1.2; 1.3; 1.4]
var = [0.0025; 0.0225;0.0100;0.0625;0.5625;0.0006]

m =ivwmean(x,var)

x =
1.2000
1.3000
1.4000
1.2000
1.3000
1.4000

var =
0.0025
0.0225
0.0100
0.0625
0.5625
0.0006

y =
1.3606

### Cite As

Henry Henson (2021). Inverse Variance Weighted Mean (https://www.mathworks.com/matlabcentral/fileexchange/67789-inverse-variance-weighted-mean), MATLAB Central File Exchange. Retrieved .

##### MATLAB Release Compatibility
Created with R2018a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux