Using SVD for Least Squares Problems in MATLAB

Click For Summary

Homework Help Overview

The problem involves using Singular Value Decomposition (SVD) to analyze average monthly temperature data for Dubuque, Iowa, from 1964 to 1975. The objective is to fit a model to the data using trigonometric terms and to find suitable coefficients for different values of k.

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning

Approaches and Questions Raised

  • Participants discuss the initial steps for organizing the temperature data into matrix form suitable for SVD analysis. Questions arise about the structure of the equations and the interpretation of the coefficients involved in the model.

Discussion Status

The discussion is ongoing, with participants exploring the application of SVD in the context of least squares problems. Some guidance has been offered regarding the setup of the equations and the use of MATLAB routines for data handling, but there is no explicit consensus on the approach yet.

Contextual Notes

Participants are considering the implications of using SVD for an overdetermined system and the necessity of constructing a matrix from the temperature data without manually entering each value.

squenshl
Messages
468
Reaction score
4

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.

Homework Equations


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.
 
Physics news on Phys.org


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 [tex]T_j[/tex]. For the case k = 2, the unknowns are [tex]a_0, a_1, a_2, b_1, b_2[/tex]

For example, for the month 5, the equation is

[tex]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[/tex]

(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:


And how does that answer your question?
 


What have you been taught about using SVD as an approach to solving a least squares problem?
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 3 ·
Replies
3
Views
20K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 45 ·
2
Replies
45
Views
7K