Package 'adlaplaceExample'

Title: Example Backend for 'adlaplace'
Description: Provides a minimal example backend package for 'adlaplace'. It demonstrates how to implement and expose model-specific AD tape construction while delegating optimization and Laplace approximation workflows to 'adlaplace'.
Authors: Patrick Brown [aut, cre, cph]
Maintainer: Patrick Brown <[email protected]>
License: MPL-2.0
Version: 0.5.2
Built: 2026-07-17 23:36:45 UTC
Source: https://github.com/eborgnine/adlaplace

Help Index


Build observation-shard ad_fun_ptr in this package's shared library.

Description

Records CppAD tapes in adlaplaceExample.so (same DSO as custom densities).

Usage

get_ad_fun_raw_obs(model, config, name)

Arguments

model

ad_data S4 object.

config

Model configuration list.

name

Observation density name (e.g. "skewnormal_obs").

Value

External pointer of class ad_fun_ptr.


Build parameters-shard ad_fun_ptr in this package's shared library.

Description

Build parameters-shard ad_fun_ptr in this package's shared library.

Usage

get_ad_fun_raw_parameters(model, config, name)

Arguments

model

ad_data S4 object.

config

Model configuration list.

name

Parameters density name (e.g. "skewnormal_extra").

Value

External pointer of class ad_fun_ptr.


Skew-normal observation term constructor

Description

Creates a response term wired to the skewnormal_obs AD shard.

Usage

skewnormal(
  x,
  init = c(0.1, 0.1),
  lower = c(1e-09, -Inf),
  upper = c(Inf, Inf),
  parscale = c(1, 1)
)

Arguments

x

Outcome variable name.

init

Initial values for omega and alpha (log scale for omega).

lower

Lower bounds for omega and alpha.

upper

Upper bounds for omega and alpha.

parscale

Parameter scales for optimization.

Value

A skewnormal object.


Skew-normal observation term

Description

Model term for the observation-level skew-normal log density registered as skewnormal_obs.

Usage

## S4 method for signature 'skewnormal'
design(term, data)

## S4 method for signature 'skewnormal'
precision(term, data)

## S4 method for signature 'skewnormal'
theta_info(term)

## S4 method for signature 'skewnormal'
beta_info(term, data)

## S4 method for signature 'skewnormal'
random_info(term, data)

Arguments

term

A skewnormal object.

data

A data frame (unused for this observation term).

Functions

  • design(skewnormal): Design method (not used for observation density).

  • precision(skewnormal): Precision method (not used).

  • theta_info(skewnormal): Theta info for skew-normal parameters.

    Scale omega uses transform = TRUE (log scale when config$transform_theta is TRUE); shape alpha is untransformed.

  • beta_info(skewnormal): Beta info method (not used).

  • random_info(skewnormal): Random info method (not used).

Slots (inherited from model)

ad_fun

Character scalar "skewnormal_obs".

ad_kind

Character scalar "observations".

package

Character scalar "adlaplaceExample".