LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   Chapter 2 - Training versus Testing (http://book.caltech.edu/bookforum/forumdisplay.php?f=109)
-   -   consistency issue on page 65 (http://book.caltech.edu/bookforum/showthread.php?t=408)

 dudefromdayton 04-28-2012 07:33 PM

consistency issue on page 65

Example 2.8, the target function is sin(pi*x). But both target function graph labels in the second figure show sin(x) instead. Someone in the know should see that the graphed function, its label, and the target function coincide.

 yaser 04-28-2012 07:40 PM

Re: consistency issue on page 65

Quote:
 Originally Posted by dudefromdayton (Post 1658) Example 2.8, the target function is sin(pi*x). But both target function graph labels in the second figure show sin(x) instead. Someone in the know should see that the graphed function, its label, and the target function coincide.
Thank you for noticing it. Indeed, it should be .

 dudefromdayton 04-28-2012 08:32 PM

Re: consistency issue on page 65

On the same page, I've been able to confirm the biases stated for H0 and H1, as well as the variance for H0. But for the variance of 1.69 for H1, I am obtaining 2.44 instead.

I have this problem whether I calculate the variance directly, or I calculate the out-of-sample error and subtract the bias.

It would be reassuring if I could show that my 2.44 figure is wrong, but as yet I have not succeeded.

 yaser 04-28-2012 10:36 PM

Re: consistency issue on page 65

Quote:
 Originally Posted by dudefromdayton (Post 1662) On the same page, I've been able to confirm the biases stated for H0 and H1, as well as the variance for H0. But for the variance of 1.69 for H1, I am obtaining 2.44 instead. I have this problem whether I calculate the variance directly, or I calculate the out-of-sample error and subtract the bias. It would be reassuring if I could show that my 2.44 figure is wrong, but as yet I have not succeeded.
This is curious. To calculate , you generate the two points and uniformly and independently, then connect them with a line. Since and , you get the equation for the line (tangent to the sine if the two points coincide). You then integrate the difference squared between the line and the sine with respect to (times the probability density which is ) to get for this data set, and double-integrate that with respect to and (times the probability density which is for each variable) to get the expected .

Is this what you have done to come up with a numerical answer equal to ?

Hint: It is much easier to Monte-Carlo.

 dudefromdayton 04-29-2012 05:54 AM

Re: consistency issue on page 65

My ETA having a closer look at this is 1-2 days. Schedule. I'm definitely interested in resolving this matter, and I'm happy to participate. :)

Update: wrapping up some computations; I'm testing an idea as to what might have happened. But the test is not quick.

 dudefromdayton 04-29-2012 03:50 PM

Re: consistency issue on page 65

Alas, I got bit by that old dog, numerical instability. When I run 1,000 hypotheses, I get the much higher figure I reported. 10,000 brought me a lot closer, and 100,000 has me at 1.70 variance (and presumably moving in the direction of 1.69).

These tests take a lot longer than they might, because I solve the line equation with w-a-a-y too many CPU cycles. The upside is that the same code works with several other hypothesis sets to meet a short-term need.

I feel in general like I've faced a couple of numerical stability challenges in very recent time, and it's beneficial when students have to deal with it. I imagine there might be more ahead.

 BojanVujatovic 07-14-2014 08:45 AM

Re: consistency issue on page 65

It is somewhat late but I'd like to give analytic solution for , bias and var and the verification of values here. Firstly,

and are parameters we get after minimising squared error function on some :

and we can get them by solving the following system of equations (condition for extreme value of function):

The solution is:

Now,

So,

Now we can calculate all the terms:

So, we see that the following holds:

 magdon 07-15-2014 07:42 AM

Re: consistency issue on page 65

Thanks for the detailed analysis :)

 All times are GMT -7. The time now is 12:50 AM.