Blame | Last modification | View Log | RSS feed
!goto $wims_read_parm
:def
title=Weighted geometric mean
synonyme=weighted data geometric mean, geometric mean weighted
input=data2d
!exit
:proc
pari_header=dmat=Mat([$fml2]);w=sum(x=1,$cnt,dmat[x,2]);
result=!exec pari print(prod(x=1,$cnt,dmat[x,1]^dmat[x,2])^(1/w));\
print(w);
!distribute lines $result into result, totweight
!exit
:output
<center>
Weighted geometric mean =
!htmlmath $result
</center> <p>
Data: $cnt weighted numbers { $fml3 } (total weight = $totweight).
<p>
!exit