residuals | R Documentation |
Extracts residuals from a cpop model.
## S4 method for signature 'cpop.class'
residuals(object)
object |
An instance of an S4 class produced by |
A single column matrix containing the residuals.
cpop-jss-article-2024cpop
library(cpop)
# simulate data with change in gradient
set.seed(1)
x <- (1:50/5)^2
y <- simchangeslope(x,changepoints=c(10,50),change.slope=c(0.25,-0.25),sd=1)
# determine changepoints
res <- cpop(y,x,beta=2*log(length(y)))
# calculate the residuals
residuals(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.