Skip to contents

Extracts the residuals.

Usage

# S3 method for LOGISTIC
residuals(
  object,
  type = c("deviance", "innovation", "pearson", "working", "response", "partial"),
  ...
)

Arguments

object

Fitted model

type

the type of residuals which should be returned. alternatives are: "deviance" (default), "pearson", "working", "response", and "partial". Can be abbreviated.

...

Other arguments ignored

Examples

melb_rain |>
  model(logistic = LOGISTIC(Wet ~ fourier(K = 5, period = "year"))) |>
  residuals(type = "deviance")
#> # A tsibble: 4,322 x 3 [1D]
#> # Key:       .model [1]
#>    .model   Date       .resid
#>    <chr>    <date>      <dbl>
#>  1 logistic 2000-01-01  1.64 
#>  2 logistic 2000-01-02 -0.777
#>  3 logistic 2000-01-03 -0.776
#>  4 logistic 2000-01-04  1.64 
#>  5 logistic 2000-01-05  1.64 
#>  6 logistic 2000-01-06 -0.773
#>  7 logistic 2000-01-07 -0.772
#>  8 logistic 2000-01-08 -0.772
#>  9 logistic 2000-01-09 -0.771
#> 10 logistic 2000-01-10  1.65 
#> # ℹ 4,312 more rows