Question: write a general matlab code for a second order polynomial regression, on bases of the general least square regression formula. second order form: y=a1+ a2X

write a general matlab code for a second order polynomial regression, on bases of the general least square regression formula.
second order form:
y=a1+ a2X + a3X^2
general regression form:
A=(z^t x z )^-1 (z^t x y)
where...,
A : is the unkown matrix
z : is the coefficient matrix
z^t : is the transpose matrix
y : is the product matrix
^-1 : is the inverse of the matrix
the code must include the sum of :
[observations (n), sum of x, sum of x square , sum of xy ...etc]
note: you can add comments where i should insert x values y or n for intance.
thanks in advance!

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 Databases Questions!