Question: In this assignment, we are interested in using Python to solving a weighted least squares (WLS) problem. Compared to ordinary least squares that minimizes

In this assignment, we are interested in using Python to solving a

 weighted least squares (WLS) problem. Compared to ordinary least squares that minimizes 

In this assignment, we are interested in using Python to solving a weighted least squares (WLS) problem. Compared to ordinary least squares that minimizes the mean squared error, the WLS problem instead assigns a unique weight o, to each sample and minimizes the weighted mean squared error WMSE(W) (x/w-1), where (x,y) (for 1 i m) represents a training sample and its target, a, ER (usually positive) is the weight assigned to sample i and w = [, ,w] Rd are the parameters we want to estimate. As in lecture, we can stack the training samples and targets into a matrix (known as the design matriz) and vector respectively. We denote these as X X -N For example for d = 2 and m=5, we may have the design matrix, target vector respectively as [1 4 4 2 2 5 6 1 3 -3 9 -10 m A 7. 01 0 A = and y= and y We may also transform the weights a,02,..., into a diagonal weight matrix A Rmxm as 0 (X2 ... 0 For example, if (0, 02, 03, 04, 05)= (1,2,1,3, 0.5), then 0 3/1 3/2 /m Om 1 000 0 0200 0 00 1 0 0 000 3 0 0 000 0.5

Step by Step Solution

3.48 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Define your design matrix X This matrix should contain the training samples each row ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!