Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tapers-refinement

Taper constraints using simple derivatives


Description

Taper constraints using simple derivatives

Usage

ctap_simple(tapvec, ...)

## S3 method for class 'tapers'
ctap_simple(tapvec, ...)

## Default S3 method:
ctap_simple(tapvec, maxslope = 1L, ...)

Arguments

tapvec

integer or 'tapers' object; the number of tapers at each frequency

...

optional arguments

maxslope

integer; constrain based on this maximum first difference

Author(s)

A.J. Barbour

See Also

Examples

# generate some random taper series and constrain them based on slopes
set.seed(1237)
n <- 11
x <- seq_len(n)
xn <- round(runif(n,1,n))

xnf <- ctap_simple(xn, 0) # flattens out
xnc <- ctap_simple(xn, 1) # no change, already only slopes = 1
try(all.equal(xnc, xn))
xnc2 <- ctap_simple(xn, 2) # slopes = 2 only

plot(xn, type='b', pch=16, ylim=c(0,12))
grid()
abline(a=0,b=1, col='red', lty=3); abline(a=0,b=2, col='blue', lty=3)
lines(xnf, type='b', col='green')
lines(xnc, type='b', col='red')
lines(xnc2, type='b', col='blue')
lines(0.2+as.vector(psd::ctap_simple(psd::as.tapers(xn))), type='b', pch=".", col='salmon')

# more examples:

psd

Adaptive, Sine-Multitaper Power Spectral Density and Cross Spectrum Estimation

v2.1.0
GPL (>= 2)
Authors
Andrew J. Barbour [aut, cre] (<https://orcid.org/0000-0002-6890-2452>), Jonathan Kennel [aut] (<https://orcid.org/0000-0003-4474-6886>), Robert L. Parker [aut]
Initial release
2020-06-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.