genpmreg {ftnonpar} | R Documentation |
Applies the generalised taut string method to one-dimensional data.
genpmreg(y, beta = 0.5, squeezing.factor = 0.5, verbose = FALSE, localsqueezing = TRUE, DYADIC = TRUE, thr.const = 2, extrema.nr = -1, bandwidth = -1, SETTOMEAN = FALSE, method = 2, ...)
y |
observed values (ordered by value of independent variable) |
beta |
If method=1 specifies the quantile |
squeezing.factor |
The amount of decrement applied to the bandwidthes |
verbose |
logical, if T progress (for each iteration) is illustrated grahically |
localsqueezing |
logical, if T (default) the bandwidth is changed locally. |
DYADIC |
If T checks the multiresolution criterion only on dyadic intervals, otherwise all intervals are checked |
thr.const |
smoothing parameter for the multiresolution criterion (should be approximately 2.5) |
extrema.nr |
if set to a positive integer an approximation with the specified number of local extreme values is calculated |
bandwidth |
if set to a positive value the specified bandwidth is used instead of the multiresolution criterion. |
SETTOMEAN |
logical, if T (default) the value of the taut string approximation at local extreme values is set to the mean or median of the observations on the interval where the extremum is taken. |
method |
The method used which can be 1 (quantile regression), 2 (usual taut string), 3 (logistic regression) and 4 (Poisson regression) |
... |
Passed to the plot command if verbose=T |
A list with components
y |
The approximation of the given data |
lambda |
Values for lambda used |
nmax |
Number of local extreme values |
Arne Kovac A.Kovac@bristol.ac.uk
D"umbgen, L. and Kovac, A. (2006) Extensions of smoothing via taut strings
data(djdata) par(mfrow=c(2,2)) plot(djblocks,col="grey") lines(genpmreg(djblocks,verbose=FALSE,method=2,thr.const=2.5)$y,col="red") title("Usual taut string method") ind <- sample(1:length(djblocks),300) djblocks[ind] <- djblocks[ind]+rnorm(length(ind),0,100) plot(djblocks,col="grey") lines(genpmreg(djblocks,verbose=FALSE,method=2)$y,col="red") title("Usual taut string method with outliers") plot(djblocks,col="grey") lines(genpmreg(djblocks,verbose=FALSE,method=1)$y,col="red") title("Robust taut string method with outliers") plot(djblocks,col="grey",ylim=c(-10,10)) lines(genpmreg(djblocks,verbose=FALSE,method=1)$y,col="red") title("Again robust taut string method, different scaling of y-axis")