This page is hosted on AFS file server space, which is being shut down on November 13, 2018.
If you are seeing this message, your service provider needs to take steps now.
Visit afs.unc.edu for more information.

## Psych 285: Computational Statistics

and Statistical Visualization## Professor Forrest Young

## Assignment 1

Functional Programming - 1

Due Monday, January 29

Write CENTER, a function that column-centers a matrix X (i.e., makes the mean of each column zero). The function should take a matrix as its only argument and should return the centered matrix. Do this in the following two ways:

- Use the matrix functions ARRAY-DIMENSIONS, MAKE-ARRAY, TRANSPOSE, and MATMULT to implement the formula X-(1'*1*X)/n, where n is the number of observations.
- Use the Lisp functions APPLY, BIND-COLUMNS, MAPCAR, LAMBDA, MEAN and COLUMN-LIST to subtract the mean of each column from the column.
Please send your code to me by e-mail before class on the due date.

## To get in touch:

email: forrest@unc.edu WWW: http://forrest.psych.unc.edu