Weighted sum of Dirac Measures

Weighted sum of Dirac Measures

using TensorDec

Series with 3 variables

x = @ring x1 x2 x3
n = length(x)
r = 4;

Random weights in $[0,1]$

w0 = rand(Float64,r)
4-element Array{Float64,1}:
 0.562331
 0.491651
 0.599493
 0.12604

Random points in $[0,1]^n$

Xi0 = rand(Float64,n,r)
3×4 Array{Float64,2}:
 0.800708  0.635737  0.573717  0.0315407
 0.152573  0.458898  0.636491  0.160512 
 0.134556  0.166168  0.133767  0.137902

Moment function of the sum of the Dirac measures of the points $\Xi_0$ with weights $\omega_0$ and its generating series up to degree 3.

mt = moment(w0, Xi0)
s = series(mt, monoms(x, 3))
1.7795149352974786 + 0.062449235043260276dx1*dx2*dx3 + 0.7566850821195507dx1^2 + 0.10286639712981892dx2*dx3 + 0.20461288653962587dx2^3 + 0.15907922554830045dx1*dx3 + 0.05190097726958566dx2^2dx3 + 0.005391207884146876dx3^3 + 0.02301246266079065dx1*dx3^2 + 0.43168338835765724dx1*dx2 + 0.27180774467135016dx1^2dx2 + 0.2549353751140343dx3 + 0.10794283421780543dx1^2dx3 + 0.528215984779713dx1^3 + 1.1107384403985188dx1 + 0.014995504351331559dx2*dx3^2 + 0.713216169908295dx2 + 0.36273942967237804dx2^2 + 0.21574184630442828dx1*dx2^2 + 0.03688058614061291dx3^2

Decomposition of the series from its terms up to degree 3.

w, Xi = decompose(s);
w
4-element Array{Float64,1}:
 0.12604 
 0.599493
 0.491651
 0.562331
Xi
3×4 Array{Float64,2}:
 0.0315407  0.573717  0.635737  0.800708
 0.160512   0.636491  0.458898  0.152573
 0.137902   0.133767  0.166168  0.134556