Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X = 1:6;
- Y = [1 22 50 62 97 110];
- plot(X,Y,'o');
- hold on;
- a = polyfit(X,Y,1);
- Y_H = polyval(a,X);
- plot(X, Y_H);
- legend('observed', 'predicted');
- xlabel('predictor');
- ylabel('respond variable');
- E = Y_H - Y;
- MSE = sqrt(mean(E.^2));
- display(MSE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement