4 % @brief Normalizing constant
using Grundmann-Moeller quadrature.
10 % @brief Normalizing constant
using Grundmann-Moeller quadrature.
11 % @fn pfqn_grnmol(L, N)
12 % @param L Service demand matrix.
13 % @param N Population vector.
14 % @
return G Normalizing constant.
17function G=pfqn_grnmol(L,N)
20% ceil binds to the whole quotient: written as ceil(sum(N)-1)/2 it produced a
21% HALF-INTEGER S
for even sum(N), and zeros(1+S,1) then errored outright, so
22% the function was uncallable for even populations. Identical for odd sum(N).
29 w(1+i)=2^-(2*S)*(-1)^i*c(1+i)^(2*S+1)/factorial(i)/factorial(i+c(1+i));
30 [s,bvec,SD,D]=sprod(M,S-i); bvec=bvec';
32 H(1+i) = H(1+i) + prod((((2*bvec+1)/c(1+i))*L).^N);
33 [s,bvec]=sprod(s,SD,D); bvec=bvec';
35 G = G + w(1+i)*H(1+i);
37G=G*factorial(sum(N)+M-1)/prod(factorial(N));