findmaxtulip: Implementation of Tulip Extreme Finding Estimator (TEFE)...

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

View source: R/findmaxtulip.R

Description

For a curve that can be classified as 'tulip' a fast computation of its maximum is performed by applying Tulip Extreme Finding Estimator (TEFE) algorithm of [1].

Usage

1
findmaxtulip(x, y, concave = TRUE)

Arguments

x

A numeric vector for the independent variable without missing values

y

A numeric vector for the dependent variable without missing values

concave

Logical input, if TRUE then curve is supposed to have a maximum (default=TRUE)

Details

If we want to compute minimum we just set concave=FALSE and proceed.

Value

A named vector with next components is returned:

  1. j1 the index of x vextor that is the left endpoint of final symmetrization interval

  2. j1 the index of x vextor that is the right endpoint of final symmetrization interval

  3. chi the estimation of extreme as x-abscissa

Note

Please use function classify_curve if you have not visual inspection in order to find the extreme type. Do not use that function if curve shape is not 'tulip', use either symextreme or findextreme.

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

classify_curve, symextreme, findmaxbell, findextreme

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
#
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)
cc=classify_curve(x,y)
cc$shapetype
## 1] "tulip"
a<-findmaxtulip(x,y)
a
## j1   j2  chi 
##  1 1001    5 
abline(v=a['chi'])
abline(v=x[a[1:2]],lty=2);abline(h=y[a[1:2]],lty=2)
points(x[a[1]:a[2]],y[a[1]:a[2]],pch=19,cex=0.5,col='blue')
#
## Same curve with noise from U(-1.5,1.5)
set.seed(2019-07-26);r=1.5;y=f(x)+runif(length(x),-r,r)
plot(x,y,pch=19,cex=0.5)
cc=classify_curve(x,y)
cc$shapetype
## 1] "tulip"
plot(x,y,pch=19,cex=0.5)
a<-findmaxtulip(x,y)
a
##    j1       j2      chi 
## 1.000 1002.000    5.005 
abline(v=a['chi'])
abline(v=x[a[1:2]],lty=2);abline(h=y[a[1:2]],lty=2)
points(x[a[1]:a[2]],y[a[1]:a[2]],pch=19,cex=0.5,col='blue')
#

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