View source: R/optimize_blocks.R
| optimize_blocks | R Documentation |
Automatic construction of forced-choice tests based on the Simulated Annealing algorithm. Allows items to be:
Matched in either pairs, triplets, quadruplets or blocks of any size;
Matched based on any number of item-level characteristics (e.g. Social desirability, factor) based on any customized criteria;
Matched based on person-level inter-item agreement (IIA) metrics;
Optimally distributed at the global scale-level to ensure specific trait-pair combinations (e.g., evenly/unevenly distributing equal and/or mixed keyed pairs)
optimize_blocks(
blocks = NULL,
total_items = NULL,
temp_initial = NULL,
temp_eta = 0.01,
temp_cooling = 0.999,
temp_stop_ratio = 1e-06,
item_chars,
char_weights = NULL,
optim_funcs = NULL,
n_exchange = 2,
prob_new_item = 0.25,
use_iia = FALSE,
response_matrix = NULL,
iia_weights = c(BPlin = 1, BPquad = 1, AClin = 1, ACquad = 1),
trait_col = NULL,
key_col = NULL,
target_dist = NULL,
scale_fit_weight = 1,
prevent_overlap = FALSE
)
blocks |
An n by k integer matrix, where n is the number of item blocks and k is the number of items per block. Serves as the initial starting blocks for the automatic pairing method. |
total_items |
Integer value. How many items do we sample from
in order to build these |
temp_initial |
Initial temperature value. Can be left as |
temp_eta |
A positive numeric value. The ratio of initial temperature to
initial energy of |
temp_cooling |
A positive numeric value less than 1. Determines the reduction rate of the temperature after each iteration. Default is 0.999. |
temp_stop_ratio |
A positive numeric value less than 1.
Iteration stops when the temperature drops below |
item_chars |
An m by r data frame, where m is the total number of items to sample from, whereas r is the number of item characteristics. |
char_weights |
A vector of length r with weights for each
item characteristic in |
optim_funcs |
A vector of customized function names for optimizing each item characteristic within each block, with length r. |
n_exchange |
Integer value. Determines how many blocks are exchanged
in order to produce a new solution for each iteration.
Should be a value larger than 1 and less than |
prob_new_item |
A value between 0 and 1. Probability of choosing the strategy of picking a new item, when not all candidate items are used to build the FC scale. Default is 0.25. |
use_iia |
Logical. Are IIA metrics used when performing automatic pairing? Default is FALSE. |
response_matrix |
A p by m numeric matrix with scores of each of the
p participants for the m items. Ignored when |
iia_weights |
A vector of length 4 indicating weights given to each IIA metric: Linearly weighted AC (Gwet, 2008; 2014); Quadratic weighted AC; Linearly weighted Brennan-Prediger (BP) Index (Brennan & Prediger, 1981; Gwet, 2014); Quadratic weighted BP. |
trait_col |
Character string. The name of the column in |
key_col |
Character string. The name of the column in |
target_dist |
A data frame detailing the target distribution of trait-pair combinations
for global scale-level fit. Must contain columns |
scale_fit_weight |
Numeric value. The weight applied to the global scale-level fit penalty relative to the local block-level energy. Default is 1.0. Increase this value to prioritize global trait distribution over local block matching. |
prevent_overlap |
Logical. If target_dist is specified, should strict prevention of trait overlap (i.e., block containing items measuring the same trait) be enforced? Default is FALSE. |
A list containing:
block_initial: Initial starting block
energy_initial: Initial energy for block_initial
block_final: Final paired block after optimization by SA
energy_final: Final energy for block_final
The essence of SA is the probablistic acceptance of solutions inferior to
the current state, which avoids getting stuck in local maxima/minima.
It is also recommended to try out different values of
char_weights, iia_weights, temp_eta to find out the best
combination of initial temperature and energy value
in order to provide optimally paired blocks.
Mengtong Li
Brennan, R. L., & Prediger, D. J. (1981). Coefficient kappa: Some uses, misuses, and alternatives. Educational and Psychological Measurement, 41(3), 687-699. https://doi.org/10.1177/001316448104100307
Gwet, K. L. (2008). Computing inter rater reliability and its variance in the presence of high agreement. British Journal of Mathematical and Statistical Psychology, 61(1), 29-48. https://doi.org/10.1348/000711006X126600
Gwet, K. L. (2014). Handbook of inter-rater reliability (4th ed.): The definitive guide to measuring the extent of agreement among raters. Gaithersburg, MD: Advanced Analytics Press.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.