Density distribution of Cauchy function
Source code name: "stat_beta_pdf.py"
Programming language: Python
Topic: Statistics/Descriptive
DMelt Version 1. Last modified: 09/26/2015. License: Pro
https://datamelt.org/code/cache/stat_beta_pdf_3537.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.



from java.awt import Color
from jhplot import *
from jdistlib import *

def func(min,max):        # evaluate Cauchy function 
   logz=Cauchy(1, 2)      # initialaze function 
   f=P1D("Cauchy")        # container to fill
   step=(max-min)/100.0
   for i in range(100):
       x=min+step*i
       f.add(x,logz.density(x, True) )
   return f

c1 = HPlot('Beta')   # plot
c1.visible(); c1.setAutoRange()
c1.setMarginLeft(80)
c1.setNameX("X")
c1.setNameY("Values")
p=func(-10,10)   # plot between 1 and 100
p.setStyle('l')
p.setPenWidth(4)
p.setColor(Color.blue)
c1.draw(p)


You see the box below because you did not login.