Presentation is loading. Please wait.

Presentation is loading. Please wait.

量的表現 Quantitation.

Similar presentations


Presentation on theme: "量的表現 Quantitation."— Presentation transcript:

1 量的表現 Quantitation

2 分布 Distribution 1峰性分布

3 2峰性分布

4 2次元分布

5 有限範囲の2次元分布

6 パターン認識… Pattern recognition…
2次元 Two-dimension なぜ? Why?

7

8 分布 Distribution 1峰性分布

9 1次元分布 1-dimensional dist. 1峰性分布 Unimodal dist.
平均・分散 Mean/Variance モーメント Moments モーメントの計算 How to calculate moments 値、値の増加率、増加率の増加率 Value, Increasing rate, Increasing rate of increasing rate 微分・積分 Diffenrential/Integration 確率分布・累積確率分布 Probability distribution/Cumulative probability distribution R2-1.R

10 1峰性分布を作る Make unimodal distribution
x<-rnorm(N) hist(x) plot(sort(x)) x<-rnorm(N,mean=1,sd=1)

11 2峰性分布

12 1次元2峰性分布 Two-dimensional di-modal dist.
N1<-100;N2<-50 m1<-0;m2<-10;sd1<-1;sd2<-2 x1<-rnorm(N1,mean=m1,sd=sd1) x2<-rnorm(N2,mean=m2,sd=sd2) x<-c(x1,x2) hist(x) plot(sort(x))

13 平均を変えてみる Change means 分散を変えてみる Change vars(sds)

14 1次元多峰性分布 Two-dimensional polymodal dist.
5峰性分布をつくってみる Make 5-modal dist 峰の数を変えてみる Change number of peaks

15 2次元1峰性分布 Two-dimensional unimodal dist.
x1<-rnorm(N) x2<-rnorm(N) plot(x1,x2)

16 2次元1峰性分布 Two-dimensional unimodal dist.
軸ごとに平均をかえてみる Change mean of x1 and x2 軸ごとに分散をかえてみる Change var/sd of x1 and x2 N<-1000 x1<-rnorm(N,mean=0,sd=1) x2<-rnorm(N,mean=10,sd=4) xlim<-ylim<-c(min(x1,x2),max(x1,x2)) plot(x1,x2,xlim=xlim,ylim=ylim)

17 多次元1峰性分布 Poly-dimensional unimodal dist.
m1<-0;m2<-10;m3<-30; sd1<-1;sd2<-4;sd3<-10 x1<-rnorm(N,mean=m1,sd=sd1) x2<-rnorm(N,mean=m2,sd=sd2) x3<-rnorm(N,mean=m3,sd=sd3) plot(as.data.frame(cbind(x1,x2,x3))) library(rgl) plot3d(x1,x2,x3) 軸の値に注意 Note values on axes displayed

18 多次元多峰性分布 Poly-dimensional polymodal dist.
m1<-0;m2<-10;m3<-30; sd1<-1;sd2<-4;sd3<-10 x1<-rnorm(N,mean=m1,sd=sd1) x2<-rnorm(N,mean=m2,sd=sd2) x3<-rnorm(N,mean=m3,sd=sd3) N<-2000 m1<-20;m2<-20;m3<-20; sd1<-1;sd2<-1;sd3<-1 y1<-rnorm(N,mean=m1,sd=sd1) y2<-rnorm(N,mean=m2,sd=sd2) y3<-rnorm(N,mean=m3,sd=sd3) N<-500 m1<-10;m2<-50;m3<-20; sd1<-5;sd2<-4;sd3<-1 z1<-rnorm(N,mean=m1,sd=sd1) z2<-rnorm(N,mean=m2,sd=sd2) z3<-rnorm(N,mean=m3,sd=sd3) w1<-c(x1,y1,z1) w2<-c(x2,y2,z2) w3<-c(x3,y3,z3) www<-cbind(w1,w2,w3) plot(as.data.frame(www)) library(rgl) plot3d(w1,w2,w3)

19 データプロットを眺める最適視点を探す Find “best” spot to look at the data plot

20 亜集団の混合 Mixture of subpopulations
R7-5.R

21 #偏った集団構成(100人規模の亜集団4つと10人規模の亜集団を20個)で
#100項目のデータを作成 Nm<-100 #項目数 # 亜集団別の人数発生(100人くらいの4亜集団と20人くらいの10亜集団) Ns<-c(rpois(4,100),rpois(20,10)) Npop<-length(Ns) #亜集団数 M<-NULL #全データを納める行列 #亜集団別に平均を振ってシミュレーション for(j in 1:Npop){ tmpM<-matrix(rep(0,Nm*Ns[j]),ncol=Nm) for(i in 1:Nm){ # 項目ごとのループ af<-rnorm(1) # 項目の亜群期待値 tmpM[,i]<-rnorm(Ns[j],af) # 亜集団別のデータ } #全データ行列に格納 M<-rbind(M,tmpM) R7-5.R # データを標準化 wholemean<-mean(M) M<-M-wholemean # 全平均が0になるように mu<-apply(M,2,mean) # 列平均 M<-t(t(M)-mu) # 列平均が0になるように

22 # 固有値分解前後をimage()プロット
image(1:sum(Ns),1:Nm,M,xlab="サンプル(大集団→小集団)",ylab="項目") # 固有値分解 svdout<-svd(M) M2<-svdout$u%*%diag(svdout$d) # 分解後データ行列 par(mfcol=c(1,2)) # 固有値分解前後をimage()プロット image(1:sum(Ns),1:Nm,M,xlab="サンプル(大集団→小集団)",ylab="項目") image(1:sum(Ns),1:Nm,M2,xlab="サンプル(大集団→小集団)", ylab="PCA後eigen項目")

23 亜集団の混合 Mixture of subpopulations
R7-5.R

24 適切な軸 Appropriate axes

25 データを読む “Read” data 記述する・説明する Description, Explanation
少ない変数で説明する Describe with a few variables 残りは「ランダム」と考える The rest is “at random”

26 R7-2.R

27

28 SSw=SSb+SSi

29 分散分析 ANOVA SSw=SSb+SSi
When SSb is larger, “difference among groups is larger” サンプル数が異なるとき When No. samples is different サンプル数について一般化 Generalization for No. samples 自由度 degrees of freedom

30 分散の分解 Decomposition of variance into pieces
R7-5.R

31 適切な軸 Appropriate axes

32 固有値分解・主成分分析 Eigenvalue decomposition・Principal Component Analysis (PCA)
R7-5.R 正規直交基底 Orthonormal base どうして「直交」 Why orthogonal? 分散が基底成分の分散に分解できるから Because variance is decomposed into component variances of directions


Download ppt "量的表現 Quantitation."

Similar presentations


Ads by Google