VI_MODEL-cash-..init..: Initialization method

VI_MODEL$..init..R Documentation

Initialization method

Description

This function will be called after an instance is built. User input will be stored in the environment. The response variable of this model is y.

Arguments

prm

Named List. A list of random variables or closed form expressions that needs to be used while constructing y. Constant parameters could also be supplied.

prm_type

Named List. A list of characters denoting the type of the parameters. "r" stands for random variable or closed form used in the expression of y, "o" stands for others. This value only affects the string representation of the object.

formula

Formula. This will be passed to CLOSED_FORM$instantiate to define a closed form expression for y. Default is formula = self$formula.

null_formula

Formula. Formula for fitting the null model. Default is NULL.

alt_formula

Formula. Formula for fitting the alternative model. Default is NULL.

Value

Return the object itself.

Examples


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

test

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