An array of MultiZetaStimulus objects representing the stimuli to filter.
The name of the CAT model parameter to check for.
An object with two arrays: available and missing.
const items: MultiZetaStimulus[] = [
{
stimulus: 'Item 1',
zetas: [
{ cats: ['Model A', 'Model B'], zeta: { a: 1, b: 0.5, c: 0.2, d: 0.8 } },
{ cats: ['Model C'], zeta: { a: 2, b: 0.7, c: 0.3, d: 0.9 } },
],
},
{
stimulus: 'Item 2',
zetas: [
{ cats: ['Model B', 'Model C'], zeta: { a: 2.5, b: 0.8, c: 0.35, d: 0.95 } },
],
},
];
const result = filterItemsByCatParameterAvailability(items, 'Model A');
console.log(result.available);
// Output: [
// {
// stimulus: 'Item 1',
// zetas: [
// { cats: ['Model A', 'Model B'], zeta: { a: 1, b: 0.5, c: 0.2, d: 0.8 } },
// { cats: ['Model C'], zeta: { a: 2, b: 0.7, c: 0.3, d: 0.9 } },
// ],
// },
// ]
console.log(result.missing);
// Output: [
// {
// stimulus: 'Item 2',
// zetas: [
// { cats: ['Model B', 'Model C'], zeta: { a: 2.5, b: 0.8, c: 0.35, d: 0.95 } },
// ],
// },
// ]
Filters a list of multi-zeta stimuli based on the availability of model parameters for a specific CAT.
This function takes an array of
MultiZetaStimulusobjects and acatNameas input. It then filters the items based on whether the specified CAT model parameter is present in the item's zeta values. The function returns an object containing two arrays:availableandmissing. Theavailablearray contains items where the specified CAT model parameter is present, while themissingarray contains items where the parameter is not present.