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.10310570990285539
 0.659237146402671  
 0.42854695858385483
 0.9028954619877378

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

Xi0 = rand(Float64,n,r)
3×4 Array{Float64,2}:
 0.894353  0.723909  0.847517   0.243868
 0.621765  0.474676  0.889351   0.234888
 0.448695  0.324577  0.0910113  0.929199

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))
0.4339257411626396dx1*dx3 + 0.9702397337601841dx2 + 1.1382083719944895dx3 + 0.6585957641575078dx1*dx2 + 0.756553791183631dx3^3 + 0.14323371231850154dx2^2dx3 + 0.5978228622857406dx1^3 + 0.40844393047707755dx2^3 + 0.36208356970237654dx2*dx3 + 0.5016353149729792dx1^2dx2 + 0.17670723666808152dx1*dx2*dx3 + 0.7894555317442516dx1^2 + 0.8733277036829585dx3^2 + 1.1528284153895243dx1 + 0.5771697834203546dx2^2 + 0.22704558514092504dx1^2dx3 + 0.2619613422143817dx1*dx3^2 + 0.4425968864300194dx1*dx2^2 + 0.2321415223320108dx2*dx3^2 + 2.093785276877119

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

w, Xi = decompose(s);
w
4-element Array{Float64,1}:
 0.4285469585838939 
 0.10310570990277962
 0.6592371464026707 
 0.9028954619877747
Xi
3×4 Array{Float64,2}:
 0.847517   0.894353  0.723909  0.243868
 0.889351   0.621765  0.474676  0.234888
 0.0910113  0.448695  0.324577  0.929199