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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Rによる計量分析:データ解析と可視化 - 第3回 Rの基礎とデータ操作・管理

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

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

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

こんにちは由美子です

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

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

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

(2/24) : 1. R R R

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó

分布

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

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

¥¤¥ó¥¿¡¼¥Í¥Ã¥È·×¬¤È¥Ç¡¼¥¿²òÀÏ Âè2²ó

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

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

Introduction Purpose This training course demonstrates the use of the High-performance Embedded Workshop (HEW), a key tool for developing software for

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

A Nutritional Study of Anemia in Pregnancy Hematologic Characteristics in Pregnancy (Part 1) Keizo Shiraki, Fumiko Hisaoka Department of Nutrition, Sc

1 15 R Part : website:

dvi

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 (


RとExcelを用いた分布推定の実践例

Studies of Foot Form for Footwear Design (Part 9) : Characteristics of the Foot Form of Young and Elder Women Based on their Sizes of Ball Joint Girth


こんにちは由美子です

第13回:交差項を含む回帰・弾力性の推定

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

最小2乗法

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

浜松医科大学紀要

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

chisq.test corresp plot

% 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

dvi

untitled

2

JMP V4 による生存時間分析

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

こんにちは由美子です

RTM RTM Risk terrain terrain RTM RTM 48

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)

Microsoft Word - 計量研修テキスト_第5版).doc

10

Use R

IPSJ SIG Technical Report Pitman-Yor 1 1 Pitman-Yor n-gram A proposal of the melody generation method using hierarchical pitman-yor language model Aki

Vol. 36, Special Issue, S 3 S 18 (2015) PK Phase I Introduction to Pharmacokinetic Analysis Focus on Phase I Study 1 2 Kazuro Ikawa 1 and Jun Tanaka 2

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

201711grade2.pdf

2014ESJ.key

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

Kobe University Repository : Kernel タイトル Title 著者 Author(s) 掲載誌 巻号 ページ Citation 刊行日 Issue date 資源タイプ Resource Type 版区分 Resource Version 権利 Rights DOI

Table 1. Assumed performance of a water electrol ysis plant. Fig. 1. Structure of a proposed power generation system utilizing waste heat from factori

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

IPSJ SIG Technical Report Vol.2014-EIP-63 No /2/21 1,a) Wi-Fi Probe Request MAC MAC Probe Request MAC A dynamic ads control based on tra


02[ ]小山・池田(責)岩.indd


<4D F736F F D20D2E5E7E8F1FB E3EEE45FE8F1EFF0>

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

tokei01.dvi



Microsoft Word - 計量研修テキスト_第5版).doc

I L01( Wed) : Time-stamp: Wed 07:38 JST hig e, ( ) L01 I(2017) 1 / 19

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

スケーリング理論とはなにか? - --尺度を変えて見えること--

R John Fox R R R Console library(rcmdr) Rcmdr R GUI Windows R R SDI *1 R Console R 1 2 Windows XP Windows * 2 R R Console R ˆ R


Visual Evaluation of Polka-dot Patterns Yoojin LEE and Nobuko NARUSE * Granduate School of Bunka Women's University, and * Faculty of Fashion Science,

スライド 1

集中理論談話会 #9 Bhat, C.R., Sidharthan, R.: A simulation evaluation of the maximum approximate composite marginal likelihood (MACML) estimator for mixed mu

28


ヒト血漿中オキシステロールの高感度分析法

untitled


Microsoft Word - StatsDirectMA Web ver. 2.0.doc

Transcription:

kubostat2017b p.1 agenda I 2017 (b) probabilit distribution and maimum likelihood estimation kubo@ees.hokudai.ac.jp http://goo.gl/76c4i 2017 11 14 : 2017 11 07 15:43 1 : 2 3? 4 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 1 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 2 / 42 statistaical models appeared in the class The development of linear models Hierarchical Baesian Model Be more fleible Generalized Linear Mied Model (GLMM) Incoporating 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! kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 3 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 4 / 42 suppose that ou have a count data set... 0, 1, 2 the normal distribution... is NOT this one!? ( {0, 1, 2, 3, } ) response variable e.g. egg number () e.g. bod size () eplanator variable? kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 5 / 42 response variable? 0? NO! eplanator variable kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 6 / 42

kubostat2017b p.2 the Poisson disribution approimates data?! response variable eplanator variable fair distribution non-negative mean YES! Plot our data and observe it Choose proper distributons! the normal distributon is NOT good at everthing be-be, the normal distribution kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 7 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 8 / 42 : 2 : : 2012 05 18 http://goo.gl/ufq2 2. : R kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 9 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 10 / 42 : a simplified data set, eas to understand number of seeds taken from 50 imaginar plants : number of seeds per plant individual () individual i i 50 i {1, 2, 3,, 50} seed number of i i { i }! { i } = { 1, 2,, 50 } : { i } R > data [1] 2 2 4 6 4 5 2 3 1 2 0 4 3 3 3 3 4 2 7 2 4 3 3 3 4 [26] 3 7 5 3 1 7 6 4 6 5 2 4 7 2 2 6 2 4 5 4 5 1 3 2 3 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 11 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 12 / 42

kubostat2017b p.3 : : R: a free statistical software : R http://www.r-project.org/ RStudio OS free software S RStudio http://www.rstudio.com/ kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 13 / 42 http://www.rstudio.com/ kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 14 / 42 : appl table() to categorize data R : start with data plotting, alwas table() > table(data) 0 1 2 3 4 5 6 7 1 3 11 12 10 5 4 4 ( 5 5 6 4 ) > hist(data, breaks = seq(-0.5, 9.5, 1))! kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 15 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 16 / 42 : How to evaluate mean value using R? : statistics to represent dispersion > mean(data) [1] 3.56 > abline(v = mean(data))! kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 17 / 42 : > var(data) [1] 2.9861 sample standard deviation > sd(data) [1] 1.7280 > sqrt(var(data)) [1] 1.7280 sample variance (SD = variance) : : kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 18 / 42

kubostat2017b p.4 Empirical VS Theoretical Distributions 3. kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 19 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 20 / 42 empirical distribution > data.table <- table(factor(data, levels = 0:10)) > cbind( = data.table, prob = data.table / 50) prob 0 1 0.02 1 3 0.06 2 11 0.22 3 12 0.24 4 10 0.20 5 5 0.10 6 4 0.08 7 4 0.08 8 0 0.00 9 0 0.00 10 0 0.00 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 21 / 42? = {0, 1, 2, }? {p 0, p 1, p 2,, p 99, p 100, }? kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 22 / 42? Mathematical epression of the Poisson distribution () ()! probabilit p( λ) = λ ep( λ)! factorial 4! 1 2 3 4 ep( λ) = e λ (e = 2.718 ) kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 23 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 24 / 42

kubostat2017b p.5 the Poisson distribution? R (λ) 3.56 Poisson distribution > <- 0:9 # () > prob <- dpois(, lambda = 3.56) # > plot(, prob, tpe = "b", lt = 2) > # cbind > cbind(, prob) prob 1 0 0.02843882 2 1 0.10124222 3 2 0.18021114 4 3 0.21385056 5 4 0.19032700 6 5 0.13551282 7 6 0.08040427 8 7 0.04089132 9 8 0.01819664 10 9 0.00719778 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 25 / 42 the Poisson distribution represent data? > hist(data, seq(-0.5, 8.5, 0.5)) # > lines(, prob, tpe = "b", lt = 2) # kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 26 / 42 parameter λ is the mean of the Poisson distribution λ The Poisson distribution is useful if...? λ λ λ 0 : λ = = > # cbind > cbind(, prob) prob 1 0 0.02843882 2 1 0.10124222 3 2 0.18021114 4 3 0.21385056 5 4 0.19032700 6 5 0.13551282 7 6 0.08040427 8 7 0.04089132 9 8 0.01819664 10 9 0.00719778 {0, 1, 2,, } 1 p( λ) = 1 =0 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 27 / 42 : i {0, 1, 2, } count data i mean variance kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 28 / 42 λ changes the shape of distribution λ? p( λ) = λ ep( λ)! mean λ kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 29 / 42 4.!? fitting = parameter estimation kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 30 / 42

kubostat2017b p.6 (likelihood)??? likelihood L(λ) depends on the value of mean, λ L(λ) λ maimum likelihood estimation λ goodness of fit λ 3 { 1, 2, 3 } = {2, 2, 4} 0.180 0.180 0.19 = 0.006156 (the likelihood definition for the eample): L(λ) = ( 1 2 ) ( 2 2 ) ( 50 3 ) = p( 1 λ) p( 2 λ) p( 3 λ) p( 50 λ) = p( i λ) = λ i ep( λ), i i i! kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 31 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 32 / 42? evaluate not likelihood, but log likelihood!? λ changes the log likelihood, i.e., goodness of fit λ () (!) (log likelihood function) log L(λ) = i ( ) i i log λ λ log k k log L(λ) L(λ) λ kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 33 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 34 / 42 seek the maimum likelihood estimate, ˆλ ˆλ? log L(λ) = ( i i log λ λ i k log k) log likelihood -120-110 -100 * ˆλ = 3.56 2.0 2.5 3.0 3.5 4.0 4.5 5.0 (ML estimator): i i/50 d log L dλ (ML estimate): ˆλ = 3.56 = 0!? no one knows the true λ based on finite size data λ λ 3.5 0 100 300 2.5 3.0 3.5 4.0 4.5 ˆλ 50 3000 ˆλ λ 50 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 35 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 36 / 42

kubostat2017b p.7 : random number generation estimation 5. λ = 3.5 ˆλ = 3.56 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 37 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 38 / 42 prediction probabilit distributions appeared in the class λ = 3.5 ˆλ = 3.56 : ( : {0, 1, 2, 3, } : {0, 1, 2,, N} N : < < kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 39 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 40 / 42 GLMM 線形モデルの発展 推定計算方法階層ベイズモデル (HBM) MCMC もっと自由な統計モデリングを! 一般化線形混合モデル (GLMM) 最尤推定法個体差 場所差といった変量効果をあつかいたい一般化線形モデル (GLM) 正規分布以外の確率分布をあつかいたい 最小二乗法線形モデル The net topic YES! : Poisson Regression, a Generalized Linear Model (GLM) kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 41 / 42 kubostat2017b (http://goo.gl/76c4i) 2017 (b) 2017 11 14 42 / 42