CogSci 109

Modeling and Data Analysis

Please check site frequently for changes

last updated: Wed, Dec 13, 2006, 9:38pm

Frequently Asked Questions




Course Description

This course will cover modeling and data analysis for Cognitive scientists, scientists of other disciplines, and Engineers. Emphasis will be given to the Cognitive perspective, with examples drawn from topics relevant to cognitive scientists.

Topics may include programming tools, matlab, linear algebra, linear regression, nonlinear regression (polynomial and exponential fits), basic statistical analysis (mean, standard deviation, mode, median, hypothesis testing), numerical solution of differential equations, optimization, curve fitting, and data visualization. Neural networks will be included as well if time permits.

The objective of this course is to give fundamental tools to the student which will allow the student to effectively analyze data from experiments, extract information, and understand standard analyis tools commonly found in the literature of science and engineering. The student will also be given many resources from which to draw in the future, thus allowing them to expand their knowledge and skills.

Theory lectured on in class will be followed up with readings to expand on the concepts, homeworks to give experience with the techniques, and additional references/readings of research work in the field applying these techniques (demonstrating how these techniques are applied in real life).



Grading will follow the fill-the-bucket principle. For each homework assignment and for the Midterm and Final test you will get score points. These will be added. The grade will be based on your score and the maximum achievable score. The course average will be scaled (only up if need be, not down!)


~ <= 7 projects


<= 1 final project


1 midterm exam


1 final exam

total possible will be around 1000 pts, plus bonus
100%+ bonus

 Cheating and Academic Honesty Policies

First of all please DON'T CHEAT!!! It detracts from your learning in this class. When you go into the world you won't have the skills you should have gained here. Our goal is to help you learn, so if you have any problems, please come speak with us and we will help you resolve them to the best of our ability. That being said, the definition of cheating must be defined clearly:

Cheating on exams involves any form of copying from another student, giving or getting answers from another student, acquiring information in any way from an external source during the exam, or giving information to or receiving information from another individual which you should not receive during an exam (ie theories, data, answers, etc). You may ask questions during an exam of the instructor or TA's at any time. The TA's are not to give answers directly, but may provide hints.

Cheating on homeworks involves duplicating another person's code. You are to write your own code, unless the instructional team provides a starter code, or sample code for you to use. You may not use code from sources other than this course. You may not copy another student's code. However, you ARE encouraged to help each other and discuss the homeworks and material from the course. It is often through explaining something that one learns that concept even better than before. But when it comes to writing the code, you must do the actual writing of your own code. Programming is very much something you must do as well as study to learn it well, very similar to driving.

The Standard academic honesty policies of the university apply during this course as well. Click here for details


Textbooks and References

(required and recommended)

Introduction to Matlab (pdf) There will be several readings from this onine book. If you prefer to read from paper rather than on the computer, take this file to Imprints and have a printout made and bound.

See handouts for more readings

Note: No textbooks are required at this time, however there will be weekly PDF handouts, lecture notes, online books and tutorials assigned as reading. There will also be a few recommended texts.

Other References

Many of these books may have newer editions. The most up to date is often useful.



Most assignments will be due on Wednesdays (for all sections) by turning in to a WebCT-based turn in page. Typically students will have one week for the assignment.

Assignment # Description Date Due Points Reading Assignment
0.1 Tues, Sept 26, 2006 --
  • Read Getting Started with Matlab, pages (1.2-1.8,2.1-2.32 , 4.2-4.7, 6.1-6.24)
  • Read Greek Letters, Symbols and Operators (pdf)
  • It is quick reading, so it goes by fast. If you have access to Matlab from home, it helps to follow along with the reading, otherwise you could go to a computer lab with matlab installed (CSB115) - we will go over how to run matlab remotely (ie from a computer which does not have matlab installed, but has an internet connection and a login account)
 Math review (Review and perform as many problems as you can. If you cannot do a group of problems, review material from that section. The review is divided into different areas of math with reading references given for each)  Thurs Oct 05, 2006 50 pts total for turning in efforts for 3 problems from each section (a total of 12 problems must be attempted. Must show work. 5 bonus points possible for completing all problems with over 80% correct
  • Math review paper - provides an overview of the mathematics you should know (or at least be familiar with) for this course.
1 Click here for pdf of assignment 2 Basic visualization, code optimization, and filtering Thurs, Oct 19, 2006

HW2 Due DATE EXTENDED TO THURSDAY!!! See announcement for discussion

100 pts, 5 bonus points possible
Click here for pdf of assignment 3  Visual communication, interpolation/extrapolation, least squares, and statistics Thursday, Nov. 2, 2006

(But since the midterm is thursday you can turn it in friday Nov. 3 at either of the sections. It is recommended you try to get it done before the midterm because it will help you study for the midterm.)

 100 pts, 10 bonus points possible
Click here for assignment 4 pdf BOB - modeling a new life form's behavior using optimization and function fitting (matlab fminsearch and gradient descent, with error analysis)  Thursday Nov 16, 2006


 100 pts., 10 bonus points possible
  •  download the data set here
  • there will be some readings to deepen your understanding of these methods, but not all will be required
  • Read numerical methods book Ch5, covers minimization and gradient descent (focus on the introduction, and then the gradient descent parts). This chapter covers more than the lecture material, and it's ok if you don't understand every detail fully, but this will be useful in the future, and it will explain in depth the gradient descent algorithm.
Click here for reading assignment (more posted soon)  This assignment consists of a group of readings to balance your understandings, demonstrate common applications of these theories  Thurs, Nov 30, 2006  --  Here are each of the reading papers
Click here for assignment 5  This assignment consists of you finding a paper that interests you which is related to Neural Networks, reading it and writing a short 1-2page paper  Tues, Nov. 28, 2006  50 pts, 5 bonus pts. automatic for turning in assignment!!!  See links section and lecture notes for information on neural networks
Please read the following  Material from this reading will be on the final  ---  ---
assignment 6/ short answer takehome section of final Recommended turn in at final, due by Saturday 12 midnight CRB 2nd floor outside the Brain and Cognition lab door in the box Due Saturday night midnight (Dec 9) 200 pts, 15 bonus pts
  • Matlab neural network toolbox documentation (peruse and use help newff, help train, help purelin, help tansig)
  • Data set for homework 6/final section


Instructional Team


C. Alex Simpkins, MS, C. Phil.

email: csimpkin "at" ucsd "dot" edu

Office hours:

Mon 12:50-1:50
Earls Place in Warren
Wed 12:50-1:50
Muir Woods Coffee Shop
Thurs 5-7
Muir Woods Coffee Shop
Fri 12:50-1:50
CSB115 Computer lab

UCSD Department of Mechanical and Aerospace Engineering, UCSD 0411

9500 Gilman Drive




Dan Liu

858 822.4122

dliu "at" cogsci "dot" ucsd "dot" edu

OH : Monday 10am-1pm, CRB 249 858-822-2421 (must call to get in to area)

Nick Butko

nbutko "at" cogsci "dot" ucsd "dot" edu

OH: Tuesday 9am-10am, csb115
Thursday 8am-9am, csb115
Friday, 12-1, Art of Espresso (csb115 if raining)

Nathaniel Smith

njsmith "at" cogsci "dot" ucsd "dot" edu

OH: T 12:30-1:30
W 2:30-3:30
Th 2:30-3:30
CSB 127 for now.

Labs and locations

For lab access: click here

TA Section
TuTh 3:30p - 4:50p
Lab A01
Tu 8-8:50am
CSB 115
Lab A02
Tu 2-2:50pm
CSB 115
Lab A03
Th 1-1:50pm
CSB 115
Lab A04
Fri 2-2:50pm
CSB 115
Lab A05
Fri 3-3:50pm
CSB 115
Lab A06
Th 12-12:50pm
CSB 115

Lectures (tentative)

Lecture location
TuTh 3:30p - 4:50p

Click the links in the topics column to download pdf of lecture notes.

Current week is highlighted in yellow. Topics may change slightly (or order of topics).

Lecture # Date Topics Description Section topics Homework
1 Thurs Sept 21, 2006 Course organization, contents, logistics, introduction to modelling and data analysis concepts No section Thursday and Friday (Sept 21 and 22) Assignment # 0.1-0.2 Due Tuesday and the next Wednesday respectively
2 Tues Sept 26, 2006 Matlab, math review, basic data manipulation Matlab, introduction to course resources
3 Thurs Sept 28, 2006 getting matlab (running remotely), review of programming concepts by demonstration, functions, matlab plots, importing files (ascii, binary, mat) -offer after class review and office hours of programming, math homework, improving remote speed, basic data visualization, fileIO, memory, toolboxes Matlab, introduction to course resources Assignment 0.2 assigned: Due Thurs. Oct. 5, 2006
4 Tues Oct 3, 2006
Analog vs. Digital, Continuous/Discrete, digitization, sampling, aliasing, filtering (low pass and high pass), two simple easy filters Matlab plotting, math review
5 Thurs Oct 5 2006 Some Filtering details, matlab functions, examples, color theory introduction Matlab plotting, math review
6 Tues Oct 10, 2006 Effective visualization, color maps, perception, good presentation, demonstrations, CIE Chromaticity, RGB, CMY, CMYK, HSV, False color representation, color constancy, basic occular physiology Visualization Assignment 2 assigned: Due Thurs Oct 19, 2006
7 Thurs Oct 12, 2006 plus super/subsampling, fourier transforms Visualization
8 Tues Oct 17, 2006 Stats, homework discussion, matlab examples
9 Thur, Oct 19, 2006 plus matlab implementation, discussion of the midterm, next assignment timing, and announcement of midterm review Stats, homework discussion, matlab examples
10 Tues, Oct 24, 2006 Interpolation is an important concept for numerical integration and differentiation. There are many forms of interpolation, one group of which we've seen with least squares. Here we see another group, examples, and matlab implementation. How to LERP, BERP, TERP, and SLERP the right way. least squares, more stats examples
11 Thurs Oct 26, 2006 SLERP, lagrange, splines, homework announcement least squares, more stats examples
12 Tues Oct 31, 2006 (how good is your model?) The concept of error as uncertainty. Splines introduction homework/midterm review
13 Thurs Oct 2, 2006 homework/midterm review Homework 3 due (can turn in on Friday at sections but it will help you study for test)
14 Tues, Nov 7, 2006 Nonlinear function fitting of functions with nonlinear parameters. Nelder-Mead Simplex method (FMINSEARCH IN MATLAB) error analysis, uncertainty, examples
15 Thurs, Nov 9, 2006 Review of course up to now, course organization and progress report (you're doing well!), project discussion, optimization, method of steepest descent, conjugate gradient error analysis, uncertainty, examples Homework 4 assigned, due Thursday, Nov 16, 2006
16 Tues Nov 14, 2006 review of homework 4, hints, conceptual introduction to neural networks gradient descent, homework review
17 Thurs Nov 16 2006 Review of homework 4 took a while, so some of this lecture was review. Little dog. Threshold logic units, the history of neural networks, and perceptrons, as well as examples, neural networks for boolean logic, failures of single neurons to solve all possible problems gradient descent, homework review Homework 4 due data Fri Nov 17
18 Tues, Nov 21, 2006 Modern neural network theory, multi-layer networks, examples, some common structures and modeling methods, function fitting and classification, if time no section
Thurs Nov 23, 2006
  • Thanksgiving vacation
NO CLASS THURSDAY!!! no section
19 Tues Nov 28 2006 improving weight convergence, avoiding overfitting, application of hopfield networks to associative memory and general unsupervised learning concepts single and multi-layer ANN's, review, sorting out homework/midterm issues homework 5 due tues nov 30, 2006
20 Thurs Nov 30 2006 AI search methods in addition, hypothesis testing, reading results in papers (Heuristics, A*, etc) single and multi-layer ANN's, review, sorting out homework/midterm issues

Final Exam :12/07/2006 Th 3:00p - 5:59p CENTR 105


Some of these will be assigned reading, others are recommended. Please see the lectures section for when to read each, but you are encouraged to read ahead.

Handout name/# Description   Handout name/# Description
 Introduction to Matlab. Covers the basics from running Matlab to matrix manipulation and graphing hints on limits and continuity!
 A review and reference of the greek alphabet, mathematical symbols and operators which you will likely need for this course or in the future! Matlab examples from lecture 4 : plotting examples The example scripts are here for plotting: example1.m, example2.m, example3.m
 Review of mathematics relevant to this course (will continue to be updated throughout the quarter)  

From lecture 4

A brief animation depicting a matrix transpose operation
  • Programming
    From lecture 5 : filtering  a simple moving average filter implementation in matlab as a function - also serves as an example of how matlab functions work.
  • What is modeling?
     for discussion section 3d plotting and visualization
  • Data Visualization
     data sets for homework 2
A text which was written at UCSD by a Professor of computational science and engineering, Thomas R. Bewley. Covers many areas of useful numerical methods. A great reference    Hints and answers to frequently asked questions from homework 2
  • False Color Representation
 Data must be 'viewed' appropriately to expose salient features. Here are several strategies    how to make a custom colormap in matlab
 An exerpt from Dan Olphe's book 'Computer Graphics for Design: From Algorithms to AutoCAD.' This chapter gives an explanation of color theory.    Handout for linear and nonlinear least squares partial differential equation derivation and matlab implementation. Also a second file which demonstrates and explains specifics of linear least squares (extendable to nonlinear polynomial fits) is linked here.
 An exerpt from Dan Olphe's book 'Computer Graphics for Design: From Algorithms to AutoCAD.' This chapter gives an explanation of various data fitting methods. We'll only be using some of these, but you can read more.    The example we wrote in class for linear interpolation of 2D data. It is well commented now.
  • Search methods
 Heuristics, A*, etc    It is highly recommended that you learn how to create Latex (pronounced 'lay-tech') documents. Here are a couple of tutorial introductions (pdf's)
  • Lighting
     Scientific visualization and communication are important to understand and incorporate into whatever career you take.
Midterm review topics list, keep checking for a hints document and practice midterm soon You can download the data set here for homework 3 (or from the assignments section)
A fairly useful online html book to read about neural networks and applications to learning, automata, pattern recognition, etc. Specific readings are assigned from a few sections of this book Replacement histogram function for your homework 3. The lab computers have a problem with the hist function. To use, make sure this code is in your matlab path, or in the same directory as your homework code
A brief history from the roots of computational machines and automata to modern times, linking philosophy, mechanical engineering, mathematics, and cognitive science An example of using matlab's nonlinear function minimization algorithm to fit functions which may be nonlinear in the parameters (ie y=a*sin(b*x)+c*x+d)
a demonstration of a single unit perceptron and gradient descent with weight decay training algorithm, demonstrated in class Practice gradient descent by going through this code, the reading in ch5 of numerical methods, and practicing several problems - ie make up A and b, and find the coefficients x
The practice final. The actual final will be about double the length. Here is a list of topics to review for the final. It clearly states what was from pre-midterm although the final IS CUMULATIVE

Frequently Asked Questions


Old Announcements