|
From: | Rik |
Subject: | Re: About normcdf() function integration method |
Date: | Mon, 16 Oct 2017 11:46:06 -0700 |
On 10/16/2017 09:00 AM,
address@hidden wrote:
The function normcdf() is implemented in an m-file which means you can just look at the source to see what Octave is doing. Inside normcdf.m there is this line cdf = stdnormal_cdf ((x - mu) / sigma); So Octave is centering and scaling the distribution, and then using the CDF for the standard normal function with mu = 0, sigma = 1. stdnormal_cdf is also implemented as an m-file. Inside that one finds cdf = erfc (x / (-sqrt(2))) / 2; Octave relies on the C++ standard library for the complimentary error function erfc. For students, definitely have them try trapz() or one of the 1-D integrators (quad, quadv, quadgk, etc.). --Rik |
[Prev in Thread] | Current Thread | [Next in Thread] |