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

Size: px
Start display at page:

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

Transcription

1 藤 博幸

2 事後予測分布 パラメータの事後分布に従って モデルがどんなデータを期待するかを予測する 予測分布が観測されたデータと 致するかを確認することで モデルの適切さを確認できる 前回と同じ問題で事後予測を う

3 個 差を考えない場合 完全な個 差を考える場合 構造化された個 差を考える場合

4 ベイズ統計で実践モデリング 10.1 個 差を考えない場合 第 10 章記憶の保持

5 記憶の保持の指数的減衰モデル時間 t 経過した後にある項 を想起する確率 θ t = exp (-α t) +β α は記憶の減衰率 β は 常に い時間たっても残っているベースラインの想起レベル 4 の に対して 10 の時点 (1,2,4,7,12,21,35,59,99,200) において 18 項 についてテストした結果 α と β の推定

6 時点 実験参加者 ? ? ? 4??????????

7 α β t j θ j j 回 α ~ Beta(1,1) β ~ Beta(1,1) θ j <- min(1, exp(-αt)+β k ij ~ Binomial(θ j, n) k ij i 番 の n

8 Jags でのモデルの記述 Retention_1.txt # Retention With No Individual Differences model{ # Observed and Predicted Data for (i in 1:ns){ for (j in 1:nt){ k[i,j] ~ dbin(theta[i,j],n) predk[i,j] ~ dbin(theta[i,j],n) # Retention Rate At Each Lag For Each Subject Decays Exponentially for (i in 1:ns){ for (j in 1:nt){ theta[i,j] <- min(1,exp(-alpha*t[j])+beta) # Priors alpha ~ dbeta(1,1) beta ~ dbeta(1,1)

9 # clears workspace: rm(list=ls()) # sets working directories: setwd("c:/users/ej/dropbox/ej/temp/bayesbook/test/casestudies/memoryretention") library(r2jags) t <- c(1, 2, 4, 7, 12, 21, 35, 59, 99, 200) nt <- length(t) slist <- 1:4 ns <- length(slist) k <- matrix(c(18, 18, 16, 13, 9, 6, 4, 4, 4, NA, 17, 13, 9, 6, 4, 4, 4, 4, 4, NA, 14, 10, 6, 4, 4, 4, 4, 4, 4, NA, NA, NA, NA, NA,NA,NA,NA,NA,NA, NA), nrow=ns, ncol=nt, byrow=t) k n <- 18 data <- list("k", "n", "t", "ns", "nt") # to be passed on to JAGS

10 myinits <- list( list(alpha = 0.5, beta = 0.1)) # parameters to be monitored: parameters <- c("alpha", "beta", "predk") # The following command calls JAGS with specific options. # For a detailed description see the R2jags documentation. samples <- jags(data, inits=myinits, parameters, model.file ="Retention_1.txt", n.chains=1, n.iter=10000, n.burnin=1, n.thin=1, DIC=T) # Now the values for the monitored parameters are in the "samples" object, # ready for inspection. ##############Fancy ##Figure 10.2 plots################################################ alpha <- samples$bugsoutput$sims.array[,,1] beta <- samples$bugsoutput$sims.array[,,2] d.beta <- density(beta)

11 alpha <- samples$bugsoutput$sims.array[,,1] beta <- samples$bugsoutput$sims.array[,,2] d.beta <- density(beta) layout(matrix(c(1,2,3,0),2,2,byrow=t), width=c(2/3, 1/3), heights=c(2/3,1/3)) #layout.show() par(mar=c(2,2,1,0)) plot(alpha,beta, xlab="", ylab="", xlim=c(0,1),ylim=c(0,1),axes=f) box(lty=1) par(mar=c(2,2,1,4)) plot(d.beta$y, d.beta$x, ylim=range(c(0,1)), xlim=rev(range(d.beta$y)), type='l', axes=f, xlab="", ylab="") axis(4, at=c(0,1)) mtext(expression(beta), side=4,line=1, cex=1.3) box(lty=1) par(mar=c(6,2,0,0)) plot(density(alpha),zero.line=f, main="", ylab="", xlab="", cex.lab=1.3,xlim=c(0,1), axes=f) axis(1,at=c(0,1)) mtext(expression(alpha), side=1.2,line=1, cex=1.3) box(lty=1)

12 同時事後分布からわかること α と β には緩やかな関係性がある 2 つの周辺分布よりも多くの情報を持っている

13 layout(matrix(c(1:4),2,2,byrow=t)) #layout.show() sc <- 3.5 jj <- numeric() xx <- numeric() for (i in 1:ns) { plot(-1,100,xlim=c(0,10),ylim=c(0,18), main=(paste("subject", i)),xlab=("time Lags"), ylab=("retention Count"),cex.lab=1.3, axes=f) axis(1, at=c(1,2,3,4,5,6,7,8,9,10), lab=c("1","2","4","7","12","21","35","59","99","200"),cex.axis=0.7) axis(2, at=c(0,18),lab=c("0","18"),cex.axis=0.7) box(lty=1) for (j in 1:nt) { count <- hist(samples$bugsoutput$sims.list$predk[,i,j],c(0:n),plot=f) # count <- count$counts # count <- count/sum(count) for (x in 1:n) { if (count$density[x]>0) { points(j,x,pch=22, col="black",cex=sc*sqrt(count$density[x])) if (!is.na(k[i,j]) && k[i,j]==x) { points(j,x,pch=22,bg="black",cex=sc*sqrt(count$density[x])) jj <- c(jj,j) xx <- c(xx,x) coords <- list(x=jj, y=xx) lines(coords,lwd=2) jj <- numeric() xx <- numeric()

14 実験参加者の 1 と 3 は 事後予測と観測データの当てはまりが悪い 個 差なしというモデルは不適切

15 完全な個 差を考える場合 ベイズ統計で実践モデリング 10.2 完全な個 差を考える場合 第 10 章記憶の保持

16 α i β i t j θ ij i 番 の α i ~ Beta(1,1) β i ~ Beta(1,1) θ ij <- min(1, exp(-α i t)+β i k ij ~ Binomial(θ ij, n) k ij j 回 n

17 Jags でのモデルの記述 Retention_2.txt model{ for (i in 1:ns){ for (j in 1:nt){ k[i,j] ~ dbin(theta[i,j],n) predk[i,j] ~ dbin(theta[i,j],n) for (i in 1:ns){ for (j in 1:nt){ theta[i,j] <- min(1,exp(-alpha[i]*t[j])+beta[i]) for (i in 1:ns){ alpha[i] ~ dbeta(1,1) beta[i] ~ dbeta(1,1)

18 # clears workspace: rm(list=ls()) # sets working directories: setwd("c:/users/ej/dropbox/ej/temp/bayesbook/test/casestudies/memoryretention") library(r2jags) t <- c(1, 2, 4, 7, 12, 21, 35, 59, 99, 200) nt <- length(t) slist <- 1:4 ns <- length(slist) k <- matrix(c(18, 18, 16, 13, 9, 6, 4, 4, 4, NA, 17, 13, 9, 6, 4, 4, 4, 4, 4, NA, 14, 10, 6, 4, 4, 4, 4, 4, 4, NA, NA, NA, NA, NA,NA,NA,NA,NA,NA, NA), nrow=ns, ncol=nt, byrow=t) k n <- 18 data <- list("k", "n", "t", "ns", "nt") # to be passed on to JAGS myinits <- list( list(alpha = rep(0.5,ns), beta = rep(0.1,ns)))

19 # parameters to be monitored: parameters <- c("alpha", "beta", "predk") # The following command calls JAGS with specific options. # For a detailed description see the R2jags documentation. samples <- jags(data, inits=myinits, parameters, model.file ="Retention_2.txt", n.chains=1, n.iter=10000, n.burnin=1, n.thin=1, DIC=T) # Now the values for the monitored parameters are in the "samples" object, # ready for inspection. ##Figure 10.5 n.iter < keepi <- 500 keep <- sample(n.iter, keepi)

20 alpha1 <- samples$bugsoutput$sims.array[,,1] alpha2 <- samples$bugsoutput$sims.array[,,2] alpha3 <- samples$bugsoutput$sims.array[,,3] alpha4 <- samples$bugsoutput$sims.array[,,4] beta1 <- samples$bugsoutput$sims.array[,,5] beta2 <- samples$bugsoutput$sims.array[,,6] beta3 <- samples$bugsoutput$sims.array[,,7] beta4 <- samples$bugsoutput$sims.array[,,8] d.beta1 <- density(beta1) d.beta2 <- density(beta2) d.beta3 <- density(beta3) d.beta4 <- density(beta4) layout(matrix(c(1,2,3,0),2,2,byrow=t), width=c(2/3, 1/3), heights=c(2/3,1/3)) #layout.show()

21 plot(alpha1[keep],beta1[keep], xlab="", ylab="", xlim=c(0,1), ylim=c(0,1), axes=f) points(alpha2[keep],beta2[keep], col="red") points(alpha3[keep],beta3[keep], col="green") points(alpha4[keep],beta4[keep],col="blue") box(lty=1) par(mar=c(2,1,1,4)) plot(d.beta1$y, d.beta1$x, ylim=range(c(0,1)), xlim=c(12,0),type='l', axes=f, xlab="", ylab="") #plot(d.beta1$y, d.beta1$x, ylim=range(c(0,1)), xlim=rev(range(d.beta1$y)),type='l', axes=f, xlab="", ylab="") lines(d.beta2$y, d.beta2$x, col="red") lines(d.beta3$y, d.beta3$x, col="green") lines(d.beta4$y, d.beta4$x, col="blue") axis(4, at=c(0,1)) mtext(expression(beta), side=4,line=1, cex=1.3) box(lty=1) par(mar=c(6,2,0,0)) plot(density(alpha1),zero.line=f,main="", ylab="", xlab="", cex.lab=1.3,xlim=c(0,1), axes=f) lines(density(alpha2), col="red") lines(density(alpha3), col="green") lines(density(alpha4),col="blue") axis(1,at=c(0,1)) mtext(expression(alpha), side=1.2,line=1, cex=1.3) box(lty=1)

22 個 差を認めることで減衰パラメータ α は実験参加者によって別々の値をよることが された

23 layout(matrix(c(1:4),2,2,byrow=t)) #layout.show() sc <- 3.5 jj <- numeric() xx <- numeric() for (i in 1:ns) { plot(-1,100,xlim=c(0,10),ylim=c(0,18), main=(paste("subject", i)),xlab=("time Lags"), ylab=("retention Count"),cex.lab=1.3, ax axis(1, at=c(1,2,3,4,5,6,7,8,9,10), lab=c("1","2","4","7","12","21","35","59","99","200"),cex.axis=0.7) axis(2, at=c(0,18),lab=c("0","18"),cex.axis=0.7) box(lty=1) for (j in 1:nt) { j1 <- i+9 + (j-1)*4 count <- hist(samples$bugsoutput$sims.list$predk[,i,j],c(0:n),plot=f) # count <- count$counts # count <- count/sum(count) for (x in 1:n){ if (count$density[x]>0){ points(j,x,pch=22, col="black",cex=sc*sqrt(count$density[x])) if (!is.na(k[i,j]) && k[i,j]==x){ points(j,x,pch=22,bg="black",cex=sc*sqrt(count$density[x])) jj <- c(jj,j) xx <- c(xx,x) coords <- list(x=jj, y=xx) lines(coords,lwd=2) jj <- numeric() xx <- numeric()

24 実験参加者 1~3 については観測データと予測分布が対応し モデルの妥当性を している 実験参加者 4 については 利 できる情報は α と β の事前分布のみであることから 予測分布には役に つ情報は含まれていない

25 . 構造化された個 差を考える場合 ベイズ統計で実践モデリング 第 10 章記憶の保持 10.3 構造化された個 差を考える場合

26 μ α μ β λα t j α i θ ij k ij β i i 番 の j 回 λβ μ α ~Beta(1,1) λ α ~Gammma(.001,.001) μ β ~Beta(1,1) λ β ~Gammma(.001,.001) α i ~ Gaussian(μ α, λ α ) r(0,1) β i ~ Gaussian(μ β, λ β ) r(0,1) θ ij <- min(1, exp(-α i t)+β i k ij ~ Binomial(θ ij, n) n

27 Jagsでのモデルの記述 Retention_3.txt model{ for (i in 1:ns){ for (j in 1:nt){ k[i,j] ~ dbin(theta[i,j],n) predk[i,j] ~ dbin(theta[i,j],n) for (i in 1:ns){ for (j in 1:nt){ theta[i,j] <- min(1,exp(-alpha[i]*t[j])+beta[i]) for (i in 1:ns){ alpha[i] ~ dnorm(alphamu,alphalambda)i(0,1) beta[i] ~ dnorm(betamu,betalambda)i(0,1) alphamu ~ dbeta(1,1) alphalambda ~ dgamma(.001,.001)i(.001,) alphasigma <- 1/sqrt(alphalambda) betamu ~ dbeta(1,1) betalambda ~ dgamma(.001,.001)i(.001,) betasigma <- 1/sqrt(betalambda)

28 rm(list=ls()) # sets working directories: setwd("c:/users/ej/dropbox/ej/temp/bayesbook/test/casestudies/memoryretention") library(r2jags) t <- c(1, 2, 4, 7, 12, 21, 35, 59, 99, 200) nt <- length(t) slist <- 1:4 ns <- length(slist) k <- matrix(c(18, 18, 16, 13, 9, 6, 4, 4, 4, NA, 17, 13, 9, 6, 4, 4, 4, 4, 4, NA, 14, 10, 6, 4, 4, 4, 4, 4, 4, NA, NA, NA, NA, NA,NA,NA,NA,NA,NA, NA), nrow=ns, ncol=nt, byrow=t) k n <- 18 data <- list("k", "n", "t", "ns", "nt") # to be passed on to JAGS myinits <- list( list(alphamu = 0.5, alphalambda = 1, betamu = 0.5, betalambda = 1, alpha = rep(0.5,ns), beta = rep(0.1,ns # parameters to be monitored: parameters <- c("alpha", "beta", "predk") # The following command calls JAGS with specific options. # For a detailed description see the R2jags documentation. samples <- jags(data, inits=myinits, parameters, model.file ="Retention_3.txt", n.chains=1, n.iter=10000, n.burnin=1, n.thin=1, DIC=T)

29 n.iter < keepi <- 500 keep <- sample(n.iter, keepi) alpha1 <- samples$bugsoutput$sims.array[,,1] alpha2 <- samples$bugsoutput$sims.array[,,2] alpha3 <- samples$bugsoutput$sims.array[,,3] alpha4 <- samples$bugsoutput$sims.array[,,4] beta1 <- samples$bugsoutput$sims.array[,,5] beta2 <- samples$bugsoutput$sims.array[,,6] beta3 <- samples$bugsoutput$sims.array[,,7] beta4 <- samples$bugsoutput$sims.array[,,8] d.beta1 <- density(beta1) d.beta2 <- density(beta2) d.beta3 <- density(beta3) d.beta4 <- density(beta4) layout(matrix(c(1,2,3,0),2,2,byrow=t), width=c(2/3, 1/3), heights=c(2/3,1/3))

30 par(mar=c(2,2,1,0)) plot(alpha1[keep],beta1[keep], xlab="", ylab="", xlim=c(0,1), ylim=c(0,1), axes=f) points(alpha2[keep],beta2[keep], col="red") points(alpha3[keep],beta3[keep], col="green") points(alpha4[keep],beta4[keep],col="blue") box(lty=1) par(mar=c(2,1,1,4)) plot(d.beta1$y, d.beta1$x, ylim=range(c(0,1)), xlim=c(12,0),type='l', axes=f, xlab="", ylab="") #plot(d.beta1$y, d.beta1$x, ylim=range(c(0,1)), xlim=rev(range(d.beta1$y)),type='l', axes=f, xlab="", ylab="") lines(d.beta2$y, d.beta2$x, col="red") lines(d.beta3$y, d.beta3$x, col="green") lines(d.beta4$y, d.beta4$x, col="blue") axis(4, at=c(0,1)) mtext(expression(beta), side=4,line=1, cex=1.3) box(lty=1) par(mar=c(6,2,0,0)) plot(density(alpha1),zero.line=f,main="", ylab="", xlab="", cex.lab=1.3,xlim=c(0,1), axes=f) lines(density(alpha2), col="red") lines(density(alpha3), col="green") lines(density(alpha4),col="blue") axis(1,at=c(0,1)) mtext(expression(alpha), side=1.2,line=1, cex=1.3) box(lty=1)

31

32 layout(matrix(c(1:4),2,2,byrow=t)) #layout.show() sc <- 3.5 jj <- numeric() xx <- numeric() for (i in 1:ns) { plot(-1,100,xlim=c(0,10),ylim=c(0,18), main=(paste("subject", i)),xlab=("time Lags"), ylab=("retention Count"),cex.lab=1.3, axes=f) axis(1, at=c(1,2,3,4,5,6,7,8,9,10), lab=c("1","2","4","7","12","21","35","59","99","200"),cex.axis=0.7) axis(2, at=c(0,18),lab=c("0","18"),cex.axis=0.7) box(lty=1) for (j in 1:nt) { count <- hist(samples$bugsoutput$sims.list$predk[,i,j],c(0:n),plot=f) # count <- count$counts # count <- count/sum(count) for (x in 1:n){ if (count$density[x]>0){ points(j,x,pch=22, col="black",cex=sc*sqrt(count$density[x])) if (!is.na(k[i,j]) && k[i,j]==x){ points(j,x,pch=22,bg="black",cex=sc*sqrt(count$density[x])) jj <- c(jj,j) xx <- c(xx,x) coords <- list(x=jj, y=xx) lines(coords,lwd=2) jj <- numeric() xx <- numeric()

33 階層モデルによってグループ全体の構造を記述するガウス分布を指定 これによってある実験参加者から学んだことの影響が他の実験参加者に影響を与える 実験参加者 4 についてもパラメータの範囲を絞り込めている

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

バイオインフォマティクス特論4 藤 博幸 1-3-1. ピアソン相関係数 1-3-2. 致性のカッパ係数 1-3-3. 時系列データにおける変化検出 ベイズ統計で実践モデリング 5.1 ピアソン係数 第 5 章データ解析の例 データは n ペアの独 な観測値の対例 : 特定の薬剤の投与量と投与から t 時間後の注 する遺伝 の発現量 2 つの変数間の線形の関係性はピアソンの積率相関係数 r で表現される t 時間後の注 する遺伝

More information

研修コーナー

研修コーナー l l l l l l l l l l l α α β l µ l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l

More information

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

12/1 ( ) GLM, R MCMC, WinBUGS 12/2 ( ) WinBUGS WinBUGS 12/2 ( ) : 12/3 ( ) :? ( :51 ) 2/ 71 2010-12-02 (2010 12 02 10 :51 ) 1/ 71 GCOE 2010-12-02 WinBUGS kubo@ees.hokudai.ac.jp http://goo.gl/bukrb 12/1 ( ) GLM, R MCMC, WinBUGS 12/2 ( ) WinBUGS WinBUGS 12/2 ( ) : 12/3 ( ) :? 2010-12-02 (2010 12

More information

1 R Windows R 1.1 R The R project web R web Download [CRAN] CRAN Mirrors Japan Download and Install R [Windows 9

1 R Windows R 1.1 R The R project web   R web Download [CRAN] CRAN Mirrors Japan Download and Install R [Windows 9 1 R 2007 8 19 1 Windows R 1.1 R The R project web http://www.r-project.org/ R web Download [CRAN] CRAN Mirrors Japan Download and Install R [Windows 95 and later ] [base] 2.5.1 R - 2.5.1 for Windows R

More information

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

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 kubo2015ngt6 p.1 2015 (6 MCMC kubo@ees.hokudai.ac.jp, @KuboBook http://goo.gl/m8hsbm 1 ( 2 3 4 5 JAGS : 2015 05 18 16:48 kubo (http://goo.gl/m8hsbm 2015 (6 1 / 70 kubo (http://goo.gl/m8hsbm 2015 (6 2 /

More information

「統 計 数 学 3」

「統 計 数 学 3」 関数の使い方 1 関数と引数 関数の構造 関数名 ( 引数 1, 引数 2, 引数 3, ) 例 : マハラノビス距離を求める関数 mahalanobis(data,m,v) 引数名を指定して記述する場合 mahalanobis(x=data, center=m, cov=v) 2 関数についてのヘルプ 基本的な関数のヘルプの呼び出し? 関数名 例 :?mean 例 :?mahalanobis 指定できる引数を確認する関数

More information

DAA02

DAA02 c(var1,var2,...,varn) > x x [1] 1 2 3 4 > x2 x2 [1] 1 2 3 4 5 6 7 8 c(var1,var2,...,varn) > y=c('a0','a1','b0','b1') > y [1] "a0" "a1" "b0" "b1 > z=c(x,y) > z [1] "1" "2"

More information

DAA04

DAA04 # plot(x,y, ) plot(dat$shoesize, dat$h, main="relationship b/w shoesize and height, xlab = 'shoesize, ylab='height, pch=19, col='red ) Relationship b/w shoesize and height height 150 160 170 180 21 22

More information

DAA03

DAA03 par(mfrow=c(1,2)) # figure Dist. of Height for Female Participants Dist. of Height for Male Participants Density 0.00 0.02 0.04 0.06 0.08 Density 0.00 0.02 0.04 0.06 0.08 140 150 160 170 180 190 Height

More information

1 911 9001030 9:00 A B C D E F G H I J K L M 1A0900 1B0900 1C0900 1D0900 1E0900 1F0900 1G0900 1H0900 1I0900 1J0900 1K0900 1L0900 1M0900 9:15 1A0915 1B0915 1C0915 1D0915 1E0915 1F0915 1G0915 1H0915 1I0915

More information

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

kubostat7f p GLM! logistic regression as usual? N? GLM GLM doesn t work! GLM!! probabilit distribution binomial distribution : : β + β x i link functi 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

More information

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

講義のーと :  データ解析のための統計モデリング. 第2回 Title 講義のーと : データ解析のための統計モデリング Author(s) 久保, 拓弥 Issue Date 2008 Doc URL http://hdl.handle.net/2115/49477 Type learningobject Note この講義資料は, 著者のホームページ http://hosho.ees.hokudai.ac.jp/~kub ードできます Note(URL)http://hosho.ees.hokudai.ac.jp/~kubo/ce/EesLecture20

More information

Microsoft PowerPoint - bayes-juku_2015_03010(public).pptx

Microsoft PowerPoint - bayes-juku_2015_03010(public).pptx 1 第 2 回ベイズ推定 WS Stan によるベイズ推定の可能性と課題 2015 年 03 月 04 日 ベイズ塾実践篇 STAN の魅力 使い方階層ベイズ その他ベイズ統計いろいろ 専修大学 岡田謙介 2 塾生 さんらよりいただいたお題 1 他の MCMC 実行ソフトウェアにない STAN の特徴 (STAN のここがウリ!! という点 ) 2STAN でいくつかの代表的な統計モデルを推定する際の実例や注意点

More information

Stanによるハミルトニアンモンテカルロ法を用いたサンプリングについて

Stanによるハミルトニアンモンテカルロ法を用いたサンプリングについて Stan によるハミルトニアンモンテカルロ法を用いたサンプリングについて 10 月 22 日中村文士 1 目次 1.STANについて 2.RでSTANをするためのインストール 3.STANのコード記述方法 4.STANによるサンプリングの例 2 1.STAN について ハミルトニアンモンテカルロ法に基づいた事後分布からのサンプリングなどができる STAN の HP: mc-stan.org 3 由来

More information

6 2 2 x y x y t P P = P t P = I P P P ( ) ( ) ,, ( ) ( ) cos θ sin θ cos θ sin θ, sin θ cos θ sin θ cos θ y x θ x θ P

6 2 2 x y x y t P P = P t P = I P P P ( ) ( ) ,, ( ) ( ) cos θ sin θ cos θ sin θ, sin θ cos θ sin θ cos θ y x θ x θ P 6 x x 6.1 t P P = P t P = I P P P 1 0 1 0,, 0 1 0 1 cos θ sin θ cos θ sin θ, sin θ cos θ sin θ cos θ x θ x θ P x P x, P ) = t P x)p ) = t x t P P ) = t x = x, ) 6.1) x = Figure 6.1 Px = x, P=, θ = θ P

More information

nakata/nakata.html p.1/20

nakata/nakata.html p.1/20 http://www.me.titech.ac.jp/ nakata/nakata.html p.1/20 1-(a). Faybusovich(1997) Linear systems in Jordan algebras and primal-dual interior-point algorithms,, Euclid Jordan p.2/20 Euclid Jordan V Euclid

More information

https://sites.google.com/site/prj311/ 2011-03- 11 14:46:18 ##### Ruby ##### h = Hash.new(0) while line = gets() if line =~ /^.*?\x01(.*?)\x01/ h[$1] += 1 end end h.sort_by { k,v - v }.each { k,v print

More information

: : : : ) ) 1. d ij f i e i x i v j m a ij m f ij n x i =

: : : : ) ) 1. d ij f i e i x i v j m a ij m f ij n x i = 1 1980 1) 1 2 3 19721960 1965 2) 1999 1 69 1980 1972: 55 1999: 179 2041999: 210 211 1999: 211 3 2003 1987 92 97 3) 1960 1965 1970 1985 1990 1995 4) 1. d ij f i e i x i v j m a ij m f ij n x i = n d ij

More information

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

一般化線形 (混合) モデル (2) - ロジスティック回帰と GLMM .. ( ) (2) GLMM kubo@ees.hokudai.ac.jp I http://goo.gl/rrhzey 2013 08 27 : 2013 08 27 08:29 kubostat2013ou2 (http://goo.gl/rrhzey) ( ) (2) 2013 08 27 1 / 74 I.1 N k.2 binomial distribution logit link function.3.4!

More information

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

,, 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 Armitage.? SAS.2 µ, µ 2, µ 3 a, a 2, a 3 a µ + a 2 µ 2 + a 3 µ 3 µ, µ 2, µ 3 µ, µ 2, µ 3 log a, a 2, a 3 a µ + a 2 µ 2 + a 3 µ 3 µ, µ 2, µ 3 * 2 2. y t y y y Poisson y * ,, Poisson 3 3. t t y,, y n Nµ,

More information

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

RとExcelを用いた分布推定の実践例 R Excel 1 2 1 2 2011/11/09 ( IMI) R Excel 2011/11/09 1 / 12 (1) R Excel (2) ( IMI) R Excel 2011/11/09 2 / 12 R Excel R R > library(fitdistrplus) > x fitdist(x,"norm","mle")

More information

A A = a 41 a 42 a 43 a 44 A (7) 1 (3) A = M 12 = = a 41 (8) a 41 a 43 a 44 (3) n n A, B a i AB = A B ii aa

A A = a 41 a 42 a 43 a 44 A (7) 1 (3) A = M 12 = = a 41 (8) a 41 a 43 a 44 (3) n n A, B a i AB = A B ii aa 1 2 21 2 2 [ ] a 11 a 12 A = a 21 a 22 (1) A = a 11 a 22 a 12 a 21 (2) 3 3 n n A A = n ( 1) i+j a ij M ij i =1 n (3) j=1 M ij A i j (n 1) (n 1) 2-1 3 3 A A = a 11 a 12 a 13 a 21 a 22 a 23 a 31 a 32 a 33

More information

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

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 kubostat1g p.1 1 (g Hierarchical Bayesian Model kubo@ees.hokudai.ac.jp http://goo.gl/7ci The development of linear models Hierarchical Bayesian Model Be more flexible Generalized Linear Mixed Model (GLMM

More information

一般演題(ポスター)

一般演題(ポスター) 6 5 13 : 00 14 : 00 A μ 13 : 00 14 : 00 A β β β 13 : 00 14 : 00 A 13 : 00 14 : 00 A 13 : 00 14 : 00 A β 13 : 00 14 : 00 A β 13 : 00 14 : 00 A 13 : 00 14 : 00 A β 13 : 00 14 : 00 A 13 : 00 14 : 00 A

More information

2016 年熊本地震の余震の確率予測 Probability aftershock forecasting of the M6.5 and M7.3 Kumamoto earthquakes of 2016 東京大学生産技術研究所統計数理研究所東京大学地震研究所 Institute of Indus

2016 年熊本地震の余震の確率予測 Probability aftershock forecasting of the M6.5 and M7.3 Kumamoto earthquakes of 2016 東京大学生産技術研究所統計数理研究所東京大学地震研究所 Institute of Indus 2016 年熊本地震の余震の確率予測 Probability aftershock forecasting of the M6.5 and M7.3 Kumamoto earthquakes of 2016 東京大学生産技術研究所統計数理研究所東京大学地震研究所 Institute of Industrial Science, University of Tokyo The Institute of

More information

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

kubostat2017c p (c) Poisson regression, a generalized linear model (GLM) : : kubostat2017c p.1 2017 (c), a generalized linear model (GLM) : kubo@ees.hokudai.ac.jp http://goo.gl/76c4i 2017 11 14 : 2017 11 07 15:43 kubostat2017c (http://goo.gl/76c4i) 2017 (c) 2017 11 14 1 / 47 agenda

More information

‚åŁÎ“·„´Šš‡ðŠp‡¢‡½‹âfi`fiI…A…‰…S…−…Y…•‡ÌMarkovŸA“½fiI›ð’Í

‚åŁÎ“·„´Šš‡ðŠp‡¢‡½‹âfi`fiI…A…‰…S…−…Y…•‡ÌMarkovŸA“½fiI›ð’Í Markov 2009 10 2 Markov 2009 10 2 1 / 25 1 (GA) 2 GA 3 4 Markov 2009 10 2 2 / 25 (GA) (GA) L ( 1) I := {0, 1} L f : I (0, ) M( 2) S := I M GA (GA) f (i) i I Markov 2009 10 2 3 / 25 (GA) ρ(i, j), i, j I

More information

ii 3.,. 4. F. (), ,,. 8.,. 1. (75%) (25%) =7 20, =7 21 (. ). 1.,, (). 3.,. 1. ().,.,.,.,.,. () (12 )., (), 0. 2., 1., 0,.

ii 3.,. 4. F. (), ,,. 8.,. 1. (75%) (25%) =7 20, =7 21 (. ). 1.,, (). 3.,. 1. ().,.,.,.,.,. () (12 )., (), 0. 2., 1., 0,. 24(2012) (1 C106) 4 11 (2 C206) 4 12 http://www.math.is.tohoku.ac.jp/~obata,.,,,.. 1. 2. 3. 4. 5. 6. 7.,,. 1., 2007 (). 2. P. G. Hoel, 1995. 3... 1... 2.,,. ii 3.,. 4. F. (),.. 5... 6.. 7.,,. 8.,. 1. (75%)

More information

P1-1 P1-2 P1-3 P1-4 P1-5 P1-6 P3-1 P3-2 P3-3 P3-4 P3-5 P3-6 P5-1 P5-2 P5-3 P5-4 P5-5 P5-6 P7-1 P7-2 P7-3 P7-4 P7-5 P7-6 P9-1 P9-2 P9-3 P9-4 P9-5 P9-6 P11-1 P11-2 P11-3 P11-4 P13-1 P13-2 P13-3 P13-4 P13-5

More information

2 H23 BioS (i) data d1; input group patno t sex censor; cards;

2 H23 BioS (i) data d1; input group patno t sex censor; cards; H BioS (i) data d1; input group patno t sex censor; cards; 0 1 0 0 0 0 1 0 1 1 0 4 4 0 1 0 5 5 1 1 0 6 5 1 1 0 7 10 1 0 0 8 15 0 1 0 9 15 0 1 0 10 4 1 0 0 11 4 1 0 1 1 5 1 0 1 1 7 0 1 1 14 8 1 0 1 15 8

More information

2009 5 1...1 2...3 2.1...3 2.2...3 3...10 3.1...10 3.1.1...10 3.1.2... 11 3.2...14 3.2.1...14 3.2.2...16 3.3...18 3.4...19 3.4.1...19 3.4.2...20 3.4.3...21 4...24 4.1...24 4.2...24 4.3 WinBUGS...25 4.4...28

More information

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

kubostat2015e p.2 how to specify Poisson regression model, a GLM GLM how to specify model, a GLM GLM logistic probability distribution Poisson distrib kubostat2015e p.1 I 2015 (e) GLM kubo@ees.hokudai.ac.jp http://goo.gl/76c4i 2015 07 22 2015 07 21 16:26 kubostat2015e (http://goo.gl/76c4i) 2015 (e) 2015 07 22 1 / 42 1 N k 2 binomial distribution logit

More information

1 913 10301200 A B C D E F G H J K L M 1A1030 10 : 45 1A1045 11 : 00 1A1100 11 : 15 1A1115 11 : 30 1A1130 11 : 45 1A1145 12 : 00 1B1030 1B1045 1C1030

1 913 10301200 A B C D E F G H J K L M 1A1030 10 : 45 1A1045 11 : 00 1A1100 11 : 15 1A1115 11 : 30 1A1130 11 : 45 1A1145 12 : 00 1B1030 1B1045 1C1030 1 913 9001030 A B C D E F G H J K L M 9:00 1A0900 9:15 1A0915 9:30 1A0930 9:45 1A0945 10 : 00 1A1000 10 : 15 1B0900 1B0915 1B0930 1B0945 1B1000 1C0900 1C0915 1D0915 1C0930 1C0945 1C1000 1D0930 1D0945 1D1000

More information

3/4/8:9 { } { } β β β α β α β β

3/4/8:9 { } { } β β β α β α β β α β : α β β α β α, [ ] [ ] V, [ ] α α β [ ] β 3/4/8:9 3/4/8:9 { } { } β β β α β α β β [] β [] β β β β α ( ( ( ( ( ( [ ] [ ] [ β ] [ α β β ] [ α ( β β ] [ α] [ ( β β ] [] α [ β β ] ( / α α [ β β ] [ ] 3

More information

1

1 PalmGauss SC PGSC-5G Instruction Manual PalmGauss SC PGSC-5G Version 1.01 PalmGauss SC PGSC5G 1.... 3 2.... 3 3.... 3 3.1... 3 3.2... 3 3.3 PalmGauss... 4 3.4... 4 3.4.1 (Fig. 4)... 4 3.4.2 (Fig. 5)...

More information

P-12 P-13 3 4 28 16 00 17 30 P-14 P-15 P-16 4 14 29 17 00 18 30 P-17 P-18 P-19 P-20 P-21 P-22

P-12 P-13 3 4 28 16 00 17 30 P-14 P-15 P-16 4 14 29 17 00 18 30 P-17 P-18 P-19 P-20 P-21 P-22 1 14 28 16 00 17 30 P-1 P-2 P-3 P-4 P-5 2 24 29 17 00 18 30 P-6 P-7 P-8 P-9 P-10 P-11 P-12 P-13 3 4 28 16 00 17 30 P-14 P-15 P-16 4 14 29 17 00 18 30 P-17 P-18 P-19 P-20 P-21 P-22 5 24 28 16 00 17 30 P-23

More information

1 kawaguchi p.1/81

1 kawaguchi p.1/81 1 kawaguchi atsushi@kurume-u.ac.jp 2005 7 2 p.1/81 2.1 2.2 2.2.3 2.3 AUC 4.4 p.2/81 X Z X = α + βz + e α : Z = 0 X ( ) β : Z X ( ) e : 0 σ 2 p.3/81 2.1 Z X 1 0.045 2 0.114 4 0.215 6 0.346 7 0.41 8 0.52

More information

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

k2 ( :35 ) ( k2) (GLM) web   web   1 : 2012 11 01 k2 (2012-10-26 16:35 ) 1 6 2 (2012 11 01 k2) (GLM) kubo@ees.hokudai.ac.jp web http://goo.gl/wijx2 web http://goo.gl/ufq2 1 : 2 2 4 3 7 4 9 5 : 11 5.1................... 13 6 14 6.1......................

More information

original: 2011/11/5 revised: 2012/10/30, 2013/12/ : 2 V i V t2 V o V L V H V i V i V t1 V o V H V L V t1 V t2 1 Q 1 1 Q

original: 2011/11/5 revised: 2012/10/30, 2013/12/ : 2 V i V t2 V o V L V H V i V i V t1 V o V H V L V t1 V t2 1 Q 1 1 Q original: 2011/11/5 revised: 2012/10/30, 2013/12/2 1 1 1: 2 V i V t2 V o V L V H V i V i V t1 V o V H V L V t1 V t2 1 Q 1 1 Q 2 2 1 2 1 c 2013 2 2: V i Q 1 I C1 V C1 V B2 I E V E V E Q 1 Q 1 Q 2 Q 2 Q

More information

O x y z O ( O ) O (O ) 3 x y z O O x v t = t = 0 ( 1 ) O t = 0 c t r = ct P (x, y, z) r 2 = x 2 + y 2 + z 2 (t, x, y, z) (ct) 2 x 2 y 2 z 2 = 0

O x y z O ( O ) O (O ) 3 x y z O O x v t = t = 0 ( 1 ) O t = 0 c t r = ct P (x, y, z) r 2 = x 2 + y 2 + z 2 (t, x, y, z) (ct) 2 x 2 y 2 z 2 = 0 9 O y O ( O ) O (O ) 3 y O O v t = t = 0 ( ) O t = 0 t r = t P (, y, ) r = + y + (t,, y, ) (t) y = 0 () ( )O O t (t ) y = 0 () (t) y = (t ) y = 0 (3) O O v O O v O O O y y O O v P(, y,, t) t (, y,, t )

More information

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

講義のーと :  データ解析のための統計モデリング. 第3回 Title 講義のーと : データ解析のための統計モデリング Author(s) 久保, 拓弥 Issue Date 2008 Doc URL http://hdl.handle.net/2115/49477 Type learningobject Note この講義資料は, 著者のホームページ http://hosho.ees.hokudai.ac.jp/~kub ードできます Note(URL)http://hosho.ees.hokudai.ac.jp/~kubo/ce/EesLecture20

More information

N cos s s cos ψ e e e e 3 3 e e 3 e 3 e

N cos s s cos ψ e e e e 3 3 e e 3 e 3 e 3 3 5 5 5 3 3 7 5 33 5 33 9 5 8 > e > f U f U u u > u ue u e u ue u ue u e u e u u e u u e u N cos s s cos ψ e e e e 3 3 e e 3 e 3 e 3 > A A > A E A f A A f A [ ] f A A e > > A e[ ] > f A E A < < f ; >

More information

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

kubostat2017e p.1 I 2017 (e) GLM logistic regression : : :02 1 N y count data or kubostat207e p. I 207 (e) GLM kubo@ees.hokudai.ac.jp https://goo.gl/z9ycjy 207 4 207 6:02 N y 2 binomial distribution logit link function 3 4! offset kubostat207e (https://goo.gl/z9ycjy) 207 (e) 207 4

More information

直交座標系の回転

直交座標系の回転 b T.Koama x l x, Lx i ij j j xi i i i, x L T L L, L ± x L T xax axx, ( a a ) i, j ij i j ij ji λ λ + λ + + λ i i i x L T T T x ( L) L T xax T ( T L T ) A( L) T ( LAL T ) T ( L AL) λ ii L AL Λ λi i axx

More information

3-2 -

3-2 - 1 2-1 - 3-2 - 4 3-3 - Specific Absorption Rate 5 1 2 1 1-4 - - 5 - - 6 - - 7 - - 8 - - 9 - - 10 - - 11 - - 12 - 5-13 - / / / / / / / / / / - 14 - - 15 - - 16 - - 17 - - 18 - 2 2-19 - 3-20 - - 21 - 1 1

More information

Use R

Use R Use R! 2008/05/23( ) Index Introduction (GLM) ( ) R. Introduction R,, PLS,,, etc. 2. Correlation coefficient (Pearson s product moment correlation) r = Sxy Sxx Syy :, Sxy, Sxx= X, Syy Y 1.96 95% R cor(x,

More information

第86回日本感染症学会総会学術集会後抄録(I)

第86回日本感染症学会総会学術集会後抄録(I) κ κ κ κ κ κ μ μ β β β γ α α β β γ α β α α α γ α β β γ μ β β μ μ α ββ β β β β β β β β β β β β β β β β β β γ β μ μ μ μμ μ μ μ μ β β μ μ μ μ μ μ μ μ μ μ μ μ μ μ β

More information

スライド 1

スライド 1 205 年 4 月 28 日 @ 統計モデリング 統計モデリング 第三回配布資料 文献 : A. J. Dobso ad A. G. Barett: A Itroducto to Geeralzed Lear Models. 3rd ed., CRC Press. J. J. Faraway: Etedg the Lear Model wth R. CRC Press. 配布資料の PDF は以下からも

More information

untitled

untitled . x2.0 0.5 0 0.5.0 x 2 t= 0: : x α ij β j O x2 u I = α x j ij i i= 0 y j = + exp( u ) j v J = β y j= 0 j j o = + exp( v ) 0 0 e x p e x p J j I j ij i i o x β α = = = + +.. 2 3 8 x 75 58 28 36 x2 3 3 4

More information

ii 3.,. 4. F. (), ,,. 8.,. 1. (75% ) (25% ) =9 7, =9 8 (. ). 1.,, (). 3.,. 1. ( ).,.,.,.,.,. ( ) (1 2 )., ( ), 0. 2., 1., 0,.

ii 3.,. 4. F. (), ,,. 8.,. 1. (75% ) (25% ) =9 7, =9 8 (. ). 1.,, (). 3.,. 1. ( ).,.,.,.,.,. ( ) (1 2 )., ( ), 0. 2., 1., 0,. 23(2011) (1 C104) 5 11 (2 C206) 5 12 http://www.math.is.tohoku.ac.jp/~obata,.,,,.. 1. 2. 3. 4. 5. 6. 7.,,. 1., 2007 ( ). 2. P. G. Hoel, 1995. 3... 1... 2.,,. ii 3.,. 4. F. (),.. 5.. 6.. 7.,,. 8.,. 1. (75%

More information

24 201170068 1 4 2 6 2.1....................... 6 2.1.1................... 6 2.1.2................... 7 2.1.3................... 8 2.2..................... 8 2.3................. 9 2.3.1........... 12

More information

ii 2. F. ( ), ,,. 5. G., L., D. ( ) ( ), 2005.,. 6.,,. 7.,. 8. ( ), , (20 ). 1. (75% ) (25% ). 60.,. 2. =8 5, =8 4 (. 1.) 1.,,

ii 2. F. ( ), ,,. 5. G., L., D. ( ) ( ), 2005.,. 6.,,. 7.,. 8. ( ), , (20 ). 1. (75% ) (25% ). 60.,. 2. =8 5, =8 4 (. 1.) 1.,, (1 C205) 4 8 27(2015) http://www.math.is.tohoku.ac.jp/~obata,.,,,..,,. 1. 2. 3. 4. 5. 6. 7.... 1., 2014... 2. P. G., 1995.,. 3.,. 4.. 5., 1996... 1., 2007,. ii 2. F. ( ),.. 3... 4.,,. 5. G., L., D. ( )

More information

2 / 39

2 / 39 W707 s-taiji@is.titech.ac.jp 1 / 39 2 / 39 1 2 3 3 / 39 q f (x; α) = α j B j (x). j=1 min α R n+2 n ( d (Y i f (X i ; α)) 2 2 ) 2 f (x; α) + λ dx 2 dx. i=1 f B j 4 / 39 : q f (x) = α j B j (x). j=1 : x

More information

(lm) lm AIC 2 / 1

(lm) lm AIC 2 / 1 W707 s-taiji@is.titech.ac.jp 1 / 1 (lm) lm AIC 2 / 1 : y = β 1 x 1 + β 2 x 2 + + β d x d + β d+1 + ϵ (ϵ N(0, σ 2 )) y R: x R d : β i (i = 1,..., d):, β d+1 : ( ) (d = 1) y = β 1 x 1 + β 2 + ϵ (d > 1) y

More information

スライド 1

スライド 1 担当 : 田中冬彦 016 年 4 月 19 日 @ 統計モデリング 統計モデリング 第二回配布資料 文献 : A. J. Dobson and A. G. Barnett: An Introduction to Generalized Linear Models 3rd ed., CRC Press. 配布資料の PDF は以下からも DL できます. 短縮 URL http://tinyurl.com/lxb7kb8

More information

2014ESJ.key

2014ESJ.key http://www001.upp.so-net.ne.jp/ito-hi/stat/2014esj/ Statistical Software for State Space Models Commandeur et al. (2011) Journal of Statistical Software 41(1) State Space Models in R Petris & Petrone (2011)

More information