{ "metadata": { "name": "explaining_nipy_MFX" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "A notebook explaining the mixed effect model of Nipy" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In neuroimaging analyses, we often have several intra subject measurements, and need to draw conclusion at the group level across subject. This is well known as the mixed effect model (or hierarchical model). We denote the $Y_i$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$Y_i = X_i\\beta + \\epsilon_{1i} + \\epsilon_{2i}$$\n", "\n", "Or, accross subjects:\n", "\n", "$$Y = X\\beta + \\epsilon_{1} + \\epsilon_{2}$$\n", "\n", "\n", "where $X$ is our design matrix at the second level, $\\epsilon_{1}$ is the noise at the first level (the intra subject noise, that we assume known) and \\epsilon_2 is the noise at the second level (the group effect model).\n", "\n", "The $Y_i$ are the observed effects for subject $i$, usually the contrast you are interested in at the first level for subject $i$.\n", "\n", "We assume that $\\epsilon_{1i} \\sim N(0,v_{1i})$ with $v_{1i}$ the variance at the first level for subject $i$ and $\\epsilon_{2} \\sim N(0, v_2)$, $v_2$ the variances of the second level (across subjects). \n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import nipy\n", "print nipy.__version__" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "0.3.0.dev\n" ] } ], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }