Hari Prasad
Hari Prasad

Reputation: 1901

Vectorized form Derivation of Multiple Linear Regression Cost Function

Can some one with expertise explain how the following vectorized format of multiple linear regression is derived from given independent variable matrix with intercept X and dependent variable matrix Y, with m rows and n columns with n theta parameters? In Andrew Ng class, I am bit lost here on how this and non vectorized cost function are same? enter image description here

Upvotes: 0

Views: 1245

Answers (2)

doob
doob

Reputation: 97

you got the error for each data point :( X*Theta - y ) when you transpose and do inner product. It is as same as squaring all the errors and taking a sum.

Upvotes: 0

Hari Prasad
Hari Prasad

Reputation: 1901

Ah! I think I got the answer. I forgot that what is happening is a square of a vector in the error part of the function. Hence it is transpose of vector.vector. Still not able to understand how X is defined with transposes of all independent variables in above definition, as I believe it is a matrix of dependent variables including intercept.

Upvotes: 0

Related Questions