check_alscl_data()
View source ↗On this page
Run the input checks of a fit on an input bundle, without compiling TMB or optimizing, and return the problems as a list instead of stopping.
Usage
check_alscl_data(x, model = c("acl", "alscl"))
Arguments
| Argument | Default | Description |
|---|---|---|
x | required | Named input bundle accepted by run_acl() or run_alscl(). |
model | c("acl", "alscl") | Model to check, "acl" or "alscl". Letter case does not matter. |
Value
A list with valid, model, errors, warnings, summary, time and length_bins. For invalid inputs valid is FALSE and errors gives the reason; the call does not stop.
Details
The check runs the same preparation as a fit (alignment of the three tables, time spacing, length bins, biological inputs, starts, bounds and map) but does not compile TMB or run the optimizer. summary gives the numbers of positive, zero and missing observations, the time steps and length bins without any observation, and the numbers of free scalar parameters and process deviations. warnings name excluded zeros, blocks without observations, and fits with no more positive observations than free scalar parameters. The check concerns the inputs only; it does not show that the parameters are identifiable or that a fit will converge.
Examples
Run the setup before the example. Fitting examples require an R-compatible C++ toolchain; simulation and export examples may write files.
Example setup
library(ALSCL)
library(ggplot2)
library(patchwork)
data("YTF_example")
x <- YTF_example
inputs <- x[c("data.CatL", "data.wgt", "data.mat")]
dat <- x$data.CatL
x <- YTF_example
check <- check_alscl_data(x, "alscl")
check$valid
check$summary
check$warnings
# Review check$errors if check$valid is FALSE.