1function JM=map_joint(MAP,a,i)
2% map_joint computes the joint moments of a MAP
4% JM=map_joint(MAP,a,i) returns the joint moment of a MAP
7% MAP = a
map in the form of {D0,D1}
8% a = a vector (a1, a2, a3, ... ) which are the subscripts
9% of each term in E[(X_a1)^i1*(X_a2)^i2*...]
10% i = a vector (i1, i2, i3, ... ) which specifying the
11% power of each element in the joint moments
12% E((X_a1)^i1*(X_a2)^i2*(X_a3)^i3*(X_a4)^i4*...]
15% JM = E[(X_a1)^i1*(X_{a1+a2})^i2*(X_{a1+a2+a3})^i3*... ]
20a=cumsum(a); % the cumulative vector of vector a
26 JM=JM*factorial(i(k))*invD0^(i(k))*(
P^(a(k+1)-a(k)));
28JM=map_pie(MAP)*JM*factorial(i(K))*invD0^(i(K))*ones(length(
P),1);