Description Usage Arguments Details Value Author(s) See Also Examples
Error Function
1 2 3 4 | erf(x)
philpotts.erf(x)
erfc(x)
erfinv(x)
|
x |
Uses pnorm to calculate the error function. erfinv returns the inverse of the erf function.
error function
Jonathan M. Lees<jonathan.lees@unc.edu>
philpotts.erf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | j = seq(from=0, to=5.5, by=0.01)
y = erf(j)
phil = philpotts.erf(j)
plot(j,y)
points( j, phil, pch=3, col='red' )
#### plot the difference
plot(j, y-phil)
lines(j, y-phil)
##### inverse of erf function:
j = seq(from=0, to=5.5, by=0.1)
y = erf(j)
for(i in 1:length(j))
{
z = erfinv(y[i])
print(paste(i, y[i], j[i], z, sep=" "))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.