residuals.not | R Documentation |
Returns a difference between x
in object
and the estimated signal with change-points at cpt
.
Type of the signal depends on the value of contrast
that has been passed to not
in order to construct object
(see details of predict.not
).
## S3 method for class 'not' residuals(object, cpt, type = c("raw", "standardised"), ...)
object |
An object of class 'not', returned by |
cpt |
An integer vector with locations of the change-points.
If missing, the |
type |
Choice of "raw" and "standardised". |
... |
Further parameters that can be passed to |
If type="raw"
, the difference between the data and the estimated signal. If type="standardised"
, the difference between the data and the estimated signal, divided by the estimated standard deviation.
pcws.const.sig <- c(rep(0, 100), rep(1,100)) x <- pcws.const.sig + rnorm(100) w <- not(x, contrast = "pcwsConstMean") # *** plot residuals obtained via fitting piecewise-constant function with estimated change-points plot(residuals(w)) # *** plot residuals with obtained via fitting piecewise-constant function with true change-point plot(residuals(w, cpt=100)) # *** plot standardised residuals plot(residuals(w, type="standardised"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.