from jhplot import *
from java.util import Random
from jhpro.stat import Moments
c1 = HPlot("Canvas",600,400)
c1.visible(1)
c1.setNameX("Moment order")
c1.setNameY("Values")
c1.setAutoRange()
m=Moments(4) # calculates moments up to 4th order
# use a Gaussian random numbers
r=Random();
for i in range(100):
m.process(r.nextGaussian()+0.5)
c1.draw(m.getResults())
Ads help maintain this website.