Header menu logo bristlecone

ExpressionCompiler Module

Compile model expressions into functions that take changing state as Tensors.

Types and nested modules

Type/Module Description

Caching

Bool<'r>

Ops<'r>

Functions and values

Function or value Description

buildQuotation ops symbols expr

Full Usage: buildQuotation ops symbols expr

Parameters:
Returns: Expr<'a>

Builds a quotation from a model expression tree simply, with no internal caching or let bindings.

ops : Ops<'a>
symbols : Map<string, Var>
expr : ModelExpression<'u>
Returns: Expr<'a>

buildQuotationCached ops symbols expr

Full Usage: buildQuotationCached ops symbols expr

Parameters:
Returns: Expr<'r>

Builds a quotation from a model expression tree, using an internal cache to avoid rebuilding 'heavy' nodes that have already been built. 'Heavy' nodes are introduced as let bindings to minimise repetition of work in computation.

ops : Ops<'r>
symbols : Map<string, Var>
expr : ModelExpression<'u>
Returns: Expr<'r>

compileDiscrete parameters envKeys expr

Full Usage: compileDiscrete parameters envKeys expr

Parameters:
Returns: StateEquation<'timeUnit>
parameters : ParameterPool
envKeys : ShortCode list
expr : ModelExpression<'stateUnit>
Returns: StateEquation<'timeUnit>

compileFloat expr

Full Usage: compileFloat expr

Parameters:
Returns: ParameterPool -> CodedMap<float> -> float<MeasureProduct<time index, MeasureOne>> -> float -> float
expr : ModelExpression<'u>
Returns: ParameterPool -> CodedMap<float> -> float<MeasureProduct<time index, MeasureOne>> -> float -> float

compileMeasure parameters expr

Full Usage: compileMeasure parameters expr

Parameters:
Returns: TypedTensor<Vector, MeasureProduct<parameter, MeasureOne>> -> CodedMap<TypedTensor<Vector, MeasureProduct<state, MeasureOne>>> -> int -> TypedTensor<Scalar, 'stateUnit>

compileRate parameters envKeys expr

Full Usage: compileRate parameters envKeys expr

Parameters:
Returns: RateEquation<'timeUnit>

Compile a rate-based (e.g. ODE) model expression into an internal `RateEquation` for use in model-fitting.

parameters : ParameterPool
envKeys : ShortCode list
expr : ModelExpression<MeasureProduct<MeasureInverse<'timeUnit>, MeasureProduct<'stateUnit, MeasureOne>>>
Returns: RateEquation<'timeUnit>

compileSimple expr

Full Usage: compileSimple expr

Parameters:
Returns: float<'u>
expr : ModelExpression<'u>
Returns: float<'u>

convertMask mask

Full Usage: convertMask mask

Parameters:
Returns: Tensor
mask : Tensor
Returns: Tensor

getEnvironment eVar name

Full Usage: getEnvironment eVar name

Parameters:
    eVar : Var
    name : string

Returns: Expr<Tensor>
eVar : Var
name : string
Returns: Expr<Tensor>

invalidPenalty

Full Usage: invalidPenalty

Returns: Tensor
Returns: Tensor

inverse fLambda targetExpr loExpr hiExpr tol maxIter

Full Usage: inverse fLambda targetExpr loExpr hiExpr tol maxIter

Parameters:
Returns: Expr<Tensor>
fLambda : Expr
targetExpr : Expr<Tensor>
loExpr : Expr<Tensor>
hiExpr : Expr<Tensor>
tol : 'a
maxIter : int
Returns: Expr<Tensor>

mul xs

Full Usage: mul xs

Parameters:
Returns: Expr<Tensor>
xs : Expr<Tensor> list
Returns: Expr<Tensor>

nonFiniteToPenalty x

Full Usage: nonFiniteToPenalty x

Parameters:
Returns: Tensor

If a tensor is infinite or nan, replaces its value with a high penalty value (1e30).

x : Tensor
Returns: Tensor

Type something to start searching.