Usage: |
z = pmreg(y, thrconst, verbose, extremanr, bandwidth, sigma, localsqueezing, squeezingfactor, tolerance)
|
Input: |
| y | (n x 1) vector of data
|
| thrconst | optional (2.5 by default); it specifies the threshold constant.
|
| verbose | optional (it is zero by default); if non-zero, the user is in
every iteration and at the end of the computation presented
with three graphs characterizing the string and its bounds,
the estimated regression function (plotted together with the
data y), and the schematized "residual" plot in which non-zero
values (1 or -1) indicate that the string touches one of the bounds.
If, in addition to that, verbose is negative, then after every
iteration program stops waiting for a user input.
|
| extremanr | optional (-1 by default); if positive, it prescribes the maximum for the
number of local extrema. It can be used only if local squeezing is not
active.
|
| bandwidth | optional (-1 by default); if positive, then it specifies the bandwidth
for "string tube" to be used, otherwise, a predefined bandwidth is chosen
(depending on the size of the data and other parameters).
|
| sigma | optional (-1 by default); if positive, then it specifies the variance
of the noise, otherwise, the median absolute deviaton is used.
|
| localsqueezing | optional (one by default); if non-zero, a local squeezing is used,
that is the reduction of the radius of "string tube" takes place
only in neighborhoods of local extremes.
|
| squeezingfactor | optional (0.5 by default); it specifies the amount of "string tube"
radius reduction after every iteration.
|
| tolerance | optional (0.001 by default); it gives the precision to reach.
|
Output: |
| z.ystr | (n x 1) vector containing the estimated regression function |
| z.sigmastr | the variance used for the estimation (if it was not specified as the
input parameter, the median absolute deviation is returned). |
| z.widths | (n+1) x 1 vector of the distance between the estimated cdf and
its upper bound |
| nmax | the number of local extremes of the string |
| knotsind | the indices of (sorted) observations at which knots are |
| knotsy | the y-coordinates of the string in knots (given by knotsind) |