{{ message }}

Instantly share code, notes, and snippets.

Johan Carlin jooh

Created Jul 14, 2021
Use git merge driver to always resolve conflicts in file VERSION in favor of merge target
View #mergedriver
 Use git merge driver to always resolve conflicts in file VERSION in favor of merge target
Created Sep 25, 2019
Notebook markdown table test
View Untitled.ipynb
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Nov 17, 2017
Matlab simulation comparing permutation tests to parametric RFX and FFX inference
View test_rfx_ffx.m
 % Explore correspondence between different types of permutation tests and % parametric stats inference (FFX/RFX). We test two classes of permutation test: % a within-subject permutation approach (Stelzer et al., 2013, NI), and the % standard sign-flip permutation test (Nichols/Holmes, 2001, HBM). % % OBSERVATIONS: % * RFX parametric and sign flip permutation p values are highly similar, as % expected % * FFX parametric and within-subject permutation p values are highly similar % * using T as the test stat for within-subject permutation test seems to make
Created Nov 17, 2017
Matlab simulation demonstrating how squared distance matrices can be linearly combined - probably requires my pilab and matlab-plotting repos at least. Generates a nice figure at the end.
View test_multirsa_again.m
 % demonstration of how squared distances can be combined linearly in % multiple regression RSA, while ordinary distances cannot. In this case % the distortions from doing multiple regression are relatively subtle but % perhaps the difference could be made more dramatic by other means. % % Actually, the less subtle effect is on parameter estimates - the fits % from model_multi2 below are [.5 .5], which is absolutely correct since % the predictors were already scaled to match the data. By contrast the % non-squared fit comes up with [.41 .65] - regardless of how minor the % distortions are in the overall fitted RDM, the parameter estimates are
Last active May 4, 2016
Matlab demo of relationship between partial correlation and multiple regression
View QT_parCorrVsRegression.m
 function QT_parCorrVsRegression % QT_parCorrVsRegression.m % When comparing a reference RDM to a candidate RDM, we might want to % partial out the contribution of another RDM on the correlation between % the candidate and the reference RDMs. % this could be done via partial correlations or linear regression. % this scripts demonstrates that the two approaches are identical. % clear;clc;close all %% control parameters nCond = 72;
Created Jan 5, 2016
View unisync
 #!/bin/tcsh # # by: Johan Carlin # date: 8/9/2014 # purpose: sync folders between computers. Assumes that both are available # on the local network (ie you are using VPN if the host is behind a # firewall) # usage: unisync [ucl] [j.carlin] # get optional input