AllenDowney / ThinkStats2

Text and supporting code for Think Stats, 2nd Edition
http://allendowney.github.io/ThinkStats2/
GNU General Public License v3.0
4.03k stars 11.31k forks source link

p.120 3rd paragraph 9.8 First babies again #25

Closed ToshiKurokawa closed 2 years ago

ToshiKurokawa commented 9 years ago

The second sentence goes as "But after 1000 iterations, the largest test statistic generated under the null hypothesis is 32. " However, executing hypothesis.py, pregnancy length chi-squared brings actual = 101.5014... and ts max = 27.7315... So, the second sentence should be read as "But after 1000 iterations, the largest test statistic generated under the null hypothesis is 28. "

AllenDowney commented 9 years ago

Since these are the results of a random simulation, they will vary each time the program is run.

Allen

On Tue, Apr 28, 2015 at 8:37 AM, ToshiKurokawa notifications@github.com wrote:

The second sentence goes as "But after 1000 iterations, the largest test statistic generated under the null hypothesis is 32. " However, executing hypothesis.py, pregnancy length chi-squared brings actual = 101.5014... and ts max = 27.7315... So, the second sentence should be read as "But after 1000 iterations, the largest test statistic generated under the null hypothesis is 28. "

— Reply to this email directly or view it on GitHub https://github.com/AllenDowney/ThinkStats2/issues/25.

ToshiKurokawa commented 9 years ago

Thanks!

On 2015/04/28 21:40, Allen Downey wrote:

Since these are the results of a random simulation, they will vary each time the program is run.

Allen

On Tue, Apr 28, 2015 at 8:37 AM, ToshiKurokawa notifications@github.com wrote:

The second sentence goes as "But after 1000 iterations, the largest test statistic generated under the null hypothesis is 32. " However, executing hypothesis.py, pregnancy length chi-squared brings actual = 101.5014... and ts max = 27.7315... So, the second sentence should be read as "But after 1000 iterations, the largest test statistic generated under the null hypothesis is 28. "

— Reply to this email directly or view it on GitHub https://github.com/AllenDowney/ThinkStats2/issues/25.

— Reply to this email directly or view it on GitHub https://github.com/AllenDowney/ThinkStats2/issues/25#issuecomment-97048221.

Toshiaki Kurokawa Design Thinking Research & Education, ICES Founder, Chair of International Standardization Education SIG, IIEEJ Kids, Their Future & Design, Co-Founder Machida, JAPAN


This email has been checked for viruses by Avast antivirus software. http://www.avast.com

ToshiKurokawa commented 9 years ago

Well, i made the run again this morning, and the number is the same. This cannot be a random outcome. I have not checked the random generator, nor the logic of picking intermediate data, but the program generates a fixed result... that will be the other side of the problem.

ToshiKurokawa commented 9 years ago

Have checked the result of RunModel via print data. Each time, when I ran hypothesis.py, the same dataset will be generated by RunModel, hence the resulting chi-squared statistic and largest test statistic are the same: actual = 101.501414829 and ts max = 27.7315452327. Have not yet checked the logic of shuffle.

ToshiKurokawa commented 9 years ago

We found the code "thinkstats2.RandomSeed(17)" in main. Deleting this the program seem to work normally.

AllenDowney commented 9 years ago

Sorry for my slow replies -- the semester is ending here and it's been chaotic!

The RandomSeed is intended to make the output of the program the same every time, even though it uses random numbers. So if you remove it, you should see different results each time.

I hoped that RandomSeed would cause your results to be the same as mine, but that might not be true if we are running different versions of the libraries.

Allen

On Mon, May 4, 2015 at 9:31 PM, ToshiKurokawa notifications@github.com wrote:

We found the code "thinkstats2.RandomSeed(17)" in main. Deleting this the program seem to work normally.

— Reply to this email directly or view it on GitHub https://github.com/AllenDowney/ThinkStats2/issues/25#issuecomment-98900760 .

ToshiKurokawa commented 9 years ago

Dear Allen,

nice to hear from you and hope you are ending another good semester. We have added a note on the RandomSeed for Japanese readers.

We also would like you to respond on the 5.2 The normal distribution. You are telling "Its CDF is defined by an integral that does not have a closed form solution." Here, do you mean that the integral does not have a solution in "elementary funbction?" "Closed form" looks like to have some ambiguity....

Regards, --Toshi

On 2015/05/08 1:39, Allen Downey wrote:

Sorry for my slow replies -- the semester is ending here and it's been chaotic!

The RandomSeed is intended to make the output of the program the same every time, even though it uses random numbers. So if you remove it, you should see different results each time.

I hoped that RandomSeed would cause your results to be the same as mine, but that might not be true if we are running different versions of the libraries.

Allen

On Mon, May 4, 2015 at 9:31 PM, ToshiKurokawa notifications@github.com wrote:

We found the code "thinkstats2.RandomSeed(17)" in main. Deleting this the program seem to work normally.

— Reply to this email directly or view it on GitHub

https://github.com/AllenDowney/ThinkStats2/issues/25#issuecomment-98900760 .

— Reply to this email directly or view it on GitHub https://github.com/AllenDowney/ThinkStats2/issues/25#issuecomment-99932752.

Toshiaki Kurokawa Design Thinking Research & Education, ICES Founder, Chair of International Standardization Education SIG, IIEEJ Kids, Their Future & Design, Co-Founder Machida, JAPAN


This email has been checked for viruses by Avast antivirus software. http://www.avast.com

ToshiKurokawa commented 9 years ago

I mean "closed form" in this sense:

http://en.wikipedia.org/wiki/Closed-form_expression

The exact definition of "closed form" depends on context, but I don't know of a more precise term for what I am trying to say here.

Allen

On Thu, May 7, 2015 at 6:24 PM, Toshiaki Kurokawa toshiakikr@gmail.com wrote:

Dear Allen,

nice to hear from you and hope you are ending another good semester. We have added a note on the RandomSeed for Japanese readers.

We also would like you to respond on the 5.2 The normal distribution. You are telling "Its CDF is defined by an integral that does not have a closed form solution." Here, do you mean that the integral does not have a solution in "elementary funbction?" "Closed form" looks like to have some ambiguity....

Regards, --Toshi

On 2015/05/08 1:39, Allen Downey wrote:

Sorry for my slow replies -- the semester is ending here and it's been chaotic!

The RandomSeed is intended to make the output of the program the same every time, even though it uses random numbers. So if you remove it, you should see different results each time.

I hoped that RandomSeed would cause your results to be the same as mine, but that might not be true if we are running different versions of the libraries.

Allen

On Mon, May 4, 2015 at 9:31 PM, ToshiKurokawa notifications@github.com notifications@github.com wrote:

We found the code "thinkstats2.RandomSeed(17)" in main. Deleting this the program seem to work normally.

— Reply to this email directly or view it on GitHub

https://github.com/AllenDowney/ThinkStats2/issues/25#issuecomment-98900760 https://github.com/AllenDowney/ThinkStats2/issues/25#issuecomment-98900760 .

— Reply to this email directly or view it on GitHub https://github.com/AllenDowney/ThinkStats2/issues/25#issuecomment-99932752 .

Toshiaki Kurokawa Design Thinking Research & Education, ICES Founder, Chair of International Standardization Education SIG, IIEEJ Kids, Their Future & Design, Co-Founder Machida, JAPAN


[image: Avast logo] http://www.avast.com/

This email has been checked for viruses by Avast antivirus software. www.avast.com

ToshiKurokawa commented 9 years ago

Hi, Allen,

thanks for the clarification. That helps!

Regards, --Toshi

On 2015/05/08 7:29, Allen Downey wrote:

I mean "closed form" in this sense:

http://en.wikipedia.org/wiki/Closed-form_expression

The exact definition of "closed form" depends on context, but I don't know of a more precise term for what I am trying to say here.

Allen

On Thu, May 7, 2015 at 6:24 PM, Toshiaki Kurokawa <toshiakikr@gmail.com mailto:toshiakikr@gmail.com> wrote:

Dear Allen,

nice to hear from you and hope you are ending another good semester.
We have added a note on the RandomSeed for Japanese readers.

We also would like you to respond on the 5.2 The normal
distribution. You are telling "Its CDF is defined by an integral
that does not have a closed form solution." Here, do you mean that
the integral does not have a solution in "elementary funbction?"
"Closed form" looks like to have some ambiguity....

Regards,
--Toshi

On 2015/05/08 1:39, Allen Downey wrote:
Sorry for my slow replies -- the semester is ending here and it's
been
chaotic!

The RandomSeed is intended to make the output of the program the
same every
time, even though it uses random numbers. So if you remove it,
you should
see different results each time.

I hoped that RandomSeed would cause your results to be the same
as mine,
but that might not be true if we are running different versions
of the
libraries.

Allen

On Mon, May 4, 2015 at 9:31 PM, ToshiKurokawa
<notifications@github.com> <mailto:notifications@github.com>
wrote:

> We found the code "thinkstats2.RandomSeed(17)" in main.
Deleting this the
> program seem to work normally.
>
> —
> Reply to this email directly or view it on GitHub
>
<https://github.com/AllenDowney/ThinkStats2/issues/25#issuecomment-98900760>
<https://github.com/AllenDowney/ThinkStats2/issues/25#issuecomment-98900760>
> .
>

—
Reply to this email directly or view it on GitHub
<https://github.com/AllenDowney/ThinkStats2/issues/25#issuecomment-99932752>.
-- 
Toshiaki Kurokawa
Design Thinking Research & Education,
ICES Founder, Chair of International Standardization Education SIG, IIEEJ
Kids, Their Future & Design, Co-Founder
Machida, JAPAN

------------------------------------------------------------------------
Avast logo <http://www.avast.com/>    

This email has been checked for viruses by Avast antivirus software.
www.avast.com <http://www.avast.com/>

Toshiaki Kurokawa Design Thinking Research & Education, ICES Founder, Chair of International Standardization Education SIG, IIEEJ Kids, Their Future & Design, Co-Founder Machida, JAPAN


This email has been checked for viruses by Avast antivirus software. http://www.avast.com