`r lifecycle::badge("deprecated")`
`mrfSampler()` was renamed to [simulate_mrf()] as of bgms 0.1.6.3 to follow the package's naming conventions.
Usage
mrfSampler(
no_states,
no_variables,
no_categories,
interactions,
thresholds,
variable_type = "ordinal",
baseline_category,
iter = 1000,
seed = NULL
)Arguments
- no_states
The number of states of the ordinal MRF to be generated.
- no_variables
The number of variables in the ordinal MRF.
- no_categories
Either a positive integer or a vector of positive integers of length
no_variables. The number of response categories on top of the base category:no_categories = 1generates binary states.- interactions
A symmetric
no_variablesbyno_variablesmatrix of pairwise interactions. Only its off-diagonal elements are used.- thresholds
A
no_variablesbymax(no_categories)matrix of category thresholds. The elements in rowiindicate the thresholds of variablei. Ifno_categoriesis a vector, only the firstno_categories[i]elements are used in rowi. If the Blume-Capel model is used for the category thresholds for variablei, then rowirequires two values (details below); the first is \(\alpha\), the linear contribution of the Blume-Capel model and the second is \(\beta\), the quadratic contribution.- variable_type
What kind of variables are simulated? Can be a single character string specifying the variable type of all
pvariables at once or a vector of character strings of lengthpspecifying the type for each variable separately. Currently, bgm supports “ordinal” and “blume-capel”. Binary variables are automatically treated as “ordinal”. Defaults tovariable_type = "ordinal".- baseline_category
An integer vector of length
no_variablesspecifying the baseline_category category that is used for the Blume-Capel model (details below). Can be any integer value between0andno_categories(orno_categories[i]).- iter
The number of iterations used by the Gibbs sampler. The function provides the last state of the Gibbs sampler as output. By default set to
1e3.- seed
Optional integer seed for reproducibility. If
NULL, a seed is generated from R's random number generator (soset.seed()can be used before calling this function).