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

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

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

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

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

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

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

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

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

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

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 (

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

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

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

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

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

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

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

Microsoft PowerPoint - GLMMexample_ver pptx

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.

1 15 R Part : website:

Chapter 1 Epidemiological Terminology

P

Use R

open / window / I / shall / the? something / want / drink / I / to the way / you / tell / the library / would / to / me

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


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


目次 1. レッスンで使える表現 レッスンでお困りの際に使えるフレーズからレッスンの中でよく使われるフレーズまで 便利な表現をご紹介させていただきます ご活用方法として 講師に伝えたいことが伝わらない場合に下記の通りご利用ください 1 該当の表現を直接講師に伝える 2 該当の英語表現を Skype

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


L1 What Can You Blood Type Tell Us? Part 1 Can you guess/ my blood type? Well,/ you re very serious person/ so/ I think/ your blood type is A. Wow!/ G


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

P

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

スライド 1

66-1 田中健吾・松浦紗織.pwd

スライド 1

高等学校 英語科

山形大学紀要

07_伊藤由香_様.indd

(2/24) : 1. R R R

201711grade2.pdf

紀要1444_大扉&目次_初.indd

Read the following text messages. Study the names carefully. 次のメッセージを読みましょう 名前をしっかり覚えましょう Dear Jenny, Iʼm Kim Garcia. Iʼm your new classmate. These ar

3

Introduction Purpose This course explains how to use Mapview, a utility program for the Highperformance Embedded Workshop (HEW) development environmen

Dirichlet process mixture Dirichlet process mixture 2 /40 MIRU2008 :

Level 3 Japanese (90570) 2011

みっちりGLM

最小2乗法



Microsoft Word - PrivateAccess_UM.docx

Microsoft Word - j201drills27.doc

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

駒田朋子.indd

,, 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


<4D F736F F D20939D8C7689F090CD985F93C18EEA8D758B E646F63>

なぜ今 GLMM なのか 竹澤正哲 北海道大学 日本社会心理学会第 2 回春の方法論セミナー

2009 No

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

L3 Japanese (90570) 2008


2 / 39

dvi

1986 NHK NTT NTT CONTENTS SNS School of Information and Communi

Microsoft Word - j201drills27.doc

untitled

STEP 02 Memo: Self-Introduction Self-Introduction About your family About your school life (your classes, club/juku, and so on.) Questions to your Pen

Stepwise Chow Test * Chow Test Chow Test Stepwise Chow Test Stepwise Chow Test Stepwise Chow Test Riddell Riddell first step second step sub-step Step

スライド 1

English Locomotion 参加して学ぶ総合英語 JACET 教材開発研究会編著

elemmay09.pub

こんにちは由美子です

(3) 検定統計量の有意確率にもとづく仮説の採否データから有意確率 (significant probability, p 値 ) を求め 有意水準と照合する 有意確率とは データの分析によって得られた統計値が偶然おこる確率のこと あらかじめ設定した有意確率より低い場合は 帰無仮説を棄却して対立仮説

- - Warm Up

<95DB8C9288E397C389C88A E696E6462>

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

;y ;y ;; yy ;y;; yy y;y;y;y ;y; ;; yy ; y Portable CD player Operating Instructions RQT5364-S

Transcription:

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

The main language of this class is Japanese Sorry Why in Japanese? because even in Japanese, statistics is difficult for Japanese students to understand. I will compensate for language disadvantages in foreign students when I give grades. Questions in English are always welcomed! 2/56

Performance Rating E-mail assignment (via Mailing List) That's ALL! Attendance? NOT care. 3/56

この統計モデリング授業の Mailing List (ML) kubostat ML を使って各回の 課題 を出します 回答もメイルで送信してください Send your assignment via the class ML 成績評価は 課題 の回答 出欠関係なし (欠席の連絡いりません) 単位とらない人も ML 登録してください 講義資料のダウンロード案内などあります 4/56

統計モデリング授業の web page http://goo.gl/76c4i mailing list http://goo.gl/f0vcn8 5/56

What for Statistical Modeling? なぜデータ解析の方法を 勉強しなければ ならないのか?

All you depend on statistics whenever you conclude something based on your data データ解析がおかしいと結論もおかしい Crazy data analsys Crazy results 統計解析わからんと批判的に読めない A lack of statistical knowledge no critical reading of papers 7/56

データ解析はあまり重視されてなかった 内容がわからなくてもソフトウェアにまるなげ ブラックボックス統計解析 No Blackbox statistics! とにかく ゆーい差 さえ出せばよいという 発想になっている Don't blindly believe Significance! 8/56

この授業のねらい (aim) できるだけ内容を理解して統計ソフトウェアを使おう! Understand how to fit statistical models to your data データにあてはめられる統計 モデルを作ろう Use the statistical software R to show your data structure 9/56

教科書とソフトウェア

この授業は 統計モデリング入門 にそった内容を説明します 著者: 久保拓弥 出版社: 岩波書店 2012-05-18 刊行 価格 3990 円 my text book (in Japanese) http://goo.gl/ufq2 割引販売 3000 円!! 11/56

Statistical software for this course 統計ソフトウェア R 統計学の勉強には良い統計ソフトウェアが必要! 無料で入手できる 内容が完全に公開されている 多くの研究者が使っている 作図機能が強力 追記メモ RStudio の紹介 この教科書でも R を 使って問題を解決する 方法を説明しています 12/56

統計モデルとは何か? What? statistical modeling?

統計モデル とは何か? どんな統計解析においても 統計モデルが使用されている 観察によってデータ化された現象を説 明するために作られる 確率分布が基本的な部品であり これ はデータにみられるばらつきを表現す る手段である データとモデルを対応づける手つづき が準備されていて モデルがデータに どれぐらい良くあてはまっているかを 定量的に評価できる 14/56

統計モデリング入門 の主張 何でも正規分布 じゃないだろ! 15/56

GLM and extended GLMs! a better statistica model for better data analysis! The Evolution of Linear Models Hierarchical Bayesian Model (HBM) Parameter Estimation MCMC Generalized Linear Mixed Model (GLMM) MLE Generalized Linear Model (GLM) MSE Linear Model 16/56

たとえばこんなデータがあったしましょう An example number of seeds 種子数 体サイズ plant body size 17/56

一般化線形モデル - ばらつきをよく見る Don't use the normal distribution 正規分布 without seeing data! ポアソン分布 0 個 1 個 2 個と数えられる種子数が 正規分布 なわけないだろ!! 18/56

全体の流れ (1/3) 第 1 回: 6/18 (月) 観測されたパターンを説明する統計モデル Introduction 第 2 回: 6/18 (月) 確率分布と最尤推定 Probability Distributions and Maximum Likelihood Estimation (MLE) 第 3 回: 6/25 (水) 一般化線形モデル: ポアソン回帰 Generalized Linear Model (GLM): Poisson Regression

全体の流れ (2/3) 第 4 回: 6/25 (月) モデル選択と検定 Model Selection and Statistical Test 第 5 回: 7/02 (水) 一般化線形モデル: ロジスティック回帰 GLM: Logistic Regression 第 6 回: 7/02 (月) 階層ベイズモデル 1 Hierarchical Bayesian Models (HBM) 1

全体の流れ (3/3) 第 7 回: 7/09 (月) 繰り返し測定の階層ベイズモデル Bayesian models for repeated measures 第 8 回: 7/09 (月) 時間変化データのベイズ統計モデル Bayesian models for Time series data next: Kohyama-san s Lecture Plant Ecolgy

6/18 Overview Statistical Modeling 2018 (b) Probability distributions and maximum likelihood estimation さまざまな確率分布と最尤推定

単純化した例題 Simplified examples to learn statistical modeling 23/56

カウントデータはポアソン分布を 使って説明できないかを調べる Find some appropriate probability distributions to fit the observed distributions 24/56

さいゆう 最尤推定という考えかたを説明します How to fit the distribution to the observation? Maximum likelihood estimation! 25/56

6/25 Overview Statistical Modeling 2018 (c) Poisson regression and generalized linear model ポアソン回帰と GLM

ここで登場する -- 何でも正規分布 ではダメ! という発想 正規分布 ポアソン分布 the normal distirbution is NOT normal 27/56

Free の統計 ソフトウェア R で統計モデリング 28/56

6/25 Overview Statistical Modeling 2018 (d) Model Selection and Statistical Test モデル選択と統計学的検定

statistical model selection Q. モデル選択とは何か 30/56

model selection for better predictions A. より良い予測をする統計モデルを探すこと こっちだ! 検定は モデル選択じゃない! 31/56

統計学って 検定 のこと? 検定 って何なの? fallacy of statistical significance? 32/56

7/2 Overview Statistical Modeling 2018 (e) Logistic regression, a generalized linear model ロジスティック回帰

mesurement / mesurement? sounds bad! 生物学のデータ解析は 割算 しまくり!! 34/56

Use logistic regressions! GLM のひとつ ロジスティック回帰を使おう 35/56

GLM のひとつ ロジスティック回帰を使おう a statistical model for fractions using binomial distributions 36/56

7/2 Overview Statistical Modeling 2018 (f) Hierarchical Bayesian model and MCMC sampling 階層ベイズモデルと MCMC

GLM ではうまく説明できないデータ!? GLM does NOT work?! 第 6 回と同じような例題を こんどはベイズモデルを使ってモデリングします 38/56

A solution: Hierarchical Bayesian GLM GLM を階層ベイズモデル化して対処 39/56

なぜ階層ベイズモデルまで勉強するの? 生態学! The Evolution of Linear Models 個体差 エリア差 空間相関 Hierarchical Bayesian Model (HBM) 時間相関 種差などめんどうな Parameter Estimation MCMC Generalized Linear Mixed Model ことをあつかわないといけない (GLMM) MLE Generalized Linear Model (GLM) MSE What for hierarchical Bayesian Linear Model modeling? --- to detect interesting effects embedded in noisy & dirty data in the field of Ecology! 40/56

第 7, 8 回は 時間変化 するデータ の統計モデリング (階層ベイズモデルの応用) Modeling of time-series data as an application of hierarchical Bayesian modeling!

7/9 Overview Statistical Modeling 2018 (g) Modeling time change data (short term) 短い時系列データの統計モデル

A Time series model for single step data 短い時系列データ 時系列の長短に関係なく 対応のある データ点か どうかが本質的な問題

再測定もまた時系列データ 架空 データ 岩波データ サイエンス vol.1 44/56

対応 (paired) を考えてない GLM あてはめ これはまちがい! ゆーい差 あり となる glm(身長 (測定2回目) + (測定2回目):(処理の効 果)) 同じ対象を二回測定していることを考慮してない 45/56

対応 (paired) を考えてない GLM あてはめ ゆーい に なりやすい これはまちがい! ゆーい差 あり となる glm(身長 (測定2回目) + (測定2回目):(処理の効 果)) 同じ対象を二回測定していることを考慮してない 46/56

対応 (paired) を考慮し さらに県の差もあるモデル 給食効果な 47/56

7/9 Overview Statistical Modeling 2018 (h) Modeling time series data (long term) 長い時系列データの統計モデル

7/27 (水)

時間相関のある時系列データに y time series data and autocorrelation glm(y ~ t) と モデルを あてはめてみた t 50/56

やったーゆーいだ!!?? A fake significance > summary(glm(formula = y ~ t)) Deviance Residuals: Min 1Q Median -2.1295-1.0583-0.0817 3Q 0.9860 Max 2.0188 Coefficients: Estimate Std. Error t value Pr(> t ) (Intercept) -414.5655 71.4761-5.80 6.6e-06 t 0.2339 0.0357 6.55 1.1e-06 これはまちがい glm(時系列y ~ 時間 t) 統計モデルがおかしい? 51/56

時系列の ずれ temporal GLM のずれ independent noises autocorrelation 直線からのずれがちがう! 時間的自己相関がある 時間的自己相関がない 52/56

統計モデルづくりの要点 時系列データの解析は 階層ベイズモデル化した 状態空間モデルを使うのが便利 Latent state model is a better model to know the characteristics of time-series data

変数 Y Y1 Y1 Y1 Random walk もっとも単純な モデル 正規分布 Y2 Y2 Y3 t 時間 54/56

状態空間モデル + 観測モデル Latent state variables + observation model 55/56

今日はここまで any questions?