Calculations of factorial moments of a distribution
Source code name: "stat_factorial_moments.py"
Programming language: Python
Topic: Statistics/Advanced
DMelt Version 1. Last modified: 12/11/2015. License: Pro
https://datamelt.org/code/cache/stat_factorial_moments_2241.py
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.


# Factorial momonents are defined as F_q=
# authors:  S.Chekanov


from jhplot  import *
from java.util import Random
from jhpro.stat  import MomentsFac

c1 = HPlot("Canvas",600,400)
c1.visible(1)
c1.setNameX("Factorial Moment order")
c1.setNameY("Values")
c1.setMarginLeft(100)
c1.setAutoRange() 

m=MomentsFac(4) # calculates moments up to 4th order

# use a Gaussian random numbers
r=Random();
for i in range(100):
            m.process( (int)(r.nextGaussian()*5+10))

p=m.getResults()
c1.draw(p)
print(p.toString())


You see the box below because you did not login.