Skip to contents

Default returns fitted values on the model's native likelihood scale (log scale for "exponential", natural/LL4 scale for others), matching augment(fit)$.fitted. Set scale = "natural" to back-transform.

Usage

# S3 method for class 'beezdemand_tmb'
fitted(
  object,
  scale = c("model", "natural"),
  level = c("subject", "population"),
  ...
)

Arguments

object

A beezdemand_tmb object.

scale

One of "model" (default) or "natural".

level

One of "subject" (default; conditions on the subject random effects) or "population" (random effects set to zero, giving the population-mean values). See predict.beezdemand_tmb().

...

Unused.

Value

Numeric vector of length nobs(object).

Examples

# \donttest{
data(apt)
fit <- fit_demand_tmb(apt, equation = "exponential", verbose = 0)
#>   equation='exponential': Dropped 14 zero-consumption observations (146 remaining).
head(fitted(fit))
#> [1] 2.308394 2.262163 2.216312 2.170836 2.125734 2.081001
# }