multibugs a parallel implementation of the bugs modelling
play

MultiBUGS : A parallel implementation of the BUGS modelling - PowerPoint PPT Presentation

MultiBUGS : A parallel implementation of the BUGS modelling framework for faster Bayesian inference Ro be rt Go ud i e wi t h A n dre w T om as, Rebecca Tur n er & Da ni e l a De A ng e li s 9 J a n 2 019 MRC Biostatistics Unit, University of


  1. MultiBUGS : A parallel implementation of the BUGS modelling framework for faster Bayesian inference Ro be rt Go ud i e wi t h A n dre w T om as, Rebecca Tur n er & Da ni e l a De A ng e li s 9 J a n 2 019 MRC Biostatistics Unit, University of Cam b ri d g e 1 / 1 7

  2. Background BUGS i s g e n era l-p ur po se Bayes i a n mo de lling s of ware t h at impl e m e n ts M ar ko v c h a in Mon te Car lo (M C M C ). Started in 19 8 9: Cla ss icB U G S , t hen W inB U G S , t hen OpenB U G S I dea s f r om B U G S w i de l y ad op t ed • J A G S (Pl u mm e r , 20 1 7 ) • NIM B L E ( V a lpin e e t a l . , 20 1 7 ) • R e l a t ed i dea s a r e us ed in St a n ( Ca r p e n t e r e t a l . , 20 1 7 ) L a t e st v e rs ion i s M u l t i B U G S : • A v a il a b l e t o d o w nlo ad fr om https://www.multibugs.org • T i s ta lk i s based on Go ud i e e t a l . ( ?20 19) Pl u mm er, M. ( 20 1 7 ). J A GS V e rs ion 4. 2 . 0 Us e r M a n u a l . Va lpin e, P. de e t a l . ( 20 1 7 ). “ P r og ra mming w i t h Mo de l s : Wr i t ing St a t i st i ca l A lgo r i t hm s f o r G e n e r a l Mo de l Stru c tur e s w i t h NIM B L E ” . Jo ur n a l o f C omp ut a t ion a l a n d G r a phi ca l St a t i st i c s 26 , 4 03– 41 3 . Car p e n ter, B . e t a l . ( 20 1 7 ). “Sta n : A P r o bab ili st i c P r og ra mming L a ng ua g e” . Jo ur n a l o f St a t i st i ca l S o f tw a r e 76 , 1 –32 . Go ud i e, R . J. B . e t a l . ( ?20 19). “ M u l t i BU G S : A P a r a ll e l Impl e m e n t a t ion o f t h e B U G S Mo de lling F r a m e w o r k f o r Fa st e r Ba y e s i a n In fe r e n ce ” . Jo ur n a l o f St a t i st i ca l S o f tw a r e . h tt p s : // a r xiv.o r g / a bs/ 1 7 04.0 32 1 6 . 2/ 1 7

  3. Bac kg r o u n d & mo t iv at ion Impo ss i b l e o r e x tre m e ly t im e - c on su ming t o use Op e n BU G S wi t h a h u g e a mo u n t o f data . • Op e n BU G S uses only a s ingl e C P U/c o re/t h read • In creases in s ingl e - t h read p erf o r m a n ces s lowing • N u m ber o f c o res a v a il ab l e in creas ing A im : t o m a k e t h e s p eed - u p s o f m u l t i- c o r e c omp ut a t ion a v a il a b l e t o a ppli ed stat i st i c i a n s us ing BU G S f o r g e n era l mo de l s, wi t ho ut re qui r ing a ny knowl ed g e o f p ara ll e l p r og ra mming No te : no t a iming t o imp r ov e mixing p r op e rt i e s o f t h e M a r kov c h a in , s imply t o ru n i t fa st e r 3/ 1 7

  4. Paralle li sat ion in M u l t i BU G S M u l t i BU G S impl e m e n ts t w o l e v e l s o f p ara ll e li sat ion. S impl e a pp r o ac h – ru n eac h o f m u l t ipl e, in de p e n de n t M C M C c h a in s on a se p arate C P U o r c o re ( Bradf o rd a n d T om as, 199 6 ) • Usefu l f o r assess ing c on v er g e n ce e .g. t h e Br ook s -G e lm a n- Rub in d i a gno st i c • Bur n-in t im e i s n ’t s ho rte n ed Mo re c ompli cated a pp r o ac h – use m u l t ipl e C P Us/c o res f o r a s ingl e M C M C c h a in • A im t o s ho rte n t h e p er -i terat ion c omp utat ion t im e b y i de n t i f y ing tas k s t h at ca n be ca l cu l ated in p ara ll e l • M u l t i BU G S p ara ll e li ses t h e f ollo w ing tas k s : 1. “ Likelihood ” comp ut a t ion 2 . S ampling of condi t ionall y -independen t componen ts B r adfo r d, R . and T homa s , A. (199 6 ). “ Ma r ko v Chain Mon t e Ca r lo Me t hod s fo r Famil y Tr ee s Us ing a Pa r allel P r oce ss o r” . St a t i st ic s and Comp ut ing 6 , 67–7 5. 4 / 1 7

  5. S elec t ed o t he r p ara ll e li sat ion a pp r o ac h es 1. S p ecu l at iv e ly c on s i der se qu e n ce o f M C M C st e p s , e v a l u a t e eac h on a s e p arate c o re . e .g. Br o c kw e ll ( 2 00 6 ) 2 . Mo d i f y M etr opoli s -H ast ing s a lgo r i t hm b y p r opo s ing a se qu e n ce o f ca n d i da t e poin ts in p ara ll e l. e .g. Ca l der h ead ( 2 014). 3 . Ru n p arts o f t h e mo de l on se p arate c o res a n d t h e n c om b in e e .g. Sc o tt e t a l . ( 2 01 6 ) , Go ud i e e t a l . ( 2 019) Br o c kw e ll , A . E . ( 2 00 6 ). “ P ara ll e l M ar kov C h a in Mon te Car lo S im u l at ion b y P re - Fetc hing ” . Jou r n a l o f C omp ut a t ion a l a n d G r a phi ca l St a t i st i c s 15 , 2 4 6–26 1. Ca l der h ead, B . ( 2 014). “A G e n era l C on struct ion f o r P ara ll e lizing M etr opoli s -H ast ing s A lgo r i t hm s” . P r o ceed ing s o f t h e N a t ion a l Acade my o f S c i e n ce s o f t h e U ni t ed St a t e s o f A m e r i ca 111 , 1 7 40 8– 1 7 41 3 . Sc o tt, S . L. e t a l . ( 2 01 6 ). “Ba y es a n d B ig Data : T h e C on s e n sus Mon t e Ca r lo A lgo r i t hm ” . In t e r n a t ion a l Jo ur n a l o f M a n a g e m e n t S c i e n ce a n d E ngin ee r ing M a n a g e m e n t 11 , 7 8 –88 . Go ud i e, R . J. B . e t a l . ( 2 019). “ Joining A n d S pli tt ing Mo de l s wi t h M ar kov M e l d ing ” . Ba y e s i a n A n a ly s i s 14 , 8 1 – 109. 5 / 1 7

  6. Tr ivi a l ill ustrat iv e e x a mpl e ( “seeds” ) A ra n d om- effects logi st i c re g ress ion wi t ho ut o utc om e r i a n d c ov ar i ates X 1 i a n d X 2 i ( 2 1 o bser v at ion s ) r i ∼ B in ( p i , n i ) logi t ( p i ) = α 0 + α 1 X 1 i + α 2 X 2 i + α 1 2 X 1 i X 2 i + β i α 0 , α 1 , α 2 , α 1 2 ∼ N ( µ α , σ 2 α ) β i ∼ N ( µ β , σ 2 β ) σ β ∼ U ni f ( σ min , σ m a x ) σ min σ m a x µ α µ β σ β σ β σ α α 0 α 0 α 1 α 1 α 2 α 2 α 1 2 α 1 2 β i β i X 1 i X 2 i n i r i i = 1 , . . . , 2 1 6/ 1 7

  7. Tr ivi a l ill ustrat iv e e x a mpl e ( “seeds” ) A ra n d om- effects logi st i c re g ress ion wi t ho ut o utc om e r i a n d c ov ar i ates X 1 i a n d X 2 i ( 2 1 o bser v at ion s ) r i ∼ B in ( p i , n i ) logi t ( p i ) = α 0 + α 1 X 1 i + α 2 X 2 i + α 1 2 X 1 i X 2 i + β i α 0 , α 1 , α 2 , α 1 2 ∼ N ( µ α , σ 2 α ) β i ∼ N ( µ β , σ 2 β ) σ β ∼ U ni f ( σ min , σ m a x ) σ min σ m a x µ α µ β σ β σ β σ α α 0 α 0 α 1 α 1 α 2 α 2 α 1 2 α 1 2 β i β i X 1 i X 2 i n i r i i = 1 , . . . , 2 1 6/ 1 7

  8. G e n e r i c a lgo r i t hm used b y BU G S At eac h M C M C i terat ion , BU G S d o es t h e f ollo w ing: fo r v in S do Do s ome t hing in v ol v ing p ( v ∣ V − v ) end fo r 7/ 1 7

  9. G e n e r i c a lgo r i t hm used b y BU G S At eac h M C M C i terat ion , BU G S d o es t h e f ollo w ing: fo r v in S do Do s ome t hing in v ol v ing p ( v ∣ V − v ) end fo r T e condi t ional di str i but ion p ( v ∣ V − v ) o f a no de v ∈ S , gi v e n t h e o t h er no des V − v , i s p ( v ∣ V − v ) ∝ p ( v ∣ p a ( v )) × ∏ p ( u ∣ p a ( u )) u ∈ c h ( v ) = p ( v ∣ p a ( v )) × L ( v ) = × “ p r io r” ter m “ lik e lihoo d” ter m 7/ 1 7

  10. G e n e r i c a lgo r i t hm used b y BU G S At eac h M C M C i terat ion , BU G S d o es t h e f ollo w ing: fo r v in S do E v al u a t e t he “ p r io r” p ( v ∣ pa ( v ) fo r u ∈ ch ( v ) do E v al u a t e “ likelihood ” componen t p ( u ∣ pa ( u )) end fo r e t c ... end fo r T e condi t ional di str i but ion p ( v ∣ V − v ) o f a no de v ∈ S , gi v e n t h e o t h er no des V − v , i s p ( v ∣ V − v ) ∝ p ( v ∣ p a ( v )) × ∏ p ( u ∣ p a ( u )) u ∈ c h ( v ) = p ( v ∣ p a ( v )) × L ( v ) = × “ p r io r” ter m “ lik e lihoo d” ter m 7/ 1 7

  11. T ype 1 – S pli tt ing lik e lihoo d c omp utat ion Wh e n a p ara m eter h as m a ny c hil dre n , t h e lik e lihoo d i s t h e p r o duct o f m a ny ter m s . L ( v ) = p ( u ∣ p a ( u )) ∏ u ∈ c h ( v ) But, wi t h a p art i t ion o f t h e c hil dre n c h ( v ) = { c h ( 1 ) ( v ) , . . . , c h ( C ) ( v )} , ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ L ( v ) = ⎥ ⎢ ⎥ ⎢ ⎥ ∏ ∏ ∏ ⎢ p ( u ∣ p a ( u )) × p ( u ∣ p a ( u )) × . . . × p ( u ∣ p a ( u )) ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ u ∈ c h ( 1 ) ( v ) ⎦ ⎣ u ∈ c h ( 2 ) ( v ) ⎦ ⎣ u ∈ c h ( C ) ( v ) ⎦ �ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ�ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ� �ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ�ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ� �ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ�ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ� C o re 1 C o re 2 C o re C 8/ 1 7

  12. T ype 2 – P ara ll e li s ing sa mpling o f p ara m eters Wh e n a mo de l in c l udes a l ar g e n u m ber o f p ara m eters t h e n c omp utat ion m a y be s low in a gg re g ate, e v e n i f sa mpling o f eac h in d ivi dua l p ara m eter i s fast . But p ara m eters t h at d o no t d i rect ly de p e n d on eac h o t h er ca n be u p dated s im u l ta n e o us ly Mo re p rec i se ly , p ara m eters in a m utua lly c on d i t ion a lly-in de p e n de n t set W ⊆ S ca n be u p dated s im u l ta n e o us ly. Tat i s, W sat i sf ying a ll w 1 , w 2 ∈ W ( w 1 ≠ w 2 ) sat i sf y w 1 ⊥ ⊥ w 2 ∣ V ∖ W I f no t a ll p ara m eters ca n be c oll ated in t o a s ingl e W , f o r m a ser i es o f W s a n d sa mpl e in tur n. 9 / 1 7

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend