Computes population-level predictions (eta = 0) for all subjects.

ferx_predict(model, data, fit = NULL)

Arguments

model

Path to a .ferx model file

data

Path to a NONMEM-format CSV

fit

Optional ferx_fit result. When provided, predictions use fit$theta instead of the model file's initial estimate for theta.

Value

A data.frame with columns: ID, TIME, PRED

Examples

ex <- ferx_example("warfarin")
fit <- ferx_fit(ex$model, ex$data, method = "gn", covariance = FALSE)
#> Warning: Model file [fit_options] sets `method = foce` but ferx_fit() argument overrides it with `gn`. The call-time value will be used.
#> Warning: Model file [fit_options] sets `covariance = true` but ferx_fit() argument overrides it with `false`. The call-time value will be used.
#> Mu-referencing detected for: ETA_CL, ETA_KA, ETA_V
#> Negative IWRES autocorrelation detected (Durbin-Watson = 2.61, lag-1 r = -0.37).
#> Possible over-parameterisation or misspecified residual error model.
preds <- ferx_predict(ex$model, ex$data, fit = fit)
head(preds)
#>   ID TIME      PRED
#> 1  1  0.5  4.079537
#> 2  1  1.0  6.838224
#> 3  1  2.0  9.928175
#> 4  1  4.0 11.774898
#> 5  1  8.0 11.558992
#> 6  1 12.0 10.815455