# Math 481/581, Assignment 3

This assignment contributes towards Project 2.

## Purpose

This purpose of this assignment is to learn and use the fundamental commands of Octave or Matlab:

• The commands for creating and manipulating matrices:

1. eye, zeros, ones
2. a(1:5,:) and such
3. *, / and backslash
4. pinv
• The commands for acquiring moderate amounts of data into matlab automatically
• Setting up linear models: regression, polynomial models, exponential models
• To learn how to produce PostScript graphics in Octave and Matlab
• To combine these skills with LaTeX in order to create a scientific paper

## Details

### Data

In this assignment you will collect a data set including 100-10000 data points (for instance, height and weight of a sample of 100 persons). Several suggestions for data sets are included below. You will collect the data into a file, and read into Octave or Matlab. The data should come in the format (xi, yi).

### Models

You will seek a linear, polynomial or exponential model that matches the data, i.e. you will see if one of the following relationships approximated the dataset well:

• A simple linear model:

yi = a xi + b

• A polynomial model:

yi = ∑nk=1akxik + b,

where n is a small number, say, 1-5.

• The exponential model, which reduced to the above by taking the logarithms of the data:

yi=B eA xi

• The models without the \"intercept\" b

The above models are the most simple models because they only require solving linear equations. While more complex models are of interest, in this assignment we are only interested in ones which lead to linear equations By solution we mean the least squares fit, i.e. the collection of the parameters of the model which minimized the sum of the squares of differences between the experimental values of yi and the values computed from the model.

### Paper

Write a short paper in LaTeX discussing your results. For instance, you may notice that one of the models is better than others. Also, you should use \"Occam's razor\" which should be interpreted as follows: if two models produce about the same mean square error then the one with fewer parameters should be chosen.

Your paper should include plots of the data points and of the line representing the model. The axes should be labeled and the plot should have a title. The plot should be enclosed in a LaTeX figure.

Your paper should follow the format customary to the subject area. Typically they will include sections:

• Introduction
• Materials and Methods
• Results

You should cite all relevant sources, including the source of your data. You should pay attention not to violate the law when using copyrighted material.

## What to turn in?

You should submit the LaTeX paper, the bibliography in BibTeX format, the Matlab/Octave scripts which were used to generate the data used in the paper and the figures. In short, everything that is needed to recreate your paper. You should also include the output of dvips named paper.ps.

If you are using WebDAV to submit your assignment, all files should be in subfolder hw3 of your main folder. If you are using the alternative method, you need to make a Zip archive of all relevant files named hw3.zip. The rchive hw3.zip should be submitted by clicking here.

Note: Please do not put the archive hw3.zip in your WebDAV folder!