Question: Write a script in Matlab that constructs the matrix, X = rand ( 1 0 0 , 2 ) and vector y = rand (

Write a script in Matlab that constructs the matrix, X = rand(100,2) and vector y = rand(100,1). Construct the augmented matrix X_hat =[1| X ]. Calculate the error, e =[e1 e2... e100]' for the mathematical model, f(x,y)= m_y*y + m_x*x + b where u_0=[ b_0 m_x_0 m_y_0]'= randn(3,1). Calculate the gradient for C(x,y)= sqrt((y - f(x,y))^2) knowing e_i = y_i - f(x_i,y_i). Update your parameters m_y, m_x, and b using the three update rules m_y(k+1)= m_y(k)+ mu*Grad_m_y, m_x(k+1)= m_x(k)+ mu*Grad_m_x, and b(k+1)= b(k)+ mu*Grad_b. Do this for 5 iterations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!