Question

d. We will use pinv function to find a linear regression model to map the measurement data to truth data. Our model will be Y

d.1 (5pts) Generate your matrix Y-AX in Matlab. What is Y and A ? (show the matrix Y and A.) d.2 (10pts) Use pseudoinverse pi

d. We will use pinv function to find a linear regression model to map the measurement data to truth data. Our model will be Y-AX. Y is the truth data matrix Y [ yı; y2i yai ya; ysi yg: y7 ]. A is the tmeasurement data matrix A=[ 1 mh; 1 m2. 1 mai 1 m4; 1 ms: 1 mt 6:1 m7 I . and X-[Xo: x1] is the coefficient of your regression model. Truth Data yn -1 0 Measurement Data 10.03 7.97 63.9 2.1 0.05 -2.05 mn *n is the number of data point, we have seven points.
d.1 (5pts) Generate your matrix Y-AX in Matlab. What is Y and A ? (show the matrix Y and A.) d.2 (10pts) Use pseudoinverse pinv function to find your coefficient X. (show the mtrix X) and give me your equation, it should look like yn-x0% * mn. Put certain value in xo and x1. Example model(your result will be different with the example model): уп--6, 1978 + 1.0137-m, d.3 (10pts) Plot your result. Plot the train data (You will need to plot measurement ata in x-asix and truth data in y-axis) and the predict line Example Figure (Your result will be different with it) 10 O Train Data yr6.1978 +1.0137 9 i Predict Line 12 13 14 Measure Data m
0 0
Add a comment Improve this question Transcribed image text
Answer #1

clc;
clear all;close all;

y=[-1;0;1;2;4;5;6];
A=[1 10.03;1 7.97;1 6,;1 .9;1 2.1;1 0.05;1 -2.05];
x=pinv(A)*y
m=[10.03 7.97 6 3.9 2.1 0.05 -2.05];

y_n=x(1)+(x(2)*m);

plot(m,y,'o',m,y_n);
grid on;
legend('True Data','Predic Line')

6 O True Data 5 Predic Line 4 3 2 0 -4 0 2 4 10 12

Add a comment
Know the answer?
Add Answer to:
D. We will use pinv function to find a linear regression model to map the measurement data to tru...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT