Skip to content

Instantly share code, notes, and snippets.

View mnarayan's full-sized avatar

mnarayan mnarayan

View GitHub Profile
@mnarayan
mnarayan / Makefile
Last active August 29, 2015 14:00 — forked from yy/Makefile
Various makfiles for latex paper writing
TEX = pdflatex -interaction nonstopmode
BIB = bibtex
GS = gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite
COVER = cover
PAPER = paper_main
SUPP = paper_supp
BIBFILE = temp.bib
BUNDLE = paper_bundle.pdf
@mnarayan
mnarayan / Makefile
Last active August 29, 2015 14:00 — forked from tskrynnyk/Makefile
PANDOC = pandoc
%.html: %.md style.css Makefile
$(PANDOC) -c style.css -s -f markdown -t html --standalone -o $@ $<
%.odt: %.md Makefile
$(PANDOC) --standalone -f markdown -t odt -o $@ $<
%.epub: %.md Makefile
$(PANDOC) -o $@ $<
@mnarayan
mnarayan / Notes on Geodesic Convexity.md
Last active June 2, 2022 19:31
09_2014_Gconvexity

Geodesic convexity for matrix normal log-likelihood

*Definition of geodesic convexity (Section C of Weisel 2012) *. The geodesic of $Q_{1}, Q_{2} \in S^{p}_{++}$ is given by

$$ Q_{t} = Q_{1}^{1/2}(Q_{1}^{-1/2}Q_{2}Q^{-1/2}{1})^{t}Q{1}^{1/2}, \quad t \in [0,1]$$

This can similarly be extended for the tuple $S^{m}{++} \times S^{p}{++}$

@mnarayan
mnarayan / jekyll.py
Last active August 29, 2015 14:15 — forked from cscorley/jekyll.py
try:
from urllib.parse import quote # Py 3
except ImportError:
from urllib2 import quote # Py 2
import os
import sys
BLOG_DIR = os.environ['BLOG_DIR']
# BLOG_DIR = '/Users/cscorley/git/cscorley.github.io/'
---
$if(date)$
Date: $date$
$endif$
$if(title)$
Title: $title$
$endif$
---
<div>
@mnarayan
mnarayan / Notes on perturbational integration and segregation
Last active June 2, 2022 19:31
Notes on perturbational integration and segregation
# Notes on perturbation integration and segregation
(Notes can be permanently found/updated here http://bit.ly/1JbGEki)
Consider three distinct aspects of using functional segregation and integration in functional neuroimaging. Some thoughts after reading [Deco et al., 2015](http://www.nature.com/nrn/journal/v16/n7/full/nrn3963.html)
#### I. What do these information theoretic metrics mean for a fixed and known system (i.e. network) that consists of $p$ interacting units ?
@mnarayan
mnarayan / workflow-pipelines.md
Last active July 27, 2020 15:59
Tools for simulation and data analysis workflow management

Philip Guo summarized the problem quite well in Burrito. Are there any modern solutions to this problem ?

A nice collection of all tools provided by @pditommaso. Some subset worth trying out.

So far Sumatra/noworkflow/recipy/WorldMake appear to care most about provenance tracking; nextflow appears to be a very promising upgrade to gnu make for containerized data science pipelines.

  1. Nextflow
  2. Sumatra
  3. Luigi and SciLuigi
  4. Doit and an tutorial from sw
@mnarayan
mnarayan / CovariancesMeetComplexNetworks.md
Last active June 2, 2022 19:31
Why graph topological metrics applied to sample covariance graphs can blow up

Note: The betweenness centrality used here is based on the shortest path implementation in the Brain Connectivity Toolbox.

  1. Take a real known correlation matrix $\Sigma$
  2. Simulate multivariate data i.e. observations x regions matrix from normal distribution with known correlation matrix $\mathcal{N}(0,\Sigma)$
  3. For each random sample from step 2, compute betweenness-centrality for a series of thresholds on the correlation matrix. This constitutes one monte-carlo trial run in the first figure.
  4. One can vary the number of observations t from 100 to 500 and see the error bars on betweenness-centrality go down.

Take-ways: Network metric is unstable in two ways: A small change to the threshold leads to huge change in metric. As a result it is also highly unstable between monte-carlo trials as well. **Theory says that all shortest path based metrics are similarly unstable, with unpredictably large variance. Thus z-scores and t-tests don't even converge to any distribution let alone a normal one. There

@mnarayan
mnarayan / tex-to-pdf
Created December 20, 2015 18:04 — forked from AdrianoFerrari/tex-to-pdf
Node server to take Gingko Tex output into PDF
var TreeId = "your_tree_id_here";
var Filename = "output_filename";
var http =require('http');
var fs = require('fs');
var request = require('request');
var exec = require('child_process').exec;
var header = fs.readFileSync('parts/header.tex', 'utf8');
var footer = fs.readFileSync('parts/footer.tex', 'utf8');
var replacements = { '\\\\begin\\{center\\}\\\\rule\\{3in\\}\\{0\\.4pt\}\\\\end\\{center\\}': '\\hr', '\\\\section\{([^\}]*)\}\\\\label\{([^\}]*)\}\\n\\n([^\.]*[\\.\\\'\\\'\\?\\!]*)\\s': '\\finishchapter\n\\section{$1}\\label{$2}\n\\setupchapter\n\\newthought{$3} ' };
@mnarayan
mnarayan / springer-free-maths-books.md
Created December 29, 2015 00:03 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links