Upgrade to Pro — share decks privately, control downloads, hide ads and more …

データドリブンな仮説検証のためのSelective Inference

saltcooky
October 26, 2019

データドリブンな仮説検証のためのSelective Inference

TokyoR#82 で発表したLT

saltcooky

October 26, 2019
Tweet

More Decks by saltcooky

Other Decks in Science

Transcript

  1. 6 σʔλʹجͮ͘Ծઆܗ੒
 ʮҿञ͸ ʹྑ͍ʯ σʔλۦಈܕͳ౷ܭ෼ੳ ಘΒΕͯσʔλʹ
 ۮવͦͷΑ͏ͳ܏޲͕
 ͋ͬͨͷ͔΋͠Εͳ͍ σʔλ Ծઆݕఆ


    ؼແԾઆ͕غ٫Ͱ͖Δ͔ ݁ՌධՁ
 ༗ҙͳ͕ࠩ͋Δͱ൑໌ ͦͷΑ͏ͳ܏޲͕͋ΔσʔλͰ
 ݕఆΛ͢Δͱ༗ҙʹͳΓ΍͍͢ʁ ౷ܭ෼ੳͷ࿩
  2. 7 Ծઆબ୒όΠΞε σʔλʹجͮ͘Ծઆܗ੒
 ʮҿञ͸ ʹྑ͍ʯ σʔλۦಈܕͳ౷ܭ෼ੳ σʔλ Ծઆݕఆ
 ؼແԾઆ͕غ٫Ͱ͖Δ͔ ݁ՌධՁ


    ༗ҙͳ͕ࠩ͋Δͱ൑໌ Ծઆબ୒όΠΞε σʔλΛجʹԾઆܗ੒Λ͓͜ͳͬͨͱ͖
 Ծઆݕఆʹੜͯ͡͠·͏όΠΞε
  3. 9 Ծઆબ୒όΠΞεͷ֬ೝ Ќ Ќ Ќ Ќ Ќ Ќ Ќ Ќ

    Ќ Ќ غ٫͞Εͨ਺           غ٫͞Ε͔ͨ ͬͨ਺           غ٫ൺ཰            ʻม਺બ୒ΛߦΘͳ͍৔߹ʼ
 όΠΞε͕ͳ͍৔߹ɺ༗ҙਫ४ͱغ٫ׂ߹͸౳͘͠ͳΔ

  4. 11 Ծઆબ୒όΠΞεͷ֬ೝ Ќ Ќ Ќ Ќ Ќ Ќ Ќ Ќ

    Ќ Ќ غ٫͞Εͨ਺           غ٫͞Ε͔ͨ ͬͨ਺           غ٫ׂ߹            ม਺બ୒Λߦ͏৔߹
 غ٫ׂ߹͸༗ҙਫ४ΑΓඇৗʹେ͖͘ͳ͍ͬͯΔ

  5. 4FMFDUJWF*OGFSFODF ճؼ෼ੳʹ͓͚Δಛ௃બ୒Πϕϯτ w .BSHJOBM4DSFBOJOH
 ɹϧʔϧఆٛʹج͍ͮͨม਺બ୒ w MBTTP
 ɹ࠷దੑ৚݅ʹج͍ͮͨม਺બ୒ w 4UFQXJTF


    ɹΞϧΰϦζϜʹج͍ͮͨม਺બ୒ ͜ΕΒશͯઢܗͳಛ௃બ୒Πϕϯτ 15 ը૾ग़యIUUQTXXXJFJDFPSHdTJUBGPSVNBSUJDMFQEG
  6. 3Ͱ4FMFDUJWF*OGFSFODF 3Ͱͷճؼ෼ੳͷ4FMFDUJWF*OGFSFODF͸
 TFMFDUJWF*OGFSFODFύοέʔδͰ࣮૷Մೳ 17 
 > # stepwiseʹ͓͚Δselective inferenceͷ࣮ߦྫ
 >

    library(selectiveInference) > gfit = fs(x,y) # x=આ໌ม਺ y=໨తม਺ > out = fsInf(gfit,type = "aic",alpha = 0.05)
 > out # ݁Ռͷ֬ೝ

  7. 3Ͱ4FMFDUJWF*OGFSFODF 3Ͱͷճؼ෼ੳͷ4FMFDUJWF*OGFSFODF͸
 TFMFDUJWF*OGFSFODFύοέʔδͰ࣮૷Մೳ 18 
 > # lassoʹ͓͚Δselective inferenceͷ࣮ߦྫ
 >

    gfit = glmnet(x,y) > lambda = .3 > beta_ls = coef(gfit, s=lambda/n)[-1] > out = fixedLassoInf(x,y,beta_ls,lambda,sigma=sigma)
  8. 19 3Ͱ4FMFDUJWF*OGFSFODF Ќ Ќ Ќ Ќ Ќ Ќ Ќ Ќ

    Ќ Ќ غ٫͞Εͨ਺           غ٫͞Ε͔ͨ ͬͨ਺           غ٫ׂ߹            TUFQXJTFʹ͓͚Δ4*݁Ռ
 غ٫ׂ߹͸֓Ͷఔ౓ʹͳ͍ͬͯΔ
  9. ࢀߟ w &YBDUQPTUTFMFDUJPOJOGFSFODF XJUIBQQMJDBUJPOUPUIFMBTTP+BTPO%-FFFUBM  
 IUUQTBSYJWPSHBCT w 4FMFDUJWFJOGFSFODFBGUFSWBSJBCMFTFMFDUJPOWJBNVMUJTDBMFCPPUTUSBQ5FSBEB 4IJNPEBJSB

    
 IUUQTBSYJWPSHBCT w "DPOEJUJPOBMBQQSPBDIUPJOGFSFODFBGUFSNPEFMTFMFDUJPO
 IUUQKPTIVBMPGUVTDPNQPTUDPOEJUJPOBMBQQSPBDIUPJOGFSFODFBGUFSNPEFM TFMFDUJPO w $PNQVUJOHTFMFDUJWFJOGFSFODFQWBMVFTPGDMVTUFSTVTJOHQWDMVTUBOETDBMFCPPU
 IUUQTUBUTZTJLZPUPVBDKQQSPHTDBMFCPPUQWDMVTUQEG w σʔλۦಈܕՊֶͷͨΊͷબ୒తਪ࿦ʢ4FMFDUJWF*OGFSFODFʣ
 IUUQTXXXJFJDFPSHdTJUBGPSVNBSUJDMFQEG w Ծઆݕఆʹ͓͚Δม਺બ୒ͷӨڹΛߟ͑Δ4FMFDUJWF*OGFSFODFೖ໳XJUI3
 IUUQTRJJUBDPNTBMUDPPLZJUFNTCFCGECDG 24