You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
433 B
Matlab

function [muComb,varComb]=stats_gaussian_combination(mus,vars)
%calc the mean and variance of the Gaussian distribution that results from combining multiple other Gaussian distributions
weights=(vars.^-1)./sum(vars.^-1);
muComb=sum(weights.*mus);
varComb=sum(vars.^-1).^-1;
%Note for 2 Gaussian cues, the above simplifies to:
%muComb=(mus(1)*vars(2)+mus(2)*vars(1))/(vars(1)+vars(2));
%varComb=(vars(1)*vars(2))/(vars(1)+vars(2));