User Tools

Site Tools


creating_formula_images

Creating formula images

Motivation

Many concepts in neuroscience can be condensed into a (series of) mathematical equation(s). A prominent example is the ordinary least-squares multiple regression case, which uses the outcome of the matrix inversion of the covariance matrix of the design:

The data (y) is being explained by the product of the regression weights (beta/s) and the design matrix (X), plus the residual error term (epsilon):

OLS equation

After solving the normal equation that suffices the condition that the sum of squares of errors (SSE) is minimized, the result is:

OLS equation solution

Of course, this is just an example! :)

Requirements

  • the actual (set of) formula(s) to be plotted
  • access to a web browser (which you obviously have…)
  • understanding of how to re-write the formula in the required markup

Instructions

  • if you haven't done so (and the formula isn't already in written form), take a moment and write down the formula on a piece of paper, which will help you in creating the required markup language
  • go to the PhpMathPublisher web page on this server
  • enter the size of the output (the formula images above were made with a size setting of 14)
  • translate the formula into markup language
  • create the formula image and, if necessary, re-fine the markup language
  • once you're satisfied, save the image onto your local computer (e.g. CTRL-click into the image and select “Save image”)
  • on the article you want to use this image, use the image upload button from the toolbar above the article source code area to upload the image, choosing a unique name that is unlikely to clash with other image names, and then select the filename of the uploaded image to add the markup language into article source

W.r.t. the formulas on this page, here is the code that was used to generate the images above:

  • OLS data equation:
    y = X beta ~ + ~ varepsilon
  • OLS solution:
    hat{beta} = (X^T X)^ {-1} X^T y
creating_formula_images.txt · Last modified: 2011/04/05 03:51 by jochen