Mathematica 9 is now available Services & Resources /
Wolfram Forums / MathGroup Archive  MathGroup Archive 2009
[Date Index] [Thread Index] [Author Index]  Search the Archive
weighted averages from 2 matrices    • To: mathgroup at   •
Subject: [mg96108] weighted averages from 2 matrices   • From:
Andreas <aagas at>   • Date: Thu, 5 Feb 2009 04:39:33 -0500
(EST)  This builds on an earlier post, but involves a different
enough problem, that I thought it merited a separate thread.  I
need to calculate a list or vector of weighted averages of
n-dimensional samples, where the matrix "values" provides
corresponding weights to the set of samples in matrix "samples"
i.e.: I have two matrices:  values = Array[V, ## &, {5, 4};
samples = Array[S, ## &, {6, 4}; Row[{" values ="
MatrixForm[values, "   ", "samples =" MatrixForm[samples}  (*
The code yields something like this *)  V1,1  V1,2  V1,3  V1,4
V2,1  V2,2  V2,3  V2,4 V3,1  V3,2  V3,3  V3,4 V4,1  V4,2  V4,3
V4,4 V5,1  V5,2  V5,3  V5,4  S1,1  S1,2  S1,3  S1,4 S2