makeConstantNimbleFunction: 'nimble' constant function generator

View source: R/makeConstantNimbleFunction.R

makeConstantNimbleFunctionR Documentation

nimble constant function generator

Description

Create global constants that can be used in nimble functions. As of nimble 0.6-12 there does not appear to be official support for global constants. This function creates functions that can be used in place of constants.

Usage

makeConstantNimbleFunction(inValue, isDouble = TRUE)

Arguments

inValue

Scalar to be set as a constant

isDouble

Logical. If TRUE the constant is a numeric scalar, and if FALSE the constant is an integer.

Value

An object of the type returned by nimbleFunction that can be called inside other nimble code to retrieve the value of the global constant.

Author(s)

Joseph D. Chipperfield

Examples

maxMNormTrunc <- makeConstantNimbleFunction(0.0001, TRUE)   


nimbleSCR documentation built on Dec. 1, 2022, 1:17 a.m.