findextreme: Implementation of Integration Extreme Finding Estimator...

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

View source: R/findextreme.R

Description

Given a noisy or not planar curve as a set of discrete {(x_i,y_i),i=1,2,...n} points we use Integration Extreme Finding Estimator (IEFE) algorithm as it is described at [1] in ordfer to find the extreme point of it.

Usage

1
findextreme(x, y, parallel = FALSE, silent = TRUE, tryfast = FALSE)

Arguments

x

A numeric vector for the independent variable without missing values

y

A numeric vector for the dependent variable without missing values

parallel

Logical input, if TRUE then parallel processing will be used (default=FALSE)

silent

Logical input, if TRUE then no details will be printed out during code execution (default=TRUE)

tryfast

Logical input, if TRUE then instead 'BEDE' will be used from IEFE algorithm instead of BESE (default=FALSE)

Details

The parallel=TRUE otpion must be used if length(x)>20000. The tryfast=TRUE can be used for big data sets, but BEDE is not so accuracy as BESE, so use it with caution.

Value

A named vector with next components is returned:

  1. x1 the left endpoint of the final interval of BESE or BEDE iterations

  2. x2 the right endpoint of the final interval of BESE or BEDE iterations

  3. chi the estimation of extreme as x-abscissa

  4. chi the estimation of extreme as y-abscissa taken from the interpolation polynomial of 2nd degree for the data points (x1,y1), (x2,y2), (chi,ychi)

Note

The 'yvalue' at output vector is an interpolation approxiamtion for the y-value of unknown function at its extreme point 'chi' and does not mean that it will be certainly accurate. Thta is the truth if underlying function can be well approximated by low order polynomials.

Author(s)

Demetris T. Christopoulos

References

[1]Demetris T. Christopoulos (2019). New methods for computing extremes and roots of a planar curve: introducing Noisy Numerical Analysis (2019). ResearchGate. http://dx.doi.org/10.13140/RG.2.2.17158.32324

See Also

symextreme, findmaxtulip, findmaxbell

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
25
26
27
28
29
30
## Legendre polynomial 5th order
## True extreme point p=0.2852315165, y=0.3466277
f=function(x){(63/8)*x^5-(35/4)*x^3+(15/8)*x} 
x=seq(0,0.7,0.001);y=f(x)
plot(x,y,pch=19,cex=0.5)
a=findextreme(x,y)
a
##        x1        x2       chi    yvalue 
## 0.2840000 0.2860000 0.2850000 0.3466274 
sol=a['chi']
abline(h=0)
abline(v=sol)
abline(v=a[1:2],lty=2)
abline(h=f(sol),lty=2)
points(sol,f(sol),pch=17,cex=2)
#
## The same function with noise from U(-0.05,0.05)
set.seed(2019-07-26);r=0.05;y=f(x)+runif(length(x),-r,r)
plot(x,y,pch=19,cex=0.5)
a=findextreme(x,y)
a
##        x1        x2       chi    yvalue 
## 0.2890000 0.2910000 0.2900000 0.3895484 
sol=a['chi']
abline(h=0)
abline(v=sol)
abline(v=a[1:2],lty=2)
abline(h=f(sol),lty=2)
points(sol,f(sol),pch=17,cex=2)
#

Example output

Loading required package: iterators
Loading required package: foreach
Loading required package: parallel
Loading required package: doParallel
Loading required package: inflection
       x1        x2       chi    yvalue 
0.2840000 0.2860000 0.2850000 0.3466274 
       x1        x2       chi    yvalue 
0.2890000 0.2910000 0.2900000 0.3895484 

RootsExtremaInflections documentation built on July 29, 2019, 5:03 p.m.