Re: *ANSWER* Stuck on #4
Quote:

Re: *ANSWER* Stuck on #4
For what it's worth, I think you're calculating 4 correctly. After 10^6 runs, my average a was 1.4301. It was unsettling to not see my answer among those listed, especially since the others depend on correctly interpreting this question. It would be nice to get further corroboration, simply because none of the above doesn't mean 1.43 was correct.
However, I believe your bias calculation may be off, as your conclusion is different than what I obtained despite having roughly the same a. 
Re: *ANSWER* Stuck on #4
I calculated it in two different ways and I get a consistent answer that is higher than answer [d] (0.79x). I am unsure as to how far away the answer must be to consider it answer [e] ("None of the Above")?
The difference between answers [c] and [d] is 0.34x. May I assume that if my answer is 1.13x or above (from 0.79x + 0.34x = 1.13x) then [e] "None of the above" is the correct answer (and viceversa)? I need guidance as to how to determine, in general, how far is "far away" so that I can decide between answers [d] and [e]. Thank you. Juan 
Re: *ANSWER* Stuck on #4

Re: *ANSWER* Stuck on #4
Quote:

Re: *ANSWER* Stuck on #4

Re: *ANSWER* Stuck on #4
Not at all. Using this a I obtain 1.42...

Re: *ANSWER* Stuck on #4
Quote:

Re: *ANSWER* Stuck on #4
I also obtain 1.42 with the formula you mention which is based on deriving WRT "a" and equalling to zero to minimize. I also calculated 1.4 by finding the "a" for each value of x1 and x2 and then selecting the "a" associated with the smaller mean squared error.
The answer (a = 1.4), which is higher than the case discussed in class, makes sense to me because the line is forced to pass through zero. It can only rotate about the origin. It removes the translational degree of freedom that would otherwise be available when the intercept is included (y = ax + b). In that latter case any two points are used to create the line (the case discussed in class), and there is a high probability of obtaining many more cases with slope close to zero so I would expect "a" to be lower when using y=ax + b (after calculating the average of many cases). It also makes sense that b tends to zero. Supposing 1.42 is the correct value, should it be [d] or [e]? To "d", or not to "d", that is the question :D 
Re: *ANSWER* Stuck on #4
Quote:
Juan 
Re: *ANSWER* Stuck on #4
One absurdly simple way to get a handle on the plausibility of the result all of us doubted is to see what the range of possible slopes is, and guess it might be near the middle.
Observe that if two points are very near the origin, the slope can be but no higher. If they are at the furthest extremes, the slope can be zero, but no lower. The mean of this range of possible slopes is 1.57. :) 
Re: *ANSWER* Stuck on #4
Quote:
The random points (x1, y1) and (x2, y2) I generated are all between 1 and 1. Is the slope I am getting small because the random numbers are between 1 and 1? After all, I am dividing by 100K. Here's the code double slope = ((x1*y1) + (x2*y2)) / ((x1*x1) + (x2*x2)); I sum the slopes for each point and compute average AverageSlope = SumSlope / (double) NoOfPoints; 
All times are GMT 7. The time now is 10:06 AM. 
Powered by vBulletin® Version 3.8.3
Copyright ©2000  2019, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. AbuMostafa, Malik MagdonIsmail, and HsuanTien Lin, and participants in the Learning From Data MOOC by Yaser S. AbuMostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.