Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the Cartesian Product to generate IV within a block #27

Open
gabrielDiaz-performlab opened this issue May 15, 2020 · 5 comments
Open

Comments

@gabrielDiaz-performlab
Copy link

gabrielDiaz-performlab commented May 15, 2020

Have you considered using the Cartesian Product to build blocks?

Here's an example json of an experiment with a practice block and a single main block.

"blockList": [ "block1","block2"],

"block1_IV": [ "independentVarA", "independentVarB"],
"block1_independentVarA": [ 0.5, 0.75, 1.0, 1.25, 1.5 ],
"block1_independentVarB": [ 0.4, 0.6, 0.8 ]

"block2_IV": [ "independentVarA", "independentVarB"],
"block2_independentVarA": [ 1.5, 1.75, 2.0, 2.25, 2.5 ],
"block2_independentVarB": [ 0.4, 0.6, 0.8 ]

If you were to specify a blocklist in your json, it could be used as a prefix (e.g. block1_) to then grab a list of experimental variables per block (eg. suffixes independentVarA, and independentVarB). This list could then be used to create the cartesian product of all independent variables (the factorial of List block1_independentVarA and List block1_independentVarB );

I'm not quite sure how to work in repetitions in a manner that provides flexibility to have unequal trial frequencies. Perhaps as another independent variable, e.g. "block1_repetitions": [ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,10], which would have 5 reps of all trials except for the final permutation (block1_independentVarA = 1.5, block1_independentVarB = 0.8);

There is also the issue of typing, and I see that session.settings.getType() has not yet been implemented.

I did take a crack at this myself, but I'm no c# guru, and decided to pass on the challenge once I realized the complexity.

@jackbrookes
Copy link
Member

jackbrookes commented May 16, 2020

Hi,

I think I would normally do nested for loops to achieve this. Detailed here:

https://github.com/immersivecognition/unity-experiment-framework/wiki/Factorial-design

Does that answer your issue, or are you suggesting this process be automated?

I know the above solution requires a few lines of code compared to a built-in solution, but I would generally prefer having trials be explicitly created rather than by some magic in the background based on names of settings variables.

@gabrielDiaz-performlab
Copy link
Author

gabrielDiaz-performlab commented Aug 3, 2020

Yes, it is a suggestion for some automation. This is such a critical component of experimental design that other labs have developed tools that have focused more specifically on this issue. Have a look here: https://www.biomotionlab.ca/tux/. The nice thing about their implementation is that it provides a table breakdown of the design the experimenter can visually inspect for issues.

@jackbrookes
Copy link
Member

jackbrookes commented Aug 4, 2020

It might not be well documented but UXF has a similar feature, but perhaps not as obvious. after you start the session, you can launch the UXF Session Debugger. I added details here:

https://github.com/immersivecognition/unity-experiment-framework/wiki/Common-issues#verifying-the-settings-of-your-trials--blocks

@jackbrookes
Copy link
Member

I think I'll have a go at this just by making a sample Experiment Generator script with an inspector that allows creating factors and their levels. Hopefully users would use this to see its quite easy and more flexible to write your own.

@jackbrookes
Copy link
Member

Still on my radar- maybe one day I will be able to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants