LFD Book Forum  

Go Back   LFD Book Forum > Course Discussions > Online LFD course > Homework 4

Reply
 
Thread Tools Display Modes
  #1  
Old 05-02-2012, 12:21 PM
gmathew gmathew is offline
Junior Member
 
Join Date: May 2012
Posts: 1
Default *ANSWER* Questions 4-6 of Hwk 4 (bias and variance)

I solved this problem very carefully many times. But I am not getting the answers given in the homework solution for 5 and 6. These are the answers I am getting.

I am getting ghat = 1.4272x
bias = 0.5413
variance = 0.4725

Is anybody else getting similar answers? Can the intructor please verify the answers given in the homework solution?

thanks
Reply With Quote
  #2  
Old 05-04-2012, 05:34 AM
Iverson Iverson is offline
Junior Member
 
Join Date: Apr 2012
Posts: 4
Default Re: Questions 4-6 of Hwk 4 (bias and variance)

I got :
y = 1.4305x
bias : 0.2804
variance : 0.2381

My results for the bias and the variance are quite different from yours. I'm not sure they are correct though.
Reply With Quote
  #3  
Old 05-04-2012, 12:37 PM
danielfm danielfm is offline
Member
 
Join Date: Apr 2012
Location: Rio de Janeiro - Brazil
Posts: 10
Default Re: Questions 4-6 of Hwk 4 (bias and variance)

I got:

gbar = 1.415863
bias = 0.261949
variance = 0.231310

Of course the results of each run vary, but if I round the numbers to 1 decimal place I always get bias = 0.3 and variance = 0.2.
Reply With Quote
  #4  
Old 05-05-2012, 07:00 PM
cassio cassio is offline
Member
 
Join Date: Apr 2012
Location: Florianopolis - Brazil
Posts: 16
Default Re: Questions 4-6 of Hwk 4 (bias and variance)

Quote:
Originally Posted by gmathew View Post
I solved this problem very carefully many times. But I am not getting the answers given in the homework solution for 5 and 6. These are the answers I am getting.

I am getting ghat = 1.4272x
bias = 0.5413
variance = 0.4725

Is anybody else getting similar answers? Can the intructor please verify the answers given in the homework solution?

thanks
look this topic: http://book.caltech.edu/bookforum/showthread.php?t=424
there is a good discussion about these problems
Reply With Quote
  #5  
Old 08-02-2012, 06:05 AM
ramin ramin is offline
Junior Member
 
Join Date: Jul 2012
Posts: 6
Default Re: Questions 4-6 of Hwk 4 (bias and variance)

Maybe don't forget that the expectation "integral" has a p(x) term in it, and p(x) is uniform in the interval [-1,1]
Reply With Quote
  #6  
Old 05-03-2017, 09:54 PM
dtyrp dtyrp is offline
Junior Member
 
Join Date: May 2017
Posts: 2
Default Re: *ANSWER* Questions 4-6 of Hwk 4 (bias and variance)

Bump for interest in question 6! And I can't access the above link that cassio posted a few years ago

I'm able to get gbar and calculate the bias correctly but calculating the variance still has me stumped.

Here's my thought process:

To calculate variance, compute the integral of (g(x) - gbar(x))^2*p(x) from x = -1 to x = 1. Do this for each hypothesis g in your your hypothesis set (I generated 1000 different g's). p(x) is the uniform distribution that produces your x-axis data points. Now the expected value of a uniform random variable from -1 to 1 is 1/(1- -1) or 1/2. So the integral you calculate for each hypothesis g is really (g(x) - gbar(x))^2/2 from -1 to 1.

Take the average of these integrals to get your variance.

I'm not getting the answer so clearly my logic is wrong. Can anybody point me in the right direction?
Reply With Quote
  #7  
Old 05-03-2017, 10:08 PM
dtyrp dtyrp is offline
Junior Member
 
Join Date: May 2017
Posts: 2
Default Re: *ANSWER* Questions 4-6 of Hwk 4 (bias and variance)

Wow major misunderstanding/typo. The pdf of a uniform random variable from -1 to 1 is 1/2 (i.e. 1/1--1). The expected value is 1/2*(a+b) or 1/2*0, or just zero. Anyway, so adding the uniform pdf p(x) into the integral just halves the value of each integral. Still not understanding what is wrong with my logic, though.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:28 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. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.