# Singular value decomposition

## Homework Statement

The link http://www.york.ac.uk/depts/maths/data/ts/welcome.htm gives the average monthly temperature T in Fahrenheits for Dubuque, Iowa from 1964 to 1975. Let T = a0 + sum from i = 1 to k of ai cos(2*pi*i*m/12) + sum from i = 1 to k of bi sin(2*pi*i*m/12) where m is the number of months from January, 1964.
Use the SVD and matlab to find suitable values of a and b for k = 2 and k = 4. As part of your answer include a plot which displays the data abd T for k = 2 and k = 4.

SVD equations

## The Attempt at a Solution

How do I even start to answer the question. Do I put the 144 data values in matrix form and use the svd command in matlab.

Stephen Tashi

Have you studied how to use the SVD in getting the best solution to an overdetermined system of equations?

The way I look at this problem, you have a linear equation for each month of data. For month j , the right hand of the equation is the temperature $$T_j$$. For the case k = 2, the unknowns are $$a_0, a_1, a_2, b_1, b_2$$

For example, for the month 5, the equation is

$$a_0 + a_1 \cos(2\pi(1)(5/12)) + a_2 \cos(2\pi(2)(5/12)) + b_1 sin(2\pi(1)(5/12) + b_2 sin(2\pi(2)(5/12) = T_5$$

(The coefficients of the unknowns are all numerical values than you can compute.)

The matrix is the big matrix that defines this system of linear equations.

There are routines in matlab to read data from files and construct matrix entries from computations. I don't think you are meant to type-in each entry of the matrix by hand.

I just copied the data from the website and then applied the svd command in matlab to get 3 matrices U, S, V.

Last edited:
HallsofIvy
Homework Helper