% MMOMLAGLOG Generates the first 2N modified % moments to dig decimal places of the weight % function w(x)=x^a*exp(-x)*(x-1-log x) on R_{+}. % It requires Release 5.1 (R2008b) or later % releases of the Matlab Symbolic Math Toolbox. % function mom=mmomlaglog(dig,N,a) digits(dig); psi=feval(symengine,'psi',a+1); psi=vpa(psi); mom(1)=gamma(vpa(a+1))*(a-psi); mom(2)=a*gamma(vpa(a+1)); sgn=-1; for k=3:2*N sgn=-sgn; mom(k)=sgn*gamma(vpa(a+1))*gamma(vpa(k-1)); end