npbControl: Control for the npb (nonparametric Bayes) method

View source: R/npb.R

npbControlR Documentation

Control for the npb (nonparametric Bayes) method

Description

A wrapper around [impmapControl()] that reuses the shared FOCEI family plumbing for the nonparametric Bayes engine. The stick-breaking sampler knobs are added in a later milestone.

Usage

npbControl(
  points = 50L,
  alpha = 1,
  burnin = 500L,
  nsamp = 500L,
  nchains = 1L,
  propSd = 0.2,
  seed = 42L,
  residOptimize = c("alternate", "final", "none"),
  cycles = 100L,
  gammaOptimize = FALSE,
  muExpand = FALSE,
  cores = NULL,
  rhoend = 1e-04,
  gamma,
  df,
  ...
)

Arguments

points

Stick-breaking truncation level K (number of support points).

alpha

Dirichlet-process concentration parameter.

burnin

Number of burn-in Gibbs sweeps.

nsamp

Number of post-burn-in Gibbs samples collected.

nchains

Number of independent chains (Gelman-Rubin R-hat convergence is reported when nchains > 1).

propSd

Standard deviation of the Gaussian random-walk MH proposal for the support-point locations (eta space).

seed

Random seed for the sampler.

residOptimize

How to estimate the residual-error thetas (every endpoint's 'add'/'prop'/'lnorm', each transform 'lambda', each 'ar') and any non-mu structural "regressor" theta, with the sampled mixing distribution held fixed, using the bounded 'bobyqa' on the EXTENDED LEAST SQUARES objective (see [npagControl()]; the 'log(r)' term keeps the residual from collapsing to zero and the moment warm-start gives the saem-style SD). "alternate" (default) re-fits them during burn-in and then holds them fixed for the sampling phase (so every collected draw shares the converged residual scale); "final" holds them at their initial values through sampling and fits once at the converged draw; "none" holds them at their initial values throughout. Fixed residual parameters are always held. Unlike npag, npb does not optimize the assay-error multiplier (gamma); the residual thetas are fit directly.

cycles

Unused for npb (kept for control compatibility).

gammaOptimize

Unused for npb (kept for control compatibility).

muExpand

When 'TRUE', mu-expand non-mu structural fixed-effect thetas (a theta with no eta) into grid-estimable pseudo-etas before the fit; 'FALSE' (default) leaves them to the residual step.

cores

Number of threads used for the parallel per-subject conditional- likelihood solves in the Gibbs sweeps. 'NULL' (default) uses the current 'rxode2' thread count ('rxode2::getRxThreads()'); an integer sets the thread count for the fit (restored afterwards). With a fixed 'seed' the fit is bit-for-bit identical regardless of the thread count.

rhoend

Final trust-region radius ('rhoend') of the inner bounded 'bobyqa' that fits the residual-error thetas. A fixed default of '1e-4', matching the optimizer convergence tolerance '10^(-sigdig)' at 'sigdig = 4' (npb has no 'sigdig', so this is not derived from it).

gamma, df

Declared only so they are REJECTED rather than partially matched. 'gamma' is a prefix of 'gammaOptimize', so without an explicit formal R bound 'gamma = 2' to it and silently turned the assay-error optimisation off; 'df' is an importance-sampling proposal control a nonparametric engine never builds. Passing either is an error.

...

Parameters passed to [impmapControl()], for the shared FOCEI-family scaffolding only. The importance-sampling controls are **rejected** rather than accepted – see [npagControl()] – as are 'cycles' and 'gammaOptimize', which this signature carries but 'npb' does not use. 'impSeed' is rejected pointing at 'seed'.

Details

Note: the npb objective is the nonparametric marginal log-likelihood and uses a different constant convention than NONMEM/FOCEI, so its '-2LL' is NOT comparable to nlmixr2's FOCEI/SAEM/FOCE '-2LL'. Compare npb runs to each other or to Pmetrics NPAG.

Value

An 'impmapControl' object tagged for the npb engine.

Author(s)

Matthew L. Fidler

Examples


npbControl()

nlmixr2est documentation built on Aug. 5, 2026, 1:11 a.m.