# NOT RUN {
#
## Bell curve
f=function(x){1/(1+x^2)}
x=seq(-2,2.0,by=0.01);y=f(x)
plot(x,y,pch=19,cex=0.5)
a=symextreme(x,y)
a
## $maximum
## [1] TRUE
##
## $minimum
## [1] FALSE
##
## $results
## j1 j2 chi
## 1.770000e+02 2.250000e+02 1.110223e-16
abline(v=a$results['chi'])
#
## Tulip curve
f=function(x){100-(x-5)^2}
x=seq(0,12,by=0.01);y=f(x)
plot(x,y,pch=19,cex=0.5)
a=symextreme(x,y)
a
## $maximum
## [1] TRUE
##
## $minimum
## [1] FALSE
##
## $results
## j1 j2 chi
## 1 1001 5
abline(v=a$results['chi'])
#
# }
Run the code above in your browser using DataLab