kubostat7f p GLM! logistic regression as usual? N? GLM GLM doesn t work! GLM!! probabilit distribution binomial distribution : : β + β x i link functi

Similar documents
一般化線形 (混合) モデル (2) - ロジスティック回帰と GLMM

kubostat2017b p.1 agenda I 2017 (b) probability distribution and maximum likelihood estimation :

kubostat2015e p.2 how to specify Poisson regression model, a GLM GLM how to specify model, a GLM GLM logistic probability distribution Poisson distrib

kubostat2017e p.1 I 2017 (e) GLM logistic regression : : :02 1 N y count data or

kubostat2017c p (c) Poisson regression, a generalized linear model (GLM) : :

kubostat2017j p.2 CSV CSV (!) d2.csv d2.csv,, 286,0,A 85,0,B 378,1,A 148,1,B ( :27 ) 10/ 51 kubostat2017j (

12/1 ( ) GLM, R MCMC, WinBUGS 12/2 ( ) WinBUGS WinBUGS 12/2 ( ) : 12/3 ( ) :? ( :51 ) 2/ 71

kubostat2018d p.2 :? bod size x and fertilization f change seed number? : a statistical model for this example? i response variable seed number : { i

講義のーと : データ解析のための統計モデリング. 第3回

kubostat1g p. MCMC binomial distribution q MCMC : i N i y i p(y i q = ( Ni y i q y i (1 q N i y i, q {y i } q likelihood q L(q {y i } = i=1 p(y i q 1

60 (W30)? 1. ( ) 2. ( ) web site URL ( :41 ) 1/ 77

kubo2015ngt6 p.2 ( ( (MLE 8 y i L(q q log L(q q 0 ˆq log L(q / q = 0 q ˆq = = = * ˆq = 0.46 ( 8 y 0.46 y y y i kubo (ht

k2 ( :35 ) ( k2) (GLM) web web 1 :

kubostat2018a p.1 統計モデリング入門 2018 (a) The main language of this class is 生物多様性学特論 Japanese Sorry An overview: Statistical Modeling 観測されたパターンを説明する統計モデル

kubo2017sep16a p.1 ( 1 ) : : :55 kubo ( ( 1 ) / 10

統計モデリング入門 2018 (a) 生物多様性学特論 An overview: Statistical Modeling 観測されたパターンを説明する統計モデル 久保拓弥 (北海道大 環境科学) 統計モデリング入門 2018a 1

講義のーと : データ解析のための統計モデリング. 第2回

講義のーと : データ解析のための統計モデリング. 第5回

,, Poisson 3 3. t t y,, y n Nµ, σ 2 y i µ + ɛ i ɛ i N0, σ 2 E[y i ] µ * i y i x i y i α + βx i + ɛ i ɛ i N0, σ 2, α, β *3 y i E[y i ] α + βx i

(2/24) : 1. R R R

/22 R MCMC R R MCMC? 3. Gibbs sampler : kubo/

今回 次回の要点 あぶない 時系列データ解析は やめましょう! 統計モデル のあてはめ Danger!! (危 1) 時系列データの GLM あてはめ (危 2) 時系列Yt 時系列 Xt 各時刻の個体数 気温 とか これは次回)

80 X 1, X 2,, X n ( λ ) λ P(X = x) = f (x; λ) = λx e λ, x = 0, 1, 2, x! l(λ) = n f (x i ; λ) = i=1 i=1 n λ x i e λ i=1 x i! = λ n i=1 x i e nλ n i=1 x

/ *1 *1 c Mike Gonzalez, October 14, Wikimedia Commons.

/ 60 : 1. GLM? 2. A: (pwer functin) x y?

1 15 R Part : website:

AR(1) y t = φy t 1 + ɛ t, ɛ t N(0, σ 2 ) 1. Mean of y t given y t 1, y t 2, E(y t y t 1, y t 2, ) = φy t 1 2. Variance of y t given y t 1, y t

Use R

y i OLS [0, 1] OLS x i = (1, x 1,i,, x k,i ) β = (β 0, β 1,, β k ) G ( x i β) 1 G i 1 π i π i P {y i = 1 x i } = G (

1 環境統計学ぷらす 第 5 回 一般 ( 化 ) 線形混合モデル 高木俊 2013/11/21

: (GLMM) (pseudo replication) ( ) ( ) & Markov Chain Monte Carlo (MCMC)? /30

k3 ( :07 ) 2 (A) k = 1 (B) k = 7 y x x 1 (k2)?? x y (A) GLM (k

% 10%, 35%( 1029 ) p (a) 1 p 95% (b) 1 Std. Err. (c) p 40% 5% (d) p 1: STATA (1). prtesti One-sample test of pr

橡ボーダーライン.PDF

: Bradley-Terry Burczyk

/ 55 2 : : (GLM) 1. 1/23 ( )? GLM? (GLM ) 2.! 1/25 ( ) ffset (GLM )

dvi

ECCS. ECCS,. ( 2. Mac Do-file Editor. Mac Do-file Editor Windows Do-file Editor Top Do-file e

1 Stata SEM LightStone 4 SEM 4.. Alan C. Acock, Discovering Structural Equation Modeling Using Stata, Revised Edition, Stata Press 3.


²¾ÁÛ¾õ¶·É¾²ÁË¡¤Î¤¿¤á¤Î¥Ñ¥Ã¥±¡¼¥¸DCchoice ¡Ê»ÃÄêÈÇ¡Ë

Dirichlet process mixture Dirichlet process mixture 2 /40 MIRU2008 :

Stata11 whitepapers mwp-037 regress - regress regress. regress mpg weight foreign Source SS df MS Number of obs = 74 F(

こんにちは由美子です

卒業論文

Stata User Group Meeting in Kyoto / ( / ) Stata User Group Meeting in Kyoto / 21

みっちりGLM

Taro10-岩手県警察航空隊の運営及

最小2乗法

2 / 39

JOURNAL OF THE JAPANESE ASSOCIATION FOR PETROLEUM TECHNOLOGY VOL. 66, NO. 6 (Nov., 2001) (Received August 10, 2001; accepted November 9, 2001) Alterna

報告書

1 Stata SEM LightStone 3 2 SEM. 2., 2,. Alan C. Acock, Discovering Structural Equation Modeling Using Stata, Revised Edition, Stata Press.

X X X Y R Y R Y R MCAR MAR MNAR Figure 1: MCAR, MAR, MNAR Y R X 1.2 Missing At Random (MAR) MAR MCAR MCAR Y X X Y MCAR 2 1 R X Y Table 1 3 IQ MCAR Y I

浜松医科大学紀要

Stata 11 Stata ts (ARMA) ARCH/GARCH whitepaper mwp 3 mwp-083 arch ARCH 11 mwp-051 arch postestimation 27 mwp-056 arima ARMA 35 mwp-003 arima postestim

分布


9 8 7 (x-1.0)*(x-1.0) *(x-1.0) (a) f(a) (b) f(a) Figure 1: f(a) a =1.0 (1) a 1.0 f(1.0)

わが国企業による資金調達方法の選択問題

p.1/22

第11回:線形回帰モデルのOLS推定

03.Œk’ì

2

Microsoft PowerPoint - GLMMexample_ver pptx

Isogai, T., Building a dynamic correlation network for fat-tailed financial asset returns, Applied Network Science (7):-24, 206,

,,.,,.,..,.,,,.,, Aldous,.,,.,,.,,, NPO,,.,,,,,,.,,,,.,,,,..,,,,.,

Evaluation of a SATOYAMA Forest Using a Voluntary Labor Supply Curve Version: c 2003 Taku Terawaki, Akio Muranaka URL: http

21世紀の統計科学 <Vol. III>

udc-2.dvi

09基礎分析講習会

バイオインフォマティクス特論12

推定モデル

GLM PROC GLM y = Xβ + ε y X β ε ε σ 2 E[ε] = 0 var[ε] = σ 2 I σ 2 0 σ 2 =... 0 σ 2 σ 2 I ε σ 2 y E[y] =Xβ var[y] =σ 2 I PROC GLM

Page 1 of 6 B (The World of Mathematics) November 20, 2006 Final Exam 2006 Division: ID#: Name: 1. p, q, r (Let p, q, r are propositions. ) (10pts) (a

Study on Application of the cos a Method to Neutron Stress Measurement Toshihiko SASAKI*3 and Yukio HIROSE Department of Materials Science and Enginee


オーストラリア研究紀要 36号(P)☆/3.橋本

nenmatsu5c19_web.key

(lm) lm AIC 2 / 1

Microsoft Word - 月報2014年1月号

IPSJ SIG Technical Report Vol.2010-CVIM-170 No /1/ Visual Recognition of Wire Harnesses for Automated Wiring Masaki Yoneda, 1 Ta

.. est table TwoSLS1 TwoSLS2 GMM het,b(%9.5f) se Variable TwoSLS1 TwoSLS2 GMM_het hi_empunion totchr

On the Detectability of Earthquakes and Crustal Movements in and around the Tohoku District (Northeastern Honshu) (I) Microearthquakes Hiroshi Ismi an

PackageSoft/R-033U.tex (2018/March) R:

25 II :30 16:00 (1),. Do not open this problem booklet until the start of the examination is announced. (2) 3.. Answer the following 3 proble

(interval estimation) 3 (confidence coefficient) µ σ/sqrt(n) 4 P ( (X - µ) / (σ sqrt N < a) = α a α X α µ a σ sqrt N X µ a σ sqrt N 2

(pdf) (cdf) Matlab χ ( ) F t

211 ‚æ2fiúŒÚ

Microsoft PowerPoint - SSII_harada pptx

s = 1.15 (s = 1.07), R = 0.786, R = 0.679, DW =.03 5 Y = 0.3 (0.095) (.708) X, R = 0.786, R = 0.679, s = 1.07, DW =.03, t û Y = 0.3 (3.163) + 0

2 1,2, , 2 ( ) (1) (2) (3) (4) Cameron and Trivedi(1998) , (1987) (1982) Agresti(2003)

elemmay09.pub

2

Pari-gp /7/5 1 Pari-gp 3 pq

2 値データの Intraclass Correlation Coefficient の推定マクロプログラム 稲葉洋介 1 田中紀子 1 1 国立国際医療研究センターデータサイエンス部生物統計研究室 Macro program for calculating Intraclass Correlati

JMP V4 による生存時間分析

(MIRU2008) HOG Histograms of Oriented Gradients (HOG)

NLMIXED プロシジャを用いた生存時間解析 伊藤要二アストラゼネカ株式会社臨床統計 プログラミング グループグルプ Survival analysis using PROC NLMIXED Yohji Itoh Clinical Statistics & Programming Group, A

3. ( 1 ) Linear Congruential Generator:LCG 6) (Mersenne Twister:MT ), L 1 ( 2 ) 4 4 G (i,j) < G > < G 2 > < G > 2 g (ij) i= L j= N

Transcription:

kubostat7f p statistaical models appeared in the class 7 (f) kubo@eeshokudaiacjp https://googl/z9cjy 7 : 7 : The development of linear models Hierarchical Baesian Model Be more flexible Generalized Linear Mixed Model (GLMM) ncoporating random effects such as individualit parameter estimation MCMC MLE Generalized Linear Model (GLM) Alwas normal distribution? That's non-sense! MSE Linear model Kubo Doctrine: Learn the evolution of linear-model famil, firstl! kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 GLM! overdispersion caused b individual differences 3 r i GLMM 7 (GLMM) : : http://googl/ufq kubostat7f (https://googl/z9cjy) 7 (f) 7 3 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 GLM! example : GLM! seed survivorship again, but?! GLM! (overdispersion)? (A) i N i = i = 3 x i {, 3,,, } alive seeds i (B) x i i 3 number of leaves x i kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3

kubostat7f p GLM! logistic regression as usual? N? GLM GLM doesn t work! GLM!! probabilit distribution binomial distribution : : β + β x i link function : logit number of alive seeds i 3 number of leaves x i number of alive seeds i underestimated β (A) β 3 number of leaves x i Not binomial! (B)! x i = i 3 i kubostat7f (https://googl/z9cjy) 7 (f) 7 7 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 overdispersion caused b individual differences overdispersion caused b individual differences (overdispersion)? overdispersion caused b individual differences unobservable differences? kubostat7f (https://googl/z9cjy) 7 (f) 7 9 / 3 (A) Not or less overdispersed (B) Overdispersed!! i i kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 overdispersion caused b individual differences overdispersion caused b individual differences GLM GLM does not take into account individual differences Almost all real data are overdispersed! kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3

kubostat7f p3 an improvement of logistic regression model 3 fixed effects random effects probabilit distribution binomial distribution : : β + β x i + r i link function : logit number of alive seeds i 3 number of leaves x i kubostat7f (https://googl/z9cjy) 7 (f) 7 3 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 i r i suppose {r i} follow the Gausssian distribution {r i } qi r i > r i = r i < 3 x i s = s = s = 3 r i ) p(r i s) = ( exp r i πs s p(r i s) r i r i r i kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 r i a numerical experiment using random numbers (A) (B) p(r i s) s = {r i} s = 3 - - - i r i q i = +exp( r i) - - - 9 99 p( i q i) i r i > # defining logistic function > logistic <- function(z) { / ( + exp(-z)) } > # random numbers following binomial distribution > rbinom(,, prob = logistic()) > # random numbers following Gausssian distribution > rnorm(, mu =, sd = ) > r <- rnorm(, mu =, sd = ) > # random numbers following? > rbinom(,, prob = logistic( + r)) kubostat7f (https://googl/z9cjy) 7 (f) 7 7 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3

kubostat7f p fixed effects random effects global parameter local parameter Mixed : β + β x i + r i fixed effects: β + β x i random effects: +r i fixed? random?? Mixed : β + β x i + r i fixed effects: β + β x i global parameter for all individuals s global parameter random effects: +r i local parameter onl for individual i kubostat7f (https://googl/z9cjy) 7 (f) 7 9 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 r i r i r i r i local parameters: {r, r,, r } r i saturation model > d <- readcsv("datacsv") > head(d) N x id 3 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3 r i r i r i binomial distribution i ( ) p( i β, β ) = q i i ( q i) i i Gaussian distribution r i p(r i s) = πs exp ( r i s i likelihood to remove r i r i L i = p( i β, β, r i ) p(r i s)dr i likedhood for all data β, β, s L(β, β, s) = i kubostat7f (https://googl/z9cjy) 7 (f) 7 3 / 3 L i ) global parameter local parameter Mixed : β + β x i + r i global parameter fixed effects: β, β : s local parameter random effects: {r, r,, r } kubostat7f (https://googl/z9cjy) 7 (f) 7 / 3

kubostat7f p 個体差 r ごとに異なる 二項分布 個体差 ri について積分する ということは 二項分布と正規分布をまぜ あわせること 集団内の r の分布 q = kubostat7f (https://googl/z9cjy) 統計モデリング入門 7 (f) 個体差 r ごとに異なる ポアソン分布 r = λ = r = 3 λ = r = λ = 7 r = 3 λ = kubostat7f (https://googl/z9cjy) 7 / 3 r 積分 r 集団全体をあらわす 混合された分布 r r p(r) = 9 - r 統計モデリング入門 7 (f) 7 / 3 > > > + installpackages("glmmml") # if ou don t have glmmml librar(glmmml) glmmml(cbind(, N - ) ~ x, data = d, famil = binomial, cluster = id) > d <- readcsv("datacsv") > head(d) N x id 3 3 p(r) = 7 - - p(r) = 3 - - Poisson and Gaussian distributions p(r) = 3 - - r glmmml package を使って GLMM の推定 ポアソン分布と正規分布のまぜあわせ - - 重み p(r s) p(r) = kubostat7f (https://googl/z9cjy) 集団内の r の分布 r - q = 93 ntegral of ri mixture distribution of the binomial and Gaussian distributions - 集団全体をあらわす 混合された分布 p(r) = 3 r = 積分 q = 73 r p(r) = 3 r = binomial and Gaussian distributions 二項分布と正規分布のまぜあわせ - q = 3 p(r) = r = 重み p(r s) r = 統計モデリング入門 7 (f) 7 7 / 3 kubostat7f (https://googl/z9cjy) 統計モデリング入門 7 (f) 7 / 3 prediction estimates GLMM の 推定値 : β, βˆ, s 推定された GLMM を使った 予測 (B) 葉数 x = での種子数分布 3 個体数 生存種子数 i (A) 葉数と生存種子数の関係 > glmmml(cbind(, N - ) ~ x, data = d, famil = binomial, + cluster = id) (snip) coef se(coef) z Pr(> z ) (ntercept) -3 9 - e- x 99 3e- 9 gaussian 39 Scale parameter in mixing distribution: Std Error: Residual deviance: on 97 degrees of freedom 統計モデリング入門 7 (f) 7 葉数 xi AC: 7 β = 3, βˆ = 99, s = 9 kubostat7f (https://googl/z9cjy) 3 9 / 3 kubostat7f (https://googl/z9cjy) 種子数 統計モデリング入門 7 (f) 7 3 / 3

kubostat7f p GLMM GLMM differences both in plants and pots + GLMM GLMM (A) (B) logitq i = β + β x i (GLM) q i: logitq i = β + β x i + r i (A) (B) kubostat7f (https://googl/z9cjy) 7 (f) 7 3 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 3 / 3 GLMM differences both in plants and pots + GLMM GLMM GLMM summar (C) (D) logitq i = β + β x i + r j logitq i = β + β x i + r i + r j random effects global parameter local parameter GLMM global parameter local parameter local parameter (eg + ) kubostat7f (https://googl/z9cjy) 7 (f) 7 33 / 3 kubostat7f (https://googl/z9cjy) 7 (f) 7 3 / 3 GLMM Ya! Be more flexible The next topic The development of linear models Hierarchical Baesian Model Generalized Linear Mixed Model (GLMM) ncoporating random effects such as individualit parameter estimation MCMC MLE Generalized Linear Model (GLM) Alwas normal distribution? That's non-sense! MSE Linear model Hierarchical Baesiam Model (HBM) kubostat7f (https://googl/z9cjy) 7 (f) 7 3 / 3