1% moms = MarginalMomentsFromWeightedTrace(trace, weights, K)
3% Returns the marginal moments of a trace consisting of
8% trace : vector of doubles
10% weights : vector of doubles
11% The weights corresponding to the trace data
13% The number of moments to compute
17% moms : vector of doubles
18% The (raw) moments of the weighted trace
20function moms = MarginalMomentsFromWeightedTrace (trace, weights, K)
28 moms(i) = sum(dot(trace.^i,weights));
30 moms = moms / sum(weights);