RobinHankin / hyper2

https://robinhankin.github.io/hyper2/
5 stars 3 forks source link

typo in jss_hyper3.Rnw #205

Closed RobinHankin closed 1 year ago

RobinHankin commented 1 year ago

in jss_hyper3, in subsection "Fisher Information" there is a typo in the probabilities for AAB, ABA, BAA (which do not add to one) and this error affects the diagram showing the likelihood functions for the three observations [now red, black, blue lines] also the expression for Fisher information, also its minimum.

In[13]:= AAB = 2*a^2/(1+a)                                                                                  

            2
         2 a
Out[13]= -----
         1 + a

In[14]:= ABA = 2*a*(1-a)/(1+a)                                                                              

         2 (1 - a) a
Out[14]= -----------
            1 + a

In[15]:= BAA = (1-a)/(1+a)                                                                                  

         1 - a
Out[15]= -----
         1 + a

In[16]:= (AAB+ABA+BAA)//FullSimplify                                                                        

Out[16]= 1

In[17]:= F=-(AAB*D[Log[AAB],{a,2}] + ABA*D[Log[ABA],{a,2}] + BAA*D[Log[BAA],{a,2}])                         

...[snip]...

In[18]:= F//FullSimplify                                                                                    

                        2
           -2 (1 + a + a )
Out[18]= -------------------
                           2
         (-1 + a) a (1 + a)

In[23]:= Minimize[F,{a>0,a<1},{a}]//N                                                                       

Out[23]= {6.20929, {a -> 0.521848}}
RobinHankin commented 1 year ago

This was following issue #153