generate_logpostpdf_funs: Generate helper functions for optimization routines

View source: R/inference_optimhelp.R

generate_logpostpdf_funsR Documentation

Generate helper functions for optimization routines

Description

Generate a list with two function to evaluate the posterior probability density function and its gradient. These functions can be used in optimization to find the posterior maximum.

Usage

generate_logpostpdf_funs(map, zprior, U, obs, zref)

Arguments

map

Mapping object. Usually a compound map, see create_compound_map

zprior

Vector of prior estimates of the independent variables (i.e., associated with nodes without parent nodes)

U

Prior covariance matrix of the independent variables

obs

Vector with observed values of dependent nodes. Must be of same size as zprior. An NA value in this vector means that the corresponding variable was not observed.

zref

Vector with values of independent variables used as reference vector in Taylor expansion. The posterior pdf is also evaluated exactly at this point.

Value

Return a list with two functions:

fun(x) Function that evaluates the posterior pdf at x
jac(x) Function that evaluates the gradient of the posterior pdf at x

gschnabel/nucdataBaynet documentation built on Feb. 3, 2023, 4:13 a.m.