symextreme: A wrapper for using either Tulip Extreme Finding Estimator...

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

View source: R/symextreme.R

Description

Function uses classify_curve and then either findmaxbell or findmaxtulip to proceed. See [1] for definitions and details of algorithms.

Usage

1
symextreme(x, y, concave = NULL, type = NULL)

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)

type

A character string inpute denoting the shape of the curve, either 'bell' or 'tulip' (default=NULL)

Details

This function is useful if we know that our curve has a symmetry around its extreme point but we cannot directly infer for the relevant shape.

Value

A list with next memebers is returned:

  1. maximum logical, if TRUE then curve has a maximum

  2. minimum logical, if TRUE then curve has a minimum

  3. results a named vector with components:

    • j1 the index of x-left

    • j2 the index of x-right

    • chi the estimation of extreme as x-abscissa

Note

You can Use the 'type' input if you are sure for the shape of the curve.

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, findmaxtulip, 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
31
32
33
34
35
#
## 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'])
#

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