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