tag:blogger.com,1999:blog-2474498300859593807.post2113075607595614227..comments2024-03-08T02:53:17.969-05:00Comments on Econometric Sense: Regression via Gradient Descent in RMatt Bogardhttp://www.blogger.com/profile/10510725993509264716noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-2474498300859593807.post-17171266735590448872013-02-04T13:15:12.256-05:002013-02-04T13:15:12.256-05:00Yes you are correct (that is my understanding) re ...Yes you are correct (that is my understanding) re the normal equation alternative to gradient descent. I'll see if I can figure out how to add the email feature. Thanks for your comment and suggestion!!Matt Bogardhttps://www.blogger.com/profile/10510725993509264716noreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-72682799173787840562013-02-04T11:47:09.358-05:002013-02-04T11:47:09.358-05:00Thanks for the detailed explanation Matt.
I unders...Thanks for the detailed explanation Matt.<br />I understood your explanation.<br /><br />The first line which I referred to, Can we say that the equation is the Normal Equation which is used as an alternative to the Gradient Descent, as per the Machine Learning class by Andrew NG?<br /><br />Also, I request you to add some email subscription feature to your blog.Suryanoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-5396817246261130262013-02-04T10:04:58.036-05:002013-02-04T10:04:58.036-05:00For the first line it is just the basic regressio...For the first line it is just the basic regression coefficient estimation in matrix algebra b = (x'x)^-1 * y. (using the raw x-values). The second line implements the regression estimate using independent variables that were basically standardized as in z = (x-mu)/sd i.e. 'feature scaling'<br /><br />My understanding of feature scaling (from the Machine Learning Course mentioned in the blog post I referenced) is that if you have x's in your model that are on varying different scales of measurement, you can get better performance by putting them on a standard scale. <br /><br />I performed the standardization previously in the program:<br /><br /># implement feature scaling<br />x.scaled <- x<br />x.scaled[,2] <- (x[,2] - mean(x[,2]))/sd(x[,2])<br /><br />The original source I used to do this was the blog post listed in the documentation section at the beginning of the program. In the mean time you might also go there for more details. Let me know if this answers your question. <br /><br /><br /><br />Matt Bogardhttps://www.blogger.com/profile/10510725993509264716noreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-13737654738269385522013-02-04T04:52:13.103-05:002013-02-04T04:52:13.103-05:00Hi very nice post.
Can you explain these two line...Hi very nice post.<br /><br />Can you explain these two lines:<br /><br /> solve(t(x)%*%x)%*%t(x)%*%y # w/o feature scaling<br /> solve(t(x.scaled)%*%x.scaled)%*%t(x.scaled)%*%y # w/ featSuryanoreply@blogger.comtag:blogger.com,1999:blog-2474498300859593807.post-2325884328777743992011-12-02T09:59:57.097-05:002011-12-02T09:59:57.097-05:00Hi Matt,
Please consider adding yourself to R-blog...Hi Matt,<br />Please consider adding yourself to R-bloggers.com:<br />http://www.r-bloggers.com/add-your-blog/<br /><br />Cheers,<br />TalTal Galilihttps://www.blogger.com/profile/10009278769907250225noreply@blogger.com