Skip to content

Instantly share code, notes, and snippets.

View jooh's full-sized avatar

Johan Carlin jooh

View GitHub Profile
@jooh
jooh / #mergedriver
Created July 14, 2021 14:51
Use git merge driver to always resolve conflicts in file VERSION in favor of merge target
Use git merge driver to always resolve conflicts in file VERSION in favor of merge target
@jooh
jooh / Untitled.ipynb
Created September 25, 2019 15:22
Notebook markdown table test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jooh
jooh / test_rfx_ffx.m
Created November 17, 2017 17:28
Matlab simulation comparing permutation tests to parametric RFX and FFX inference
% 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
@jooh
jooh / test_multirsa_again.m
Created November 17, 2017 17:25
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.
% 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
@jooh
jooh / QT_parCorrVsRegression.m
Last active May 4, 2016 06:57
Matlab demo of relationship between partial correlation and multiple regression
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;
#!/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