validate_sd_spec: Validate an SD Specification for error_sd or group_sd

View source: R/utils-helpers.R

validate_sd_specR Documentation

Validate an SD Specification for error_sd or group_sd

Description

Checks whether the input is a valid positive numeric scalar or one of the supported distributional list specifications. Called automatically by brms_inla_power() before the simulation loop; can also be called directly for interactive validation.

Usage

validate_sd_spec(x, arg_name = "x")

Arguments

x

A positive numeric scalar or a named list with element dist.

arg_name

Character string used in error messages (default "x").

Details

Supported distributional formats:

  • list(dist = "halfnormal", sd = X, location = Y) — draws ⁠|Normal(location, sd)|⁠; location defaults to 0.

  • list(dist = "lognormal", meanlog = X, sdlog = Y) — draws from a log-normal distribution.

  • list(dist = "uniform", min = X, max = Y) — draws from Uniform(min, max); requires min >= 0.

Value

x, invisibly. Called for its side effects (stopping on invalid input).


powerbrmsINLA documentation built on July 2, 2026, 5:07 p.m.