L13 Statistical Rethinking Winter 2019

L13 Statistical Rethinking Winter 2019

Lecture 13 of the Dec 2018 through March 2019 edition of Statistical Rethinking. Covers Chapters 11 and 12, generalized linear models and simple mixtures.

A0f2f64b2e58f3bfa48296fb9ed73853?s=128

Richard McElreath

February 04, 2019
Tweet

Transcript

  1. Monsters & Mixtures Statistical Rethinking Winter 2019 Lecture 13 /

    Week 7
  2. How to draw an owl 1. Draw some circles 2.

    Draw the rest of the owl 1. 2.
  3. Hawaii has leverage   (0% 41*,&% 5)& */5&(&34 -1

    0 1 2 0 20 40 60 log population (std) total tools Yap (0.6) Trobriand (0.56) Tonga (0.69) Hawaii (1.01) 0 50000 150000 250000 0 20 40 60 population total tools 'ĶĴłĿIJ ƉƉƑ 1PTUFSJPS QSFEJDUJPOT GPS UIF 0DFBOJD UPPMT NPEFM 'JMMFE QPJOUT BSF TPDJFUJFT XJUI IJTUPSJDBMMZ IJHI DPOUBDU 0QFO QPJOUT BSF UIPTF XJUI MPX DPOUBDU 1PJOU TJ[F JT TDBMFE CZ SFMBUJWF -00*4 1BSFUP L WBMVFT -BSHFS QPJOUT BSF NPSF JOĘVFOUJBM ćF TPMJE DVSWF JT UIF QPTUFSJPS NFBO • Point size proportional to Pareto-k diagnostic value
  4. Generalized Linear Madness • This model is terrible: • Intercepts

    don’t pass through origin • Zero population = zero tools • We can do better by thinking scientifically instead of statistically   (0% 41*,&% 5)& */5&(&34 -1 0 1 2 0 20 40 60 log population (std) total tools Yap (0.6) Trobriand (0.56) Tonga (0.69) Hawaii (1.01) 0 50000 150000 250000 0 20 40 60 population total tools 'ĶĴłĿIJ ƉƉƑ 1PTUFSJPS QSFEJDUJPOT GPS UIF 0DFBOJD UPPMT NPEFM 'JMMFE QPJOUT BSF TPDJFUJFT XJUI IJTUPSJDBMMZ IJHI DPOUBDU 0QFO QPJOUT BSF UIPTF XJUI MPX DPOUBDU 1PJOU TJ[F JT TDBMFE CZ SFMBUJWF -00*4 1BSFUP L WBMVFT
  5. Scientific model • Change in tools per unit time: IPX

    UIF TDJFOUJĕD NPEFM DPNQBSFT UP UIF HFPDFOUSJD NPE NQMF XIFUIFS ZPV VTF -00*4 PS 8"*$ JT B GFX QPJOUT *U JT TUJMM UVHHFE BSPVOE CZ )BXBJJ BOE 5POHB 8FMM SFUV OE BQQSPBDI DPOUBDU SBUF B EJČFSFOU XBZ CZ UBLJOH BDDP UP POF BOPUIFS FMJOH UPPM JOOPWBUJPO 5BLJOH UIF WFSCBM NPEFM JO UIF NBJO U JO UIF FYQFDUFE OVNCFS PG UPPMT JO POF UJNF TUFQ JT ∆5 = α1β − γ5 UJPO TJ[F 5 JT UIF OVNCFS PG UPPMT BOE α β BOE γ BSF QBSBNFUF N OVNCFS PG UPPMT 5 KVTU TFU UIF FRVBUJPO BCPWF FRVBM UP [FS ˆ 5 = α1β
  6. Scientific model • Change in tools per unit time: IPX

    UIF TDJFOUJĕD NPEFM DPNQBSFT UP UIF HFPDFOUSJD NPE NQMF XIFUIFS ZPV VTF -00*4 PS 8"*$ JT B GFX QPJOUT *U JT TUJMM UVHHFE BSPVOE CZ )BXBJJ BOE 5POHB 8FMM SFUV OE BQQSPBDI DPOUBDU SBUF B EJČFSFOU XBZ CZ UBLJOH BDDP UP POF BOPUIFS FMJOH UPPM JOOPWBUJPO 5BLJOH UIF WFSCBM NPEFM JO UIF NBJO U JO UIF FYQFDUFE OVNCFS PG UPPMT JO POF UJNF TUFQ JT ∆5 = α1β − γ5 UJPO TJ[F 5 JT UIF OVNCFS PG UPPMT BOE α β BOE γ BSF QBSBNFUF N OVNCFS PG UPPMT 5 KVTU TFU UIF FRVBUJPO BCPWF FRVBM UP [FS ˆ 5 = α1β Innovation rate Diminishing returns (“elasticity”) Population
  7. Scientific model • Change in tools per unit time: IPX

    UIF TDJFOUJĕD NPEFM DPNQBSFT UP UIF HFPDFOUSJD NPE NQMF XIFUIFS ZPV VTF -00*4 PS 8"*$ JT B GFX QPJOUT *U JT TUJMM UVHHFE BSPVOE CZ )BXBJJ BOE 5POHB 8FMM SFUV OE BQQSPBDI DPOUBDU SBUF B EJČFSFOU XBZ CZ UBLJOH BDDP UP POF BOPUIFS FMJOH UPPM JOOPWBUJPO 5BLJOH UIF WFSCBM NPEFM JO UIF NBJO U JO UIF FYQFDUFE OVNCFS PG UPPMT JO POF UJNF TUFQ JT ∆5 = α1β − γ5 UJPO TJ[F 5 JT UIF OVNCFS PG UPPMT BOE α β BOE γ BSF QBSBNFUF N OVNCFS PG UPPMT 5 KVTU TFU UIF FRVBUJPO BCPWF FRVBM UP [FS ˆ 5 = α1β Tools Innovation rate Diminishing returns (“elasticity”) Population Loss rate
  8. Scientific model • Solve for steady state expected number of

    tools • Where ∆T = 0 OPWBUJPO 5BLJOH UIF WFSCBM NPEFM JO UIF NBJO UFYU BCPWF XF DBO DUFE OVNCFS PG UPPMT JO POF UJNF TUFQ JT ∆5 = α1β − γ5 T UIF OVNCFS PG UPPMT BOE α β BOE γ BSF QBSBNFUFST UP CF FTUJNBUFE PG UPPMT 5 KVTU TFU UIF FRVBUJPO BCPWF FRVBM UP [FSP BOE TPMWF GPS 5 ˆ 5 = α1β γ No ad hoc link function!  10*440/ 3&(3&44*0/ 8FSF HPJOH UP VTF UIJT JOTJEF B 1PJTTPO NPEFM OPX ćF OPJTF BSPVOE UIF PV CFDBVTF UIBU JT TUJMM UIF NBYJNVN FOUSPQZ EJTUSJCVUJPO JO UIJT DPOUFYU‰/*/ OP DMFBS VQQFS CPVOE #VU UIF MJOFBS NPEFM JT HPOF 5J ∼ 1PJTTPO(λJ) λJ = α1β J /γ /PUJDF UIBU UIFSF JT OP MJOL GVODUJPO "MM XF IBWF UP EP UP FOTVSF UIBU λ SF TVSF UIF QBSBNFUFST BSF QPTJUJWF *O UIF DPEF CFMPX *MM VTF FYQPOFOUJBM QS /PSNBM GPS α ćFO UIFZ BMM IBWF UP CF QPTJUJWF *O CVJMEJOH UIF NPEFM XF B BMM PG UIF QBSBNFUFST UP WBSZ CZ DPOUBDU SBUF 4JODF DPOUBDU SBUF JT TVQQPTF U QPQVMBUJPO TJ[F MFUT BMMPX α BOE β *U DPVME BMTP JOĘVFODF γ CFDBVTF USBE UPPMT GSPN WBOJTIJOH PWFS UJNF #VU XFMM MFBWF UIBU BT BO FYFSDJTF GPS UIF SF
  9. Scientific model TF UIJT JOTJEF B 1PJTTPO NPEFM OPX ćF

    OPJTF BSPVOE UIF PVUDPNF XJMM TUJMM C TUJMM UIF NBYJNVN FOUSPQZ EJTUSJCVUJPO JO UIJT DPOUFYU‰/*/'Ǿ/**'. JT B D CPVOE #VU UIF MJOFBS NPEFM JT HPOF 5J ∼ 1PJTTPO(λJ) λJ = α1β J /γ SF JT OP MJOL GVODUJPO "MM XF IBWF UP EP UP FOTVSF UIBU λ SFNBJOT QPTJUJWF FUFST BSF QPTJUJWF *O UIF DPEF CFMPX *MM VTF FYQPOFOUJBM QSJPST GPS β BOE γ ćFO UIFZ BMM IBWF UP CF QPTJUJWF *O CVJMEJOH UIF NPEFM XF BMTP XBOU UP BMMP FUFST UP WBSZ CZ DPOUBDU SBUF 4JODF DPOUBDU SBUF JT TVQQPTF UP NFEJBUF UIF JO MFUT BMMPX α BOE β *U DPVME BMTP JOĘVFODF γ CFDBVTF USBEF OFUXPSLT NJH TIJOH PWFS UJNF #VU XFMM MFBWF UIBU BT BO FYFSDJTF GPS UIF SFBEFS )FSFT UIF ǿ ʙɶ/*/'Ǿ/**'.Ǣ ʙɶ+*+0'/$*)Ǣ $ʙɶ*)//Ǿ$ Ȁ (ǿ +*$.ǿ '( ȀǢ 8FSF HPJOH UP VTF UIJT JOTJEF B 1PJTTPO NPEFM OPX ćF OPJTF BSPVOE UIF PVUDPNF XJMM TUJMM CF 1PJTTPO CFDBVTF UIBU JT TUJMM UIF NBYJNVN FOUSPQZ EJTUSJCVUJPO JO UIJT DPOUFYU‰/*/'Ǿ/**'. JT B DPVOU XJUI OP DMFBS VQQFS CPVOE #VU UIF MJOFBS NPEFM JT HPOF 5J ∼ 1PJTTPO(λJ) λJ = α1β J /γ /PUJDF UIBU UIFSF JT OP MJOL GVODUJPO "MM XF IBWF UP EP UP FOTVSF UIBU λ SFNBJOT QPTJUJWF JT UP NBLF TVSF UIF QBSBNFUFST BSF QPTJUJWF *O UIF DPEF CFMPX *MM VTF FYQPOFOUJBM QSJPST GPS β BOE γ BOE B MPH /PSNBM GPS α ćFO UIFZ BMM IBWF UP CF QPTJUJWF *O CVJMEJOH UIF NPEFM XF BMTP XBOU UP BMMPX TPNF PS BMM PG UIF QBSBNFUFST UP WBSZ CZ DPOUBDU SBUF 4JODF DPOUBDU SBUF JT TVQQPTF UP NFEJBUF UIF JOĘVFODF PG QPQVMBUJPO TJ[F MFUT BMMPX α BOE β *U DPVME BMTP JOĘVFODF γ CFDBVTF USBEF OFUXPSLT NJHIU QSFWFOU UPPMT GSPN WBOJTIJOH PWFS UJNF #VU XFMM MFBWF UIBU BT BO FYFSDJTF GPS UIF SFBEFS )FSFT UIF DPEF 3 DPEF  /Ǐ ʚǶ '$./ǿ ʙɶ/*/'Ǿ/**'.Ǣ ʙɶ+*+0'/$*)Ǣ $ʙɶ*)//Ǿ$ Ȁ (ǎǎǡǎǎ ʚǶ 0'(ǿ '$./ǿ  ʡ +*$.ǿ '( ȀǢ '( ʚǶ 3+ǿȁ$ȂȀȉʟȁ$Ȃȅ"Ǣ ȁ$Ȃ ʡ )*-(ǿǎǢǎȀǢ ȁ$Ȃ ʡ  3+ǿǎȀǢ " ʡ  3+ǿǎȀ ȀǢ /ʙ/Ǐ Ǣ #$).ʙǑ Ǣ '*"Ǿ'$&ʙ Ȁ *WF JOWFOUFE UIF FYBDU QSJPST CFIJOE UIF TDFOFT -FUT OPU HFU EJTUSBDUFE XJUI UIPTF * FODPVSBHF ZPV UP QMBZ BSPVOE ćF MFTTPO IFSF JT JO IPX XF CVJME JO UIF QSFEJDUPS WBSJBCMFT 6TJOH QSJPS TJNVMBUJPOT UP EFTJHO UIF QSJPST JT UIF TBNF BMUIPVHI FBTJFS OPX UIBU UIF QBSBNFUFST NFBO TPNFUIJOH 'JOBMMZ UIF DPEF UP QSPEVDF QPTUFSJPS QSFEJDUJPOT JT OP EJČFSFOU UIBO UIF DPEF JO UIF NBJO UFYU VTFE UP QMPU QSFEJDUJPOT GPS (ǎǎǡǎǍ
  10.   (0% 41*,&% 5)& */5&(&34 0 50000 150000 250000

    20 30 40 50 60 70 population total tools low contact high contact 'ĶĴłĿIJ ƉƉƉƈ 1PTUFSJPS QSFEJDUJPOT GPS TDJFOUJĕD NPEFM PG UIF 0DFBOJD UPPM DPVO $PNQBSF UP UIF SJHIU IBOE QMPU JO ' łĿIJ ƉƉƑ 4JODF UIJT NPEFM GPSDFT UIF USFOET QBTT UISPVHI UIF PSJHJO BT JU NVTU JUT CFIBW JT NPSF TFOTJCMF JO BEEJUJPO UP IBWJOH QBSB FUFST XJUI NFBOJOH PVUTJEF B MJOFBS NPEFM 8IBU XF XBOU JT B EZOBNJD NPEFM PG UIF DVMUVSBM FWPMVUJPO PG UPPMT 5PPMT BSFOU DSFB BMM BU PODF *OTUFBE UIFZ EFWFMPQ PWFS UJNF *OOPWBUJPO QSPDFTTFT BU UIFN UP B QPQVMBUJ 1SPDFTTFT PG MPTT SFNPWF UIFN ćFTF GPSDFT CBMBODF UP QSPEVDF UPPM LJUT PG EJČFSFOU TJ[ ćF TJNQMFTU NPEFM BTTVNFT UIBU JOOPWBUJPO JT QSPQPSUJPOBM UP QPQVMBUJPO TJ[F XJUI TPNF   (0% 41*,&% 5)& */5&(&34 -1 0 1 2 0 20 40 60 log population (std) total tools Yap (0.6) Trobriand (0.56) Tonga (0.69) Hawaii (1.01) 0 50000 150000 250000 0 20 40 60 population total tools 'ĶĴłĿIJ ƉƉƑ 1PTUFSJPS QSFEJDUJPOT GPS UIF 0DFBOJD UPPMT NPEFM 'JMMFE QPJOUT BSF TPDJFUJFT XJUI IJTUPSJDBMMZ IJHI DPOUBDU 0QFO QPJOUT BSF UIPTF XJUI MPX DPOUBDU 1PJOU TJ[F JT TDBMFE CZ SFMBUJWF -00*4 1BSFUP L WBMVFT -BSHFS QPJOUT BSF NPSF JOĘVFOUJBM ćF TPMJE DVSWF JT UIF QPTUFSJPS NFBO GPS IJHI DPOUBDU TPDJFUJFT ćF EBTIFE DVSWF JT UIF TBNF GPS MPX DPOUBDU TP DJFUJFT  DPNQBUJCJMJUZ JOUFSWBMT BSF TIPXO CZ UIF TIBEFE SFHJPOT -Fę Scientific model Statistical model Model violations now mean something. Parameters now mean something.
  11. Poisson exposure (offsets) • Poisson outcome: events per unit time/distance

    • Q: What if time/distance varies across cases? • A: Use an exposure, aka offset IFOPNFOB DBO SFNBJO FYQPOFOUJBM GPS MPOH 4P POF UIJOH UP BMXBZT IFUIFS JU NBLFT TFOTF BU BMM SBOHFT PG UIF QSFEJDUPS WBSJBCMFT F FYQFDUFE WBMVF CVU JUT BMTP DPNNPOMZ UIPVHIU PG BT B SBUF #PUI U BOE SFBMJ[JOH UIJT BMMPXT VT UP NBLF 1PJTTPO NPEFMT GPS XIJDI UIF FT J 4VQQPTF GPS FYBNQMF UIBU B OFJHICPSJOH NPOBTUFSZ QFSGPSNT E NBOVTDSJQUT XIJMF ZPVS NPOBTUFSZ EPFT EBJMZ UPUBMT *G ZPV DPNF UT PG SFDPSET IPX DPVME ZPV BOBMZ[F CPUI JO UIF TBNF NPEFM HJWFO HBUFE PWFS EJČFSFOU BNPVOUT PG UJNF EJČFSFOU FYQPTVSFT Z λ JT FRVBM UP BO FYQFDUFE OVNCFS PG FWFOUT µ QFS VOJU UJNF PS IBU λ = µ/τ XIJDI MFUT VT SFEFĕOF UIF MJOL ZJ ∼ 1PJTTPO(λJ) MPH λJ = MPH µJ τJ = α + βYJ BUJP JT UIF TBNF BT B EJČFSFODF PG MPHBSJUINT XF DBO BMTP XSJUF MPH λJ = MPH µJ − MPH τJ = α + βYJ YQPTVSFTw 4P JG EJČFSFOU PCTFSWBUJPOT J IBWF EJČFSFOU FYQPTVSFT FYQFDUFE WBMVF PO SPX J JT HJWFO CZ exposure expected count  10*440/ 3&(3&44*0/ NPEFM MJLF ZJ ∼ 1PJTTPO(µJ) MPH µJ = MPH τJ + α + βYJ XIFSF τ JT B DPMVNO JO UIF EBUB 4P UIJT JT KVTU MJLF BEEJOH B QSF FYQPTVSF XJUIPVU BEEJOH B QBSBNFUFS GPS JU ćFSF XJMM CF BO FY  &YBNQMF 0DFBOJD UPPM DPNQMFYJUZ )FSFT BO FYBNQMF JTMBOE TPDJFUJFT PG 0DFBOJB QSPWJEF B OBUVSBM FYQFSJNFOU JO UFDI
  12. Additional count distributions • Multinomial/categorical: generalized binomial, more than 2

    un-ordered outcomes • Geometric: number of trials until specific event • Mixtures, coping with heterogeneity: • Beta-binomial: varying probabilities • gamma-Poisson: aka negative-Binomial, varying rates • others (e.g. Dirichlet-multinomial)
  13. Survival Analysis • Count models are fundamentally about rates •

    Rate of heads per coin toss • Rate of tools per person • Can also estimate rates by modeling time-to-event • Tricky, because cannot ignore censored cases • Left-censored: Don’t know when time started • Right-censored: Something cut observation off before event occurred • Ignoring censored cases leads to inferential error • Imagine estimating time-to-PhD but ignoring people who drop out • Time in program before dropping out is info about rate
  14. Survival Analysis • Example: Cat adoptions • data(AustinCats) • 20-thousand

    cats • time-to-event • Event either: (1) adopted or (2) something else • Something else could be: death, escape, censored
  15. Un-censored observations • For observed adoptions, just need: OU UIFO

    XBJUJOH UJNFT DBO FOE VQ MPPLJOH WFSZ (BVTTJBO Y JPOT QSPCBCJMJUZ PG PCTFSWFE XBJUJOH UJNF JT TJNQMZ %J ∼ &YQPOFOUJBM(λJ) Q(%J|λJ) = λJ FYQ(−λJ %J) UT UIBU BSF USJDLZ *G TPNFUIJOH FMTF IBQQFOFE CFGPSF B DBU DPVME CF IBTOU CFFO BEPQUFE ZFU UIFO XF OFFE UIF QSPCBCJMJUZ PG OPU CFJOH O UIF PCTFSWBUJPO UJNF TP GBS 0OF XBZ UP NPUJWBUF UIJT JT UP JNBHF KPJOJOH UIF TIFMUFS PO UIF TBNF EBZ *G IBMG IBWF CFFO BEPQUFE BęFS BCJMJUZ PG XBJUJOH  EBZT BOE TUJMM OPU CFJOH BEPQUFE JT  *G BęFS O UIFO UIF QSPCBCJMJUZ PG XBJUJOH  EBZT BOE OPU ZFU CFJOH BEPQUFE PG BEPQUJPO JNQMJFT B QSPQPSUJPO PG UIF DPIPSU PG  DBUT UIBU XJMM 0 1 2 3 4 5 0.0 0.2 0.4 0.6 0.8 1.0 x dexp(x) probability event happens at time x λ = 0.5 λ = 1.0  4JNVMBUFE DBUT Y  "DUVBM DBUT Y 'PS PCTFSWFE BEPQUJPOT QSPCBCJMJUZ PG PCTFSWFE XBJUJOH UJNF JT %J ∼ &YQPOFOUJBM(λJ) *O SBXFS GPSN Q(%J|λJ) = λJ FYQ(−λJ %J) *UT UIF DFOTPSFE DBUT UIBU BSF USJDLZ *G TPNFUIJOH FMTF IBQQFOF BEPQUFE PS JU TJNQMZ IBTOU CFFO BEPQUFE ZFU UIFO XF OFFE UIF Q BEPQUFE DPOEJUJPOBM PO UIF PCTFSWBUJPO UJNF TP GBS 0OF XBZ UP N B DPIPSU PG  DBUT BMM KPJOJOH UIF TIFMUFS PO UIF TBNF EBZ *G IBMG I  EBZT UIFO UIF QSPCBCJMJUZ PG XBJUJOH  EBZT BOE TUJMM OPU CFJOH  EBZT POMZ  SFNBJO UIFO UIF QSPCBCJMJUZ PG XBJUJOH  EBZT BOE JT  "OZ HJWFO SBUF PG BEPQUJPO JNQMJFT B QSPQPSUJPO PG UIF DPI SFNBJO BęFS BOZ HJWFO OVNCFS PG EBZT
  16. Censored cats • Cumulative distribution (CDF): Probability event before-or-at time

    x • Complementary cumulative distribution (CCDF): Probability not-event-yet 0 1 2 3 4 5 0.0 0.2 0.4 0.6 0.8 1.0 x pexp(x) probability event before-or-at time x 0 1 2 3 4 5 0.0 0.2 0.4 0.6 0.8 1.0 x exp(-x) probability not-event before-or-at time x λ = 0.5 λ = 1.0 CDF CCDF  (0% 41*,&% 5)& */5&(&34 XF DPNFT GSPN UIF İłĺłĹĮŁĶŃIJ ĽĿļįĮįĶĹĶŁņ ıĶŀŁĿĶįłŁĶļĻ " DV HJWFT UIF QSPQPSUJPO PG DBUT BEPQUFE CFGPSF PS BU B DFSUBJO OVNCFS PG UIF DVNVMBUJWF EJTUSJCVUJPO HJWFT UIF QSPCBCJMJUZ B DBU JT OPU BEPQUFE PG EBZT ćBU JT UIF QSPCBCJMJUZ UIBU XF OFFE ćJT EJTUSJCVUJPO‰POF F QSPCBCJMJUZ EJTUSJCVUJPO‰JT DBMMFE UIF İļĺĽĹIJĺIJĻŁĮĿņ İłĺłĹĮ ĶŀŁĿĶįłŁĶļĻ *O UIF DBTF PG UIF FYQPOFOUJBM EJTUSJCVUJPO UIF DVNVMB 1S(%J|λJ) =  − FYQ(−λJ %J) KVTU 1S(%J|λJ) = FYQ(−λJ %J) E JO PVS NPEFM TJODF JU JT QSPCBCJMJUZ PG XBJUJOH %J EBZT XJUIPVU CFJOH Ȁ ćF QSPCBCJMJUZ XF DPNFT GSPN UIF İłĺłĹĮŁĶŃIJ ĽĿļįĮįĶĹ NVMBUJWF EJTUSJCVUJPO HJWFT UIF QSPQPSUJPO PG DBUT BEPQUFE CFGPSF EBZT 4P POFNJOVT UIF DVNVMBUJWF EJTUSJCVUJPO HJWFT UIF QSPCB CZ UIF TBNF OVNCFS PG EBZT ćBU JT UIF QSPCBCJMJUZ UIBU XF OFFE NJOVT UIF DVNVMBUJWF QSPCBCJMJUZ EJTUSJCVUJPO‰JT DBMMFE UIF İļ ŁĶŃIJ ĽĿļįĮįĶĹĶŁņ ıĶŀŁĿĶįłŁĶļĻ *O UIF DBTF PG UIF FYQPOFOUJB UJWF JT 1S(%J|λJ) =  − FYQ(−λJ %J) 4P UIF DPNQMFNFOU JT KVTU 1S(%J|λJ) = FYQ(−λJ %J) 4P UIBUT XIBU XF OFFE JO PVS NPEFM TJODF JU JT QSPCBCJMJUZ PG XBJU BEPQUFE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ǐ Ȁ Ǣ *+/  ʙ ɶ*+/ Ȁ (ǎǎǡǎǑ ʚǶ 0'(ǿ '$./ǿ 4.Ǿ/*Ǿ 1 )/Ȇ*+/ ʙʙǎ ʡ 3+*) )/$'ǿ '( ȀǢ 4.Ǿ/*Ǿ 1 )/Ȇ*+/ ʙʙǍ ʡ 0./*(ǿ 3+*) )/$'Ǿ'!ǿ Ǧ Ȇ '( ȀȀǢ '( ʚǶ ǎǡǍȅ(0Ǣ '*"ǿ(0Ȁ ʚǶ ȁ*'*-Ǿ$ȂǢ ȁ*'*-Ǿ$Ȃ ʡ )*-('ǿǍǢǎȀ ȀǢ /ʙ/ Ǣ #$).ʙǑ Ǣ *- .ʙǑ Ȁ +- $.ǿ (ǎǎǡǎǑ Ǣ Ǐ Ȁ ( ) . ǒǡǒʉ ǖǑǡǒʉ )Ǿ !! #/ ȁǎȂ ǑǡǍǒ ǍǡǍǐ ǑǡǍǎ ǑǡǍǖ ǎǑǍǒ ǎ ȁǏȂ ǐǡǕǕ ǍǡǍǎ ǐǡǕǔ ǐǡǖǍ ǎǑǍǐ ǎ
  18. Other cats Posterior survival curves 0 20 40 60 80

    100 0.0 0.2 0.4 0.6 0.8 1.0 Days Proportion remaining Black cats Other cats  $&/403*/( "/% +*./ ʚǶ 3/-/ǡ.(+' .ǿ (ǎǎǡǎǑ Ȁ +*./ɶ ʚǶ 3+ǿ+*./ɶȀ +- $.ǿ +*./ Ǣ Ǐ Ȁ Ǫ/ǡ!-( Ǫǣ ǏǍǍǍ *.ǡ *! Ǒ 1-$' .ǣ ( ) . ǒǡǒʉ ǖǑǡǒʉ #$./*"-( ȁǎȂ ǑǡǍǒ ǍǡǍǐ ǑǡǍǎ ǑǡǍǖ ΤΤΤΥΨΪΨΥΤΤ ȁǏȂ ǐǡǕǕ ǍǡǍǎ ǐǡǕǔ ǐǡǖǍ ΤΤΥΪΪΦΤΤ ȁǎȂ ǒǔǡǑǑ ǎǡǑǔ ǒǒǡǎǎ ǒǖǡǔǔ ΤΤΤΦΪΪΨΥΤΤΤ ȁǏȂ ǑǕǡǑǑ ǍǡǑǖ Ǒǔǡǔǎ ǑǖǡǏǏ ΤΤΦΪΪΥΤΤ 0WFSUIJOLJOH $VTUPN EJTUSJCVUJPOT JO 4UBO ćF TVS BTTJHONFOU UP EFĕOF UIF DPNQMFNFOUBSZ DVNVMBUJWF E FBTZ UP BEE BOZ DVTUPN QSPCBCJMJUZ EJTUSJCVUJPO UIJT XB EJTUSJCVUJPO JO 0'( BDUVBM EPFT JO UIF 4UBO DPEF TP ZPV PO UIF NPEFM CMPDL PG ./)* ǿ(ǍǍȀ (* 'ȃ 1 /*-ȁǏǏǐǒǓȂ '(Ǥ  ʡ )*-('ǿ Ǎ Ǣ ǎ ȀǤ  ʡ )*-('ǿ Ǎ Ǣ ǎ ȀǤ
  19. None
  20. Do not attempt at home (or anywhere near me)

  21. Monsters and mixtures • More complicated GLMs: • Monsters: Specialized,

    complex distributions • ordered categories, ranks • Mixtures: Blends of stochastic processes • Varying means, probabilities, rates • Varying process: zero-inflation, hurdles
  22. Mixtures • Some outcomes mix different processes • replace parameter

    of likelihood with distribution of its own • Over-dispersion: counts often more variable than expected, because probabilities/rates are variable • beta-binomial, gamma-Poisson (negative-binomial) • Zero-inflated mixtures
  23. Monastery Mystery • Monks copy manuscripts • They also get

    drunk • Data: num manuscripts completed each day • Can infer number of days they got drunk?
  24. Analyze? • Zero-inflated Poisson observations • Hidden state: drunk or

    sober • Can estimate probability of drinking and rate of production when sober • Must build a new likelihood, a mixture of stochastic processes p 1 – p observe y = 0 observe y > 0 Drink Work 'ĶĴłĿIJ ƉƉƌ -Fę 4USVDUVSF PG UIF [FSP HJOOJOH BU UIF UPQ UIF NPOLT ESJOL Q P UIF UJNF %SJOLJOH NPOLT BMXBZT QSPEV NPOLT NBZ QSPEVDF FJUIFS Z =  PS Z > [FSPJOĘBUFE PCTFSWBUJPOT ćF CMVF MJOF PCTFSWBUJPOT UIBU BSPTF GSPN ESJOLJOH *
  25. Analyze? p 1 – p observe y = 0 observe

    y > 0 Drink Work 'ĶĴłĿIJ ƉƉƌ -Fę 4USVDUVSF PG UIF [FSP HJOOJOH BU UIF UPQ UIF NPOLT ESJOL Q P UIF UJNF %SJOLJOH NPOLT BMXBZT QSPEV NPOLT NBZ QSPEVDF FJUIFS Z =  PS Z > [FSPJOĘBUFE PCTFSWBUJPOT ćF CMVF MJOF PCTFSWBUJPOT UIBU BSPTF GSPN ESJOLJOH *  .0/45&34 "/% .*9563&4 1 – p observe y > 0 Work 0 1 2 3 4 5 0 50 100 150 manuscripts completed Frequency VSF PG UIF [FSPJOĘBUFE MJLFMJIPPE DBMDVMBUJPO #F POLT ESJOL Q PG UIF UJNF PS JOTUFBE XPSL  − Q PG T BMXBZT QSPEVDF BO PCTFSWBUJPO Z =  8PSLJOH drunk zeros
  26. p 1 – p Binomial process

  27. p 1 – p observe zero Poisson process Binomial process

  28. p 1 – p observe zero Poisson process FYQ(−λ) TJ

    ∼ #JOPNJBM(OJ, QJ) MPHJU QJ = α TJ ∼ #FUB#JOPNJBM(OJ, ¯ QJ, θ) MPHJU ¯ QJ = α + β1 1J MPH θ = τ Binomial process
  29. p 1 – p observe zero Poisson process FYQ(−λ) TJ

    ∼ #JOPNJBM(OJ, QJ) MPHJU QJ = α TJ ∼ #FUB#JOPNJBM(OJ, ¯ QJ, θ) MPHJU ¯ QJ = α + β1 1J MPH θ = τ observe n λO FYQ(−λ) O! TJ ∼ #JOPNJBM(OJ, QJ) MPHJU QJ = α TJ ∼ #FUB#JOPNJBM(OJ, ¯ QJ, θ) MPHJU ¯ QJ = α + β1 1J MPH θ = τ Binomial process
  30. p 1 – p observe zero Poisson process FYQ(−λ) TJ

    ∼ #JOPNJBM(OJ, QJ) MPHJU QJ = α TJ ∼ #FUB#JOPNJBM(OJ, ¯ QJ, θ) MPHJU ¯ QJ = α + β1 1J MPH θ = τ observe n λO FYQ(−λ) O! TJ ∼ #JOPNJBM(OJ, QJ) MPHJU QJ = α TJ ∼ #FUB#JOPNJBM(OJ, ¯ QJ, θ) MPHJU ¯ QJ = α + β1 1J MPH θ = τ Binomial process 1S(|Q, λ) = Q + ( − Q) FYQ(−λ) TJ ∼ #JOPNJBM(OJ, QJ) MPHJU QJ = α TJ ∼ #FUB#JOPNJBM(OJ, ¯ QJ, θ) MPHJU ¯ QJ = α + β1 1J MPH θ = τ
  31. p 1 – p observe zero Poisson process FYQ(−λ) TJ

    ∼ #JOPNJBM(OJ, QJ) MPHJU QJ = α TJ ∼ #FUB#JOPNJBM(OJ, ¯ QJ, θ) MPHJU ¯ QJ = α + β1 1J MPH θ = τ observe n λO FYQ(−λ) O! TJ ∼ #JOPNJBM(OJ, QJ) MPHJU QJ = α TJ ∼ #FUB#JOPNJBM(OJ, ¯ QJ, θ) MPHJU ¯ QJ = α + β1 1J MPH θ = τ Binomial process 1S(O|Q, λ) = ( − Q) λO FYQ(−λ) O! TJ ∼ #JOPNJBM(OJ, QJ) MPHJU QJ = α TJ ∼ #FUB#JOPNJBM(OJ, ¯ QJ, θ) MPHJU ¯ QJ = α + β1 1J 1S(|Q, λ) = Q + ( − Q) FYQ(−λ) TJ ∼ #JOPNJBM(OJ, QJ) MPHJU QJ = α TJ ∼ #FUB#JOPNJBM(OJ, ¯ QJ, θ) MPHJU ¯ QJ = α + β1 1J MPH θ = τ
  32. Zero-inflated Poisson model NF GSPN XIJDI QSPDFTT FWFS QSPEVDF Z

    >  UIF FYQSFTTJPO BCPWF JT KVTU UIF DIBODF UIF BOE ĕOJTI Z NBOVTDSJQUT UIF EJTUSJCVUJPO BCPWF XJUI QBSBNFUFST Q QSPCBCJMJUZ PG B [FSP BOE FTDSJCF JUT TIBQF ćFO B [FSPJOĘBUFE 1PJTTPO SFHSFTTJPO UBLFT UIF ZJ ∼ ;*1PJTTPO(QJ, λJ) MPHJU(QJ) = αQ + βQ YJ MPH(λJ) = αλ + βλ YJ P MJOFBS NPEFMT BOE UXP MJOL GVODUJPOT POF GPS FBDI QSPDFTT JO UIF FST PG UIF MJOFBS NPEFMT EJČFS CFDBVTF BOZ QSFEJDUPS TVDI BT Y NBZ XJUI FBDI QBSU PG UIF NJYUVSF *O GBDU ZPV EPOU FWFO IBWF UP VTF PUI NPEFMT‰ZPV DBO DPOTUSVDU UIF UXP MJOFBS NPEFMT IPXFWFS ZPV PVS IZQPUIFTJT XF OFFE OPX FYDFQU GPS TPNF BDUVBM EBUB 4P MFUT TJNVMBUF UIF SLJOH ćFO ZPVMM TFF UIF DPEF VTFE UP SFDPWFS UIF QBSBNFUFS WBMVFT p 1 – p observe y = 0 observe y > 0 Drink Work 'ĶĴłĿIJ ƉƉƌ -Fę 4USVDUVSF PG UIF [FSP HJOOJOH BU UIF UPQ UIF NPOLT ESJOL Q P UIF UJNF %SJOLJOH NPOLT BMXBZT QSPEV NPOLT NBZ QSPEVDF FJUIFS Z =  PS Z > [FSPJOĘBUFE PCTFSWBUJPOT ćF CMVF MJOF PCTFSWBUJPOT UIBU BSPTF GSPN ESJOLJOH * Linear models are independent
  33. Simulate, validate, cromulate • As models get more complicated, no

    guarantees you can • specify model correctly • estimate actual process reliably • Bayes not magic, just logic • Simulate “dummy data” • recover estimates • understand the model • Try parameter combinations hostile to estimation, so you know limits of the golem
  34. Simulated manuscripts   .0/45&34 "/% .*9563&4 p 1 –

    p observe y = 0 observe y > 0 Drink Work 0 1 2 3 4 5 0 50 100 150 manuscripts completed Frequency 'ĶĴłĿIJ ƉƉƌ -Fę 4USVDUVSF PG UIF [FSPJOĘBUFE MJLFMJIPPE DBMDVMBUJPO #F HJOOJOH BU UIF UPQ UIF NPOLT ESJOL Q PG UIF UJNF PS JOTUFBE XPSL  − Q P UIF UJNF %SJOLJOH NPOLT BMXBZT QSPEVDF BO PCTFSWBUJPO Z =  8PSLJO NPOLT NBZ QSPEVDF FJUIFS Z =  PS Z >  3JHIU 'SFRVFODZ EJTUSJCVUJPO P [FSPJOĘBUFE PCTFSWBUJPOT ćF CMVF MJOF TFHNFOU PW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( ) . ǒǡǒʉ ǖǑǡǒʉ )Ǿ !! #/ + ǶǎǡǏǕ Ǎǡǐǒ ǶǎǡǖǍ ǶǍǡǕǍ ǓǏǓ ǎǡǍǎ ' ǍǡǍǎ ǍǡǍǖ ǶǍǡǎǐ Ǎǡǎǒ ǓǎǕ ǎǡǍǍ 0O UIF OBUVSBM TDBMF UIPTF ."1 FTUJNBUFT BSF 3 DPE  $)1Ǿ'*"$/ǿǶǎǡǏǕȀ ȕ +-*$'$/4 -$)& 3+ǿǍǡǍǎȀ ȕ -/ !$)$.# ()0.-$+/.Ǣ 2# ) )*/ -$)&$)" ȁǎȂ ǍǡǏǎǔǒǒǍǏ ȁǎȂ ǎǡǍǎǍǍǒ /PUJDF UIBU XF DBO HFU BO BDDVSBUF FTUJNBUF PG UIF QSPQPSUJPO PG EBZT UIF NPOLT ESJOL FWFO UIPVHI XF DBOU TBZ GPS BOZ QBSUJDVMBS EBZ XIFUIFS PS OPU UIFZ ESBOL ćJT FYBNQMF JT UIF TJNQMFTU QPTTJCMF *O SFBM QSPCMFNT ZPV NJHIU IBWF QSFEJDUPS WBSJ  ;&30*/'-"5&% 065$0.&4  3  (ǎǏǡǑ ʚǶ 0'(ǿ '$./ǿ 4 ʡ 5$+*$.ǿ + Ǣ '( ȀǢ '*"$/ǿ+Ȁ ʚǶ +Ǣ '*"ǿ'(Ȁ ʚǶ 'Ǣ + ʡ )*-(ǿ Ƕǎǡǒ Ǣ ǎ ȀǢ ' ʡ )*-(ǿ ǎ Ǣ Ǎǡǒ Ȁ Ȁ Ǣ /ʙ'$./ǿ4ʙ.ǡ$)/ " -ǿ4ȀȀ Ǣ #$).ʙǑ Ȁ +- $.ǿ (ǎǏǡǑ Ȁ ( ) . ǒǡǒʉ ǖǑǡǒʉ )Ǿ !! #/ + ǶǎǡǏǕ Ǎǡǐǒ ǶǎǡǖǍ ǶǍǡǕǍ ǓǏǓ ǎǡǍǎ ' ǍǡǍǎ ǍǡǍǖ ǶǍǡǎǐ Ǎǡǎǒ ǓǎǕ ǎǡǍǍ 0O UIF OBUVSBM TDBMF UIPTF ."1 FTUJNBUFT BSF 3  $)1Ǿ'*"$/ǿǶǎǡǏǕȀ ȕ +-*$'$/4 -$)& 3+ǿǍǡǍǎȀ ȕ -/ !$)$.# ()0.-$+/.Ǣ 2# ) )*/ -$)&$)" ȁǎȂ ǍǡǏǎǔǒǒǍǏ ȁǎȂ ǎǡǍǎǍǍǒ /PUJDF UIBU XF DBO HFU BO BDDVSBUF FTUJNBUF PG UIF QSPQPSUJPO PG EBZT UIF NPOLT ESJOL FWFO UIPVHI XF DBOU TBZ GPS BOZ QBSUJDVMBS EBZ XIFUIFS PS OPU UIFZ ESBOL ćJT FYBNQMF JT UIF TJNQMFTU QPTTJCMF *O SFBM QSPCMFNT ZPV NJHIU IBWF QSFEJDUPS WBSJ
  36. Under the hood • Same model, raw coding • See

    Overthinking box on page 383 BCMFT UIBU BSF BTTPDJBUFE XJUI POF PS CPUI QSPDFTTFT JOTJEF UIF [FSPJOĘBUFE 1PJT *O UIBU DBTF ZPV KVTU BEE UIPTF WBSJBCMFT BOE UIFJS TMPQF QBSBNFUFST UP FJUIFS P NPEFMT 0WFSUIJOLJOH ;FSPJOĘBUFE 1PJTTPO DBMDVMBUJPOT JO 4UBO ćF GVODUJPO 5$+*$. JT JO B XBZ UIBU HVBSET BHBJOTU TPNF LJOET PG OVNFSJDBM FSSPS 4P JUT DPEF MPPLT DPOGVT i5$+*$.w BU UIF 3 QSPNQU BOE TFF #VU SFBMMZ BMM JUT EPJOH JT JNQMFNFOUJOH UIF MJLFM EFĕOFE JO UIF TFDUJPO BCPWF -FUT GPDVT PO IPX UIJT JT JNQMFNFOUFE JO 4UBO 8IFO Z VTF 5$+*$. JU VOEFSTUBOET JU MJLF UIJT (ǎǏǡǑǾ'/ ʚǶ 0'(ǿ '$./ǿ 4Ȇ4ʛǍ ʡ 0./*(ǿ '*"ǎ(ǿ+Ȁ ʔ +*$..*)Ǿ'+(!ǿ4Ȇ'(Ȁ ȀǢ 4Ȇ4ʙʙǍ ʡ 0./*(ǿ '*"Ǿ($3ǿ + Ǣ Ǎ Ǣ +*$..*)Ǿ'+(!ǿǍȆ'(Ȁ Ȁ ȀǢ '*"$/ǿ+Ȁ ʚǶ +Ǣ '*"ǿ'(Ȁ ʚǶ 'Ǣ + ʡ )*-(ǿǶǎǡǒǢǎȀǢ ' ʡ )*-(ǿǎǢǍǡǒȀ Ȁ Ǣ /ʙ'$./ǿ4ʙ.ǡ$)/ " -ǿ4ȀȀ Ǣ #$).ʙǑ Ȁ ćBU JT UIF TBNF NPEFM CVU XJUI FYQMJDJU NJYUVSFT BOE TPNF SBX 4UBO DPEF JOTJEF UIF *G ZPV MPPL BU ./)* ǿ(ǎǏǡǑǾ'/Ȁ ZPVMM TFF UIF DPSSFTQPOEJOH MJOFT $! ǿ 4ȁ$Ȃ ʛ Ǎ Ȁ /-" / ʔʙ '*"ǎ(ǿ+Ȁ ʔ +*$..*)Ǿ'+(!ǿ4ȁ$Ȃ Ȇ '(ȀǤ
  37. Other mixtures • Can ZIBinomial, too • Also “hurdle” models,

    aka zero-augmented • Continuous mixtures for overdispersed counts • beta-binomial • gamma-Poisson • Multilevel models are a sort of mixture
  38. Ordered categories • How much do you like this class?

    (1–7) • How important is income of a potential spouse? (1–10) • How often do you see bats? (never, sometimes, frequently) • Depth harbor seals dive? (shallow, middle, deep)