VI_MODEL-cash-set_prm: Set parameter for the model

VI_MODEL$set_prmR Documentation

Set parameter for the model

Description

This function store the values in the environment and update their values in the closed form expression of y. However, if the parameter is not directly used by the closed form expression, user should override this method to correctly set the parameter.

Arguments

prm_name

List or Vector. Parameter character names.

prm_val

List or Vector. Parameter values.

Value

Return the object itself.

Examples


# Instantiate
x <- rand_uniform()
e <- rand_normal()
test <- vi_model(prm = list(a = 1, x = x, e = e),
                 prm_type = list(a = "o", x = "r", e = "r"),
                 formula = y ~ 1 + a * x + x^2 + e,
                 null_formula = y ~ x,
                 alt_formula = y ~ x + I(x^2))

test

test$set_prm("a", 2)

test

TengMCing/visage documentation built on Aug. 28, 2024, 3:27 p.m.