erf: Error Function

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Error Function

Usage

1
2
3
4

Arguments

x

Details

Uses pnorm to calculate the error function. erfinv returns the inverse of the erf function.

Value

error function

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

See Also

philpotts.erf

Examples

 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=" "))
   }

geophys documentation built on May 1, 2019, 9:26 p.m.