rkillick / EnvCpt

A place for the development version of the changepoint package on CRAN. The master thread is that from CRAN.
5 stars 14 forks source link

Extracting residuals #14

Closed Neverstop7 closed 2 months ago

Neverstop7 commented 2 months ago

Hello! First of all thank you for creating the EnvCpt package! I would like to extract residuals from the models to check normality and independence of errors. Why does the residual() method works for some but not all models? Thank you!

y = BJsales out = envcpt(y)

residuals(out$mean) # not working residuals(out$meancpt) # not working residuals(out$meanar1) #ok residuals(out$meanar2) # ok residuals(out$meanar1cpt) # not working residuals(out$meanar2cpt) # not working residuals(out$trend) # ok residuals(out$trendcpt) # not working residuals(out$trendar1) # ok residuals(out$trendar2) # ok residuals(out$trendar1cpt) # not working residuals(out$trendar2cpt) # not working

rkillick commented 2 months ago

You may notice that the residual method doesn't work for all the changepoint modules but works for the base R models. That is just because it hasn't been coded for those - but it probably should be. I'll add this to the development strand for the main changepoint package. Anyone finding this later, updates will be at https://github.com/rkillick/changepoint/issues/80