(I presume this will also work with the previous version of matlab, but if you have that version, you are probably running the older, matlab version of psignifit that does not run on python.)
1. Make sure you have xcode installed so that you can use the compiler. To find out if you have xcode, open up a terminal window (they are in Applications/Utilities) and type “gcc”. If that works, you have xcode! The tricky part is that you need xcode 3 and NOT xcode 4. To see whether you have xcode 3, go to your applications folder, right click on xcode and do “get info”. Look for the version. If you have version 4, you need to get version 3. The difficulty with xcode4 is that is comes with gcc4.2 instead of gcc4.0. Some folks on the psignifit users group were able to install with gcc4.2, but I got an error when I did this and could not continue.
2. Download the correct version of python. All these instructions are for python 2.6.6. That is not the most recent version! The most recent is 2.7 but psignifit is not compatible with it (lame). So go here: http://www.python.org/download/releases/2.6.6 and click on the disk image for mac. It will download, then click on it and perform an ordinary install.
3. Now, download some libraries that apparently do something important:
- Numpy http://numpy.scipy.org. Get numpy 1.6 for python 2.6
- Scipy http://www.scipy.org. Get scipy for python 2.6 (not the most recent version)
- Matplotlib http://matplotlib.sourceforge.net. Also make sure it is for python 2.6
4. Download psignifit here: http://psignifit.sourceforge.net/INSTALL_MAC.html. Put it in your home directory and install it.
5. Now, open up a terminal window again (just like you did in step 1). Navigate into the psignifit folder that you downloaded (eg, cd /home/whoeveryouare/psignifit_3.0_beta…
6. Type: python setup.py install
7. Install the command line interface for python:
a. go to the python directory again, but this time, don’t navigate there in the terminal, navigate there using the finder.
b. Open up Makefile using a texteditor, and change the line that says:
Once, you have done that, go back to your terminal windown, navigate into the psignifit directory again (perhaps you are already there!) and type:
8. Open up your .bash_profile that lives in your home directory (there is no .bashrc for osx) using xemacs (eg,
cd /home/whoever/ emacs .bash_profile)
add a new line:
(this is assuming you put the psignifit stuff in your home directory; if you put it in a bin, specify that).
9. At this point, you want to test to see if you can call the psignifit functions. You should go into the directory where a file called, “psignifit-mcmc” lives. I think this will be inside the “cli” directory that is within your psignifit folder. But it also might be in a directory in your home directory called, “bin”. You could always look for it in the finder if you get desperate. Once you find it, type:
Hopefully you won’t get any errors.
10. Add the matlab directory withing the psignifit directory to your matlab path. Its name is mpsignifit.
11. I think that this extra step is necessary: there are 4 executable files in the psignifit/cli directory. Presumeably if one’s path is specified correctly, one should be able to call them from the command line and access them. However, on 3/4 installs, this didn’t work for me, and so I copied those files from the cli directory into /usr/bin. The files are: psignifit-bootstrap, psignifit-diagnostics, psignifit-mapestimate and psignifit-mcmc. Remember that when you are copying stuff to /usr/bin, you will likely have to authenticate with your password because that is a protected directory.
12. Now test to see whether you can call psignifit from matlab using our sample code. Go to dropbox/behav_data, and download test_percent_correct_data.mat
load that into a matlab workspace. Make sure that you have our matlab directory in your path: /Dropbox/essential_matlab. In your workspace, type:
>> test_data = test_data_percent_correct
>> [xout yout B diagnotic_stuff] =psych_fit_plot(test_data(1,:),test_data(2,:),test_data(3,:))
And psignifit should fit your data!
Click Here for sample matlab code.