Hide recorded daily feed intake on purpose, impute it again and compare with the recorded values. Only pigs whose stage is well covered by records are used, and errors are measured on the recorded days only.

The imputation also uses the daily body weight. With weight, the weight records of the hidden days are hidden too, and the daily body weight is computed again from the remaining records (clean_weight() and calc_adg() with the settings of adfi), as if the pig really was not recorded on these days. Without weight (as before 1.5.0) the daily body weight from all records is used, which knows the weight of the hidden days, so the errors are too optimistic, mostly for late<d> and early<d>.

validate_adfi(
  adfi,
  weight = NULL,
  methods = c("loess_pop", "loess_lm", "linear"),
  scenarios = c("random30", "blocks3", "late20", "early15"),
  reps = 5,
  min_coverage = 0.8,
  max_pigs = NULL,
  seed = 1,
  verbose = 1,
  cores = 1
)

Arguments

adfi

Result of calc_adfi().

weight

Result of clean_weight() of the same data, so that the daily body weight of the hidden days is computed without them (recommended). Default NULL: the daily body weight of adfi, with a warning.

methods

Imputation methods to compare (values of impute_method). For "loess_pop", the population curve of each pig is fitted without that pig (leave-one-out), so its hidden days do not inform the curve.

scenarios

Patterns of hidden days:

  • "random<p>": p% of the recorded days at random, e.g. "random30";

  • "blocks<n>": n blocks of 3-10 consecutive days, e.g. "blocks3";

  • "late<d>": the first d days of the stage (late entry);

  • "early<d>": the last d days of the stage (early exit).

reps

Number of repetitions per scenario. Default 5.

min_coverage

Pigs with at least this share of recorded stage days are used. Default 0.8.

max_pigs

Use a random sample of at most this many of these pigs. Default NULL: all.

seed

Random seed.

verbose

0 (silent), 1 (summary and progress, default).

cores

Number of CPU cores. Default 1.

Value

A list of class ppt_validation with

  • summary: one row per scenario and method: mean_abs_error_pct and p95_abs_error_pct (error of the ADFI of each pig, % of the recorded ADFI), bias_pct, spearman (rank correlation of ADFI with the recorded ADFI), daily_rmse (g/d, hidden days) and n_pigs;

  • per_pig: the error of every pig, scenario, repetition and method;

  • settings.