Stan


16

Stavo esaminando la documentazione di Stan che può essere scaricata da qui . Ero particolarmente interessato alla loro implementazione della diagnostica Gelman-Rubin. Il documento originale Gelman & Rubin (1992) definisce il potenziale fattore di riduzione della scala (PSRF) come segue:

Let sia la i esima catena di Markov campionata, e ci sia della complessivi M catene indipendenti nel campione. Sia ˉ X i ⋅ la media della I catena, e ˉ X ⋅ ⋅ la media complessiva. Definisci, W = 1Xi,1,…,Xi,NiMX¯i⋅iX¯⋅⋅ dove s 2 m =1

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

Definire V = ( N - 1

V^=(N−1N)W+(M+1MN)B.
Il PSRF è stimato con dove R =R^ Dove d f = 2 V / V a r ( V ) .
R^=V^W⋅df+3df+1,
df=2V^/Var(V^)

La documentazione di Stan a pagina 349 ignora il termine con e rimuove anche il termine moltiplicativo ( M + 1 ) / M. Questa è la loro formula,df(M+1)/M

Lo stimatore di varianza è Infine, il potenziale di riduzione statistica scala è definito da R = √

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

Da quello che ho potuto vedere, non forniscono un riferimento per questo cambio di formula, né ne discutono. Di solito non è troppo grande e può spesso essere basso, quindi 2 , quindi ( M + 1 ) / M non deve essere ignorato, anche se dM2(M+1)/Mtermine f può essere approssimato con 1.df

Da dove viene questa formula?


EDIT: ho trovato una risposta parziale alla domanda "da dove proviene questa formula? ", In quanto il libro Bayesian Data Analysis di Gelman, Carlin, Stern e Rubin (Seconda edizione) ha esattamente la stessa formula. Tuttavia, il libro non spiega come / perché è giustificabile ignorare quei termini?


Non c'è ancora nessun documento pubblicato su di esso, e la formula probabilmente cambierà comunque nei prossimi mesi.
— Ben Goodrich,

@BenGoodrich Grazie per il commento. Puoi aggiungere altro sulla motivazione dell'utilizzo di questa formula? E perché cambierà esattamente la formula?
— Greenparker

1
L'attuale formula del cappello a R diviso è il modo in cui lo si applica principalmente al caso in cui vi è una sola catena. Le prossime modifiche riguarderanno principalmente il fatto che la distribuzione posteriore marginale sottostante potrebbe non essere normale o avere una media e / o una varianza.
— Ben Goodrich,

1
M=2(M+1)/M=3/2

Risposte:


4

Ho seguito il link specifico fornito per Gelman & Rubin (1992) e lo ha fatto

σ^=n-1nW+1nB
come nelle versioni successive, sebbene σ^ sostituito con σ^+ in Brooks & Gelman (1998) e con vun'r^+ in BDA2 (Gelman et al, 2003) e BDA3 (Gelman et al, 2013).

BDA2 e BDA3 (non sono in grado di controllare ora BDA1) hanno un esercizio con suggerimenti per dimostrarlo vun'r^+ è una stima imparziale della quantità desiderata.

Gelman & Brooks (1998) ha l'equazione 1.1

R^=m+1mσ^+W-n-1mn,
che può essere riorganizzato come
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
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.