test_sigma_ellipse.praat 709 B

12345678910111213141516171819202122232425262728293031323334
  1. # test_sigma_ellipse.praat
  2. # djmw 20070412
  3. Create TableOfReal... table 10000 2
  4. tor = selected ("TableOfReal")
  5. Formula... if col = 1 then randomGauss(0,1) else self fi
  6. Formula... if col = 2 then randomGauss(0,2) else self fi
  7. To SSCP... 0 0 0 0
  8. sscp = selected ("SSCP")
  9. Erase all
  10. Select outer viewport... 0 6 0 12
  11. select tor
  12. Draw scatter plot... 1 2 0 0 -6 6 -12 12 12 no + yes
  13. select sscp
  14. Red
  15. nsigma=3
  16. call get_p 3
  17. call get_p 4
  18. procedure get_p .nsigma
  19. select sscp
  20. psigma = 1-exp(-.nsigma*.nsigma/2)
  21. printline nsigma='.nsigma', p='psigma'
  22. Red
  23. Draw sigma ellipse... .nsigma 1 2 -6 6 -12 12 no
  24. Green
  25. Draw confidence ellipse... psigma 1 2 -6 6 -12 12 no
  26. Black
  27. endproc
  28. removeObject: tor, sscp