Stan


16

Przeglądałem dokumentację Stana, którą można pobrać stąd . Byłem szczególnie zainteresowany ich wdrożeniem diagnostyki Gelmana-Rubina. Oryginalny artykuł Gelman i Rubin (1992) definiuje potencjalny współczynnik redukcji skali (PSRF) w następujący sposób:

Niech Xi,1,…,Xi,N będą i -tym łańcuchem Markowa, z którego pobrano próbkę, i niech będzie próbka z całych M niezależnych łańcuchów. Niech X¯i⋅ będzie średnią z i tego łańcucha, a X¯⋅⋅ będzie średnią ogólną. Zdefiniuj,

W=1M∑m=1Msm2,
gdzie I zdefiniuj B B = N
sm2=1N−1∑t=1N(X¯mt−X¯m⋅)2.
B
B=NM−1∑m=1M(X¯m⋅−X¯⋅⋅)2.

Określić V = ( N - 1 PSRF szacuje się na √

V^=(N−1N)W+(M+1MN)B.
, gdzie R= VR^ Gdzie d f = 2 V / V R ( V ) .
R^=V^W⋅df+3df+1,
df=2V^/Var(V^)

Dokumentacja Stan na stronie 349 ignoruje termin z usuwa, a także ( M + 1 ) / M mnożnikowy okresie. To jest ich formuła,df(M+1)/M

Estymatorem wariancji jest Na koniec, możliwość statystyczne zmniejszenie skali jest określony przez R = √

var^+(θ|y)=N−1NW+1NB.
R^=var^+(θ|y)W.

Z tego, co widziałem, nie zawierają one odniesienia do tej zmiany formuły i nie dyskutują o tym. Zwykle nie jest zbyt duże i często może być tak niskie, jak 2 , więc ( M + 1 ) / M nie należy ignorować, nawet jeśli wartość d f można aproksymować za pomocą 1.M2(M+1)/Mdf

Skąd więc ta formuła?


EDYCJA: Znalazłem częściową odpowiedź na pytanie „ skąd pochodzi ta formuła? ”, Ponieważ książka Bayesian Data Analysis autorstwa Gelmana, Carlina, Sterna i Rubina (wydanie drugie) ma dokładnie tę samą formułę. Jednak książka nie wyjaśnia, w jaki sposób / dlaczego uzasadnione jest ignorowanie tych terminów?


Nie opublikowano jeszcze żadnej pracy, a formuła prawdopodobnie zmieni się w ciągu najbliższych kilku miesięcy.
— Ben Goodrich,

@BenGoodrich Dzięki za komentarz. Czy możesz powiedzieć coś więcej na temat motywacji korzystania z tej formuły? I dlaczego dokładnie zmieni się formuła?
— Greenparker

1
Obecna podzielona formuła R-kapelusza ma na celu przede wszystkim zastosowanie jej w przypadku, gdy istnieje tylko jeden łańcuch. Nadchodzące zmiany dotyczą głównie faktu, że leżący u podstaw rozkład brzeżny może nie być normalny lub mieć średnią i / lub wariancję.
— Ben Goodrich,

1
@BenGoodrich Tak, rozumiem, dlaczego STAN dzieli Rhata. Jednak nawet w tym przypadku , i tak stałej ( M + 1 ) / M = 3 / 2 , który nie jest do pominięcia. M=2(M+1)/M=3/2
— Greenparker

Odpowiedzi:


4

σ^=n−1nW+1nB
σ^σ^+var^+

var^+

R^=m+1mσ^+W−n−1mn,
which can be rearranged as
R^=σ^+W+σ^+Wm−n−1mn.
We can see that the effect of second and third term are negligible for decision making when n is large. See also the discussion in the paragraph before Section 3.1 in Brooks & Gelman (1998).

Gelman & Rubin (1992) also had the term with df as df/(df-2). Brooks & Gelman (1998) have a section describing why this df corretion is incorrect and define (df+3)/(df+1). The paragraph before Section 3.1 in Brooks & Gelman (1998) explains why (d+3)/(d+1) can be dropped.

It seems your source for the equations was something post Brooks & Gelman (1998) as you had (d+3)/(d+1) there and Gelman & Rubin (1992) had df/df(-2). Otherwise Gelman & Rubin (1992) and Brooks & Gelman (1998) have equivalent equations (with slightly different notations and some terms are arranged differently). BDA2 (Gelman, et al., 2003) doesn't have anymore terms σ^+Wm−n−1mn. BDA3 (Gelman et al., 2003) and Stan introduced split chains version.

My interpretation of the papers and experiences using different versions of R^ is that the terms which have been eventually dropped can be ignored when n is large, even when m is not. I also vaguely remember discussing this with Andrew Gelman years ago, but if you want to be certain of the history, you should ask him.

Usually M is not too large, and can often be as low so as 2

I really do hope that this is not often the case. In cases where you want to use split-R^ convergence diagnostic, you should use at least 4 chains split and thus have M=8. You may use less chains, if you already know that in your specific cases the convergence and mixing is fast.

Additional reference:

  • Brooks and Gelman (1998). Journal of Computational and Graphical Statistics, 7(4)434-455.

Yes it has the same σ^2 as you mention, but their R^ statistic is (σ^2+B/mn)/W∗dfterm (look at the equation on top of page 495 in the Stat Science official version), which introduces the (m+1)/m term I was talking about. In addition, look at the code and description in the R package coda, which has had the GR diagnostic since 1999.
— Greenparker

I'm confused. The article via the link you provided and the article from Stat Science web pages has only pages 457-472.I didn't check now, but years ago and last year when I checked coda, it didn't have the current recommended version.
— Aki Vehtari

Note that I edited my answer. Gelman & Brooks (1998) has that (m+1)/m term more clearly, and it seems you missed the last term which mostly cancels the effect of (m+1)/m term for decision making. See that paragraph before section 3.1.
— Aki Vehtari

Sorry about that, that was a typo. It's page 465, and Gelman and Rubin have the same exact definition as Brooks and Gelman (which you state above). Equation 1.1 in Brooks and Gelman is exactly what I wrote down as well (when you rearrange some terms).
— Greenparker

"We can see that the effect of second and third term are negligible for decision making when n is large", so what you are saying is that the expression in BDA and hence STAN comes from essentially ignoring these terms for large n?
— Greenparker
Korzystając z naszej strony potwierdzasz, że przeczytałeś(-aś) i rozumiesz nasze zasady używania plików cookie i zasady ochrony prywatności.
Licensed under cc by-sa 3.0 with attribution required.