1313# ' in specifying their model.
1414# '
1515# ' The Blume-Capel option is specifically designed for ordinal variables that
16- # ' have a special type of reference_category category, such as the neutral
16+ # ' have a special type of baseline_category category, such as the neutral
1717# ' category in a Likert scale. The Blume-Capel model specifies the following
1818# ' quadratic model for the threshold parameters:
1919# ' \deqn{\mu_{\text{c}} = \alpha \times \text{c} + \beta \times (\text{c} - \text{r})^2,}{{\mu_{\text{c}} = \alpha \times \text{c} + \beta \times (\text{c} - \text{r})^2,}}
2323# ' \eqn{\alpha > 0}{\alpha > 0} and decreasing threshold values if
2424# ' \eqn{\alpha <0}{\alpha <0}), if \eqn{\beta < 0}{\beta < 0}, it offers an
2525# ' increasing penalty for responding in a category further away from the
26- # ' reference_category category r, while \eqn{\beta > 0}{\beta > 0} suggests a
27- # ' preference for responding in the reference_category category.
26+ # ' baseline_category category r, while \eqn{\beta > 0}{\beta > 0} suggests a
27+ # ' preference for responding in the baseline_category category.
2828# '
2929# ' @param no_states The number of states of the ordinal MRF to be generated.
3030# '
5353# ' ``blume-capel''. Binary variables are automatically treated as ``ordinal’’.
5454# ' Defaults to \code{variable_type = "ordinal"}.
5555# '
56- # ' @param reference_category An integer vector of length \code{no_variables} specifying the
57- # ' reference_category category that is used for the Blume-Capel model (details below).
56+ # ' @param baseline_category An integer vector of length \code{no_variables} specifying the
57+ # ' baseline_category category that is used for the Blume-Capel model (details below).
5858# ' Can be any integer value between \code{0} and \code{no_categories} (or
5959# ' \code{no_categories[i]}).
6060# '
106106# ' interactions = Interactions,
107107# ' thresholds = Thresholds,
108108# ' variable_type = c("b", "b", "o", "b", "o"),
109- # ' reference_category = 2
109+ # ' baseline_category = 2
110110# ' )
111111# '
112112# ' @export
@@ -116,7 +116,7 @@ mrfSampler = function(no_states,
116116 interactions ,
117117 thresholds ,
118118 variable_type = " ordinal" ,
119- reference_category ,
119+ baseline_category ,
120120 iter = 1e3 ) {
121121 # Check no_states, no_variables, iter --------------------------------------------
122122 if (no_states < = 0 ||
@@ -187,24 +187,20 @@ mrfSampler = function(no_states,
187187 }
188188 }
189189
190- # Check the reference_category for Blume-Capel variables ---------------------
190+ # Check the baseline_category for Blume-Capel variables ---------------------
191191 if (any(variable_type == " blume-capel" )) {
192- if (length(reference_category ) == 1 ) {
193- reference_category = rep(reference_category , no_variables )
192+ if (length(baseline_category ) == 1 ) {
193+ baseline_category = rep(baseline_category , no_variables )
194194 }
195- if (any(reference_category < 0 ) || any(abs(reference_category - round(reference_category )) > .Machine $ double.eps )) {
196- stop(paste0(
197- " For variables " ,
198- which(reference_category < 0 ),
199- " ``reference_category'' was either negative or not integer."
200- ))
195+ if (any(baseline_category < 0 ) || any(abs(baseline_category - round(baseline_category )) > .Machine $ double.eps )) {
196+ stop(paste0(" For variables " ,
197+ which(baseline_category < 0 ),
198+ " ``baseline_category'' was either negative or not integer." ))
201199 }
202- if (any(reference_category - no_categories > 0 )) {
203- stop(paste0(
204- " For variables " ,
205- which(reference_category - no_categories > 0 ),
206- " the ``reference_category'' category was larger than the maximum category value."
207- ))
200+ if (any(baseline_category - no_categories > 0 )) {
201+ stop(paste0(" For variables " ,
202+ which(baseline_category - no_categories > 0 ),
203+ " the ``baseline_category'' category was larger than the maximum category value." ))
208204 }
209205 }
210206
@@ -347,7 +343,7 @@ mrfSampler = function(no_states,
347343 interactions = interactions ,
348344 thresholds = thresholds ,
349345 variable_type = variable_type ,
350- reference_category = reference_category ,
346+ baseline_category = baseline_category ,
351347 iter = iter
352348 )
353349 }
0 commit comments