2 CHAPTER 2. ) ( ) 2 () () 2.1.1 10 Octave rand() octave:27> A=rand(10,1) A = 0.225704 0.018580 0.818762 0.634118 0.026280 0.980303 0.014780 0.477392



Similar documents
I [ ] N(µ, σ 2 ) σ 2 (X 1,..., X n ) X := 1 n (X X n ): µ X N(µ, σ 2 /n) Z = X µ σ/ n N(, 1) < α < 1/2 Φ(z) =.5 α z α

(Frequecy Tabulatios)

統計学のポイント整理

xy n n n- n n n n n xn n n nn n O n n n n n n n n

統計的仮説検定とExcelによるt検定




3 3.1 * *2 2

日本内科学会雑誌第102巻第10号

untitled

4 4. A p X A 1 X X A 1 A 4.3 X p X p X S(X) = E ((X p) ) X = X E(X) = E(X) p p 4.3p < p < 1 X X p f(i) = P (X = i) = p(1 p) i 1, i = 1,, r + r


α = 2 2 α 2 = ( 2) 2 = 2 x = α, y = 2 x, y X 0, X 1.X 2,... x 0 X 0, x 1 X 1, x 2 X 2.. Zorn A, B A B A B A B A B B A A B N 2

分布

1 1 ( ) ( % mm % A B A B A 1

untitled

Lecture on

REALV5_A4…p_Ł\1_4A_OCF

untitled

「都市から地方への人材誘致・移住促進に関する調査」

<91498EE88CA D815B2E786C73>

〔 大 会 役 員 〕

橡本体資料+参考条文.PDF


Chapter n m A 1, A 2,...A n (A k = [a 1 k, a2 k,..., am k ]) n n m m m 2 3 Z 2 Z = w 1 X 1 + w 2 X 2 (5.1) 1


卒論 提出用ファイル.doc

2 1 Introduction

日本内科学会雑誌第101巻第12号

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

30

tokei01.dvi

2 1 Octave Octave Window M m.m Octave Window 1.2 octave:1> a = 1 a = 1 octave:2> b = 1.23 b = octave:3> c = 3; ; % octave:4> x = pi x =

untitled

..3. Ω, Ω F, P Ω, F, P ). ) F a) A, A,..., A i,... F A i F. b) A F A c F c) Ω F. ) A F A P A),. a) 0 P A) b) P Ω) c) [ ] A, A,..., A i,... F i j A i A

aisatu.pdf

Sigma

Sigma

(1) (2) (1) (2) 2 3 {a n } a 2 + a 4 + a a n S n S n = n = S n

36

Netcommunity SYSTEM αNXⅡ typeS/typeM 取扱説明書

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

Ł\”ƒ-2005

( 28 ) ( ) ( ) 0 This note is c 2016, 2017 by Setsuo Taniguchi. It may be used for personal or classroom purposes, but not for commercial purp

Part. 4. () 4.. () Part ,

チュートリアル:ノンパラメトリックベイズ

応用数学III-4.ppt

( )/2 hara/lectures/lectures-j.html 2, {H} {T } S = {H, T } {(H, H), (H, T )} {(H, T ), (T, T )} {(H, H), (T, T )} {1

(1) + b = b +, (2) b = b, (3) + 0 =, (4) 1 =, (5) ( + b) + c = + (b + c), (6) ( b) c = (b c), (7) (b + c) = b + c, (8) ( + b)c = c + bc (9

calibT1.dvi

日本内科学会雑誌第98巻第3号

…K…E…X„^…x…C…W…A…fi…l…b…g…‘†[…N‡Ì“‚¢−w‘K‡Ì‹ê™v’«‡É‡Â‡¢‡Ä


II

f (x) f (x) f (x) f (x) f (x) 2 f (x) f (x) f (x) f (x) 2 n f (x) n f (n) (x) dn f f (x) dx n dn dx n D n f (x) n C n C f (x) x = a 1 f (x) x = a x >

A B P (A B) = P (A)P (B) (3) A B A B P (B A) A B A B P (A B) = P (B A)P (A) (4) P (B A) = P (A B) P (A) (5) P (A B) P (B A) P (A B) A B P


1_sugata

MacOSX印刷ガイド

Œ{Ł¶/1flà

9 chapter

荳也阜轣ス螳ウ蝣ア蜻・indd

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

WE7281_help

白山の自然誌21 白山の禅定道





A B C E ( ) F

平成16年度 市政年報

Micro-D 小型高密度角型コネクタ

untitled


untitled

ACCESS入門編

FX ) 2

FX自己アフリエイトマニュアル

4 4 4 a b c d a b A c d A a da ad bce O E O n A n O ad bc a d n A n O 5 {a n } S n a k n a n + k S n a a n+ S n n S n n log x x {xy } x, y x + y 7 fx



Taro13-第6章(まとめ).PDF


1 (1) vs. (2) (2) (a)(c) (a) (b) (c) 31 2 (a) (b) (c) LENCHAR

example2_time.eps


PackageSoft/R-033U.tex (2018/March) R:




土壌環境行政の最新動向(環境省 水・大気環境局土壌環境課)

syuryoku


資料4-1 一時預かり事業について

1

確率論と統計学の資料

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

CD-TAB718B_usermanual_ref

, 1 ( f n (x))dx d dx ( f n (x)) 1 f n (x)dx d dx f n(x) lim f n (x) = [, 1] x f n (x) = n x x 1 f n (x) = x f n (x) = x 1 x n n f n(x) = [, 1] f n (x

Transcription:

Chapter 2 2.1 (cf. ) (= ) 76, 86, 77, 88, 78, 83, 86, 77, 74, 79, 82, 79, 80, 81, 78, 78, 73, 78, 81, 86, 71, 80, 81, 88, 82, 80, 80, 70, 77, 81 10? () ( 1

2 CHAPTER 2. ) ( ) 2 () () 2.1.1 10 Octave rand() octave:27> A=rand(10,1) A = 0.225704 0.018580 0.818762 0.634118 0.026280 0.980303 0.014780 0.477392 0.636399 0.382046 rand() (0,1)

2.1. 3 octave:29> B=ceil(rand(10,1)*10) B = 8 2 9 7 3 8 3 5 9 2 ceil() octave:30> hist(b) ( ) n hist(rand(n,1)) n (hist(rand(100,1) ) n n

4 CHAPTER 2. 2.1.2 A = (a 1, a 2,...a n ) µ µ = (1/n) n a i (2.1) Octave mean() Octave:> mean(a) i=1 10 n n 10,100,1000,,,, 1 80 : 40.5 15 5 200 1 : 45.8 2.1.3 2 2

2.1. 5 2 A = [10, 11, 10, 11, 10, 10, 11, 9, 11, 9, 11, 9, 9, 9, 11, 11, 12, 11, 11, 10] B = [4, 6, 5, 5, 6, 6, 6, 4, 5, 5, 18, 17, 17, 16, 16, 16, 15, 15, 13, 11] Octave A mean(a) A B A = (a 1, a 2,...a n ) σ 2 µ σ 2 = 1 n n (a i µ) 2 (2.2) i=1 σ 2 = 1 n = 1 n = 1 n = 1 n n (a i µ) 2 i=1 n (a 2 i 2a i µ + µ 2 ) i=1 n (a 2 i ) 1 n n 2µ a i + 1 n n µ2 i=1 i=1 n (a 2 i ) µ 2 (2.3) i=1 2 Octave var() A,B A B 2.1.4 +1-1

6 CHAPTER 2. ( ) n n () Octave 1 sum(round(rand(100,1))*2-1) 10 100 : #dist1.m n=10000; A=zeros(n,1); for(i=1:n) A(i,1)=sum(round(rand(100,1))*2-1); endfor mean(a) var(a) dist1.m Octave:> source("dist1.m"); n hist(a) round() round(rand()) 0.5 0 1 [0,n-1] round(rand()*n) ceil(), floor() ceil(rand(n,1)*6) (n ) n? ( ) ( n )

2.1. 7 2.3.7 2.1.5 : 4 1 4 1/4 3/4 (1 1 4 ) (1 3 ) = 3 4 1 3 = 1 4 1/4 + 1/4 2 1 (1 ( 1 4 + 1 4 )) 1 2 = 1 2 1 2 = 1 4 1/4 + 1/4 + 1/4 (1 ( 1 4 + 1 4 + 1 4 )) = 1 4 /and /or 1

8 CHAPTER 2. 2.2 3 2 1. 1000 ( 100 ) (100 200 300 ) 2. 1 6 100 3. ()??( : )

2.3. 9 2.3 2.3.1 Octave hist() ( histogram) Octave hist() ( () ) (=) randn() Octave ; (Octave ) A= randn(50,1); hist(a) hist(a,100) B1= randn(10000,1)+2.4; B2= randn(10000,1); B=[B1;B2]; hist(b) hist(b,100) hist(b) 10 hist(b,1000) 100

10 CHAPTER 2. 2.3.2 rand() (0,1) Octave rand() 100 1000 10000 2.3.3 4 1/6 f(x) ( ) f(x) x f(x)dx (2.4) 1 x [a, b] b a f(x)dx (2.5) x x

2.3. 11 [0,1] 0.3 x < 0.4 f(x) = 0.1 2.3.4 E(X) V (X) µ, σ 2 µ = E(X) = σ 2 = V (X) = xf(x)dx (2.6) (x µ) 2 f(x)dx (2.7) σ = V (X) 2.13 σ 2 = = (x µ) 2 f(x)dx x 2 f(x)dx 2µ xf(x)dx + µ 2 f(x)dx = E(X 2 ) 2µE(X) + µ 2 = E(X 2 ) E(X) 2 (2.8) µ = E(X) f(x)dx = 1 X X X = 1, 2, 3, 4, 5, 6 f(x) = 1/6 X E(X) E(X) = 6 k f(k) k=1 = ( 1 6 1) + (1 6 2) + (1 6 3) + (1 6 4) + (1 6 5) + (1 6 6) = 1 6 (1 + 2 + 3 + 4 + 5 + 6) = (2.9)

12 CHAPTER 2. 1,2,...,n E(X) = n + 1 2 (2.10) V (X) 2.13 X 2 (E(X) 2 ) n k=1 k 2 = 1 n(n + 1)(2n + 1) (2.11) 6 E(X 2 ) = 1 n n k=1 k 2 = 1 n 1 n(n + 1)(2n + 1) 6 = 1 (n + 1)(2n + 1) (2.12) 6 V (X) = E(X 2 ) (E(X)) 2 (2.13) = 1 6 (n + 1)(2n + 1) 1 (n + 1)2 4 = 1 12 (n2 1) (2.14) n = 6 1 10 2.3.5 2 ( ) ( 2.3.7 ) p q = (1 p) n k b(k;n,p) ( ) n b(k; n, p) = p k q n k (2.15) k

2.3. 13 ( ) n n! = n C k = k k!(n k)! 2 n k Octave n=10; p=0.5; x=1:n; pd=binomial_pdf(x,n,p); plot(pd); 2 1 : n 1 n ( ) binomial cdf(x,n,p) binomial cdf() np npq 0.18 0.16 0.14 0.12 0.1 0.08 0.06 0.04 0.02 0 5 10 15 20 25 30 35 40 45 50 Figure 2.1: 2 n=50, p=0.1,0.2, 0.3, 0.4, 0.5 5% 100 10 95%

0 14 CHAPTER 2. 2.3.6 n 2 n ( ) x (Poisson) λ p(x, λ) p(x, λ) = λx x! e λ (2.16) λ λ n (λ = np )2 λ x Octave poisson pdf(x,lambda),poisson cdf(x,lambda) 0.05 0.15 0.25 0.35 2 4 6 8 10 12 14 16 18 20 Figure 2.2: =1,2,5 1 6 1. 30 2. 1 6

05 1 2.3. 15 3. 100 2.3.7 N(µ, σ 2 ) µ σ 2 x f(x) = 1 (x µ)2 e 2σ 2 (2.17) 2πσ 2 n 2 x dens ity 0. 68.26% 0 99.73% 95.45% µ 3σ 4 3 2 1 2 3 4 0.10 0.15 0.20 0.25 0.30 0.35 0.40 Figure 2.3: 2

16 CHAPTER 2. ( ) normal pdf(x,m,v), normal cdf(x,m,v) X m,v? n n n=100 ( 1/100 ) ( 100 ) Octave randn() normal cdf(x,m,v) 0, 1 x=-1, 1.5, 2.0 % normal cdf(x,m,v) 0, 1 x= [0.3, 0.5] % normal cdf(x,m,v) 0, 1 x= [1.0, 1.2] % URL http://www.kwansei.ac.jp/hs/z90010/sugakuc/toukei/toukei.htm

05 2.3. 17 2.3.8 Z Z = X µ σ 10 + 50 (2.18) µ σ 10 50 30-70 X σ Z 10 2.3 40 60 68.26% 70 (µ = 0, σ 2 = 1) ( ) normal cdf(x,m,v) 0, 1 x=40, 55, 70 % dens ity 0. 68.26% 0.10 0.15 0.20 0.25 0.30 0.35 0.40 99.73% 95.45% 4 3 2 10 1 2 3 4 Figure 2.4: N(0,1)

18 CHAPTER 2. 2.3.9 (Zipf) 1/x(x 1 ) x α 2.4 4 2 1. 12 X X 2. 85% 1 95% 3. 2 30 30 2 (85%) ( 3 30 x6 ) 4. 10000 68 5. 6. ()

2.5. 19 2.5 2 2.5.1 1 X x( ) 2σ 0.95 ( 0.95 95% ) Z Z = (X µ) σ (2.19) X µ, σ Z [-2,2] X x µ, σ 95% 60 ( 100) 95 () 2.5.2 ( )

20 CHAPTER 2. 2 I false positive, II false negative, I 2.5.3 2 ( ) () 2 YES/NO

2.5. 21 2.5.4 t t t 2 2 ( ) 2 () t t t (Gosset) t t t X σ t = X µ σ/ n (2.20) Z t t t Octave 2.5.5 ( ) (95% )

22 CHAPTER 2. 2 (χ 2 ) F ( ) Octave

2.5. 23 2.5.6 χ 2 t χ 2 ( 2 ) χ 2 2 χ 2 2 A( :a 0, a 1,...a k, ( )n) P( :p 0, p 1,..., p k ) χ 2 (k-1) χ 2 χ 2 χ 2 = n (a i np i ) 2 i=1 np i (2.21) χ 2 B ( ) (B ) ˆp i = a i + b i n a + n b (2.22) n a n b A,B P [1/6,1/6,1/6,1/6,1/6,1/6] Octave χ 2 χ 2 Octave p (1-chisquare cdf(x,k)) X k chisq.m #chisq.m function x = chisq(a) length=size(a)(1,2); t0=round(sum(a)/length); x=0; for(i=1:length) x=x+ (A(1,i)-t0)^2/t0; endfor endfunction

24 CHAPTER 2. function p = dochisqtest(a) k=size(a)(1,2)-1; p = 1-chisquare_cdf(chisq(A),k); endfunction 100 200 300 D1,D2,D3 D1=[11,20,9,16,19,25]; D2=[26,38,22,34,37,43]; D3=[44,52,39,56,53,56]; χ 2 Octave:134> source("chisq.m"); octave:135> chisq(d1) ans = 10.471 octave:141> chisq(d2) ans = 9.4545 octave:142> chisq(d3) ans = 4.8400 k=5 95% octave:138> chisquare_inv(0.95,5) ans = 11.070 χ 2 11.07 (P: ) octave:143> dochisqtest(d1) ans = 0.062948 octave:144> dochisqtest(d2) ans = 0.092251 octave:145> dochisqtest(d3) ans = 0.43572 p 0.05 p 0.05 (p<0.05)

2.5. 25 2.5.7 : Octave t t test(x,m,alt), t test 2(x,y,alt) p-value x,y ( ) m alt <> ( ) µ x < µ y < µ x > µ y > A1=randn(100,1)+10; A2=randn(200,1); 2 octave:173> t_test(a1,10) pval: 0.779652 ans = 0.77965 octave:174> t_test(a1,9) pval: 0 ans = 0 octave:175> t_test(a1,9) pval: 0 ans = 0 octave:176> t_test(a1,11) pval: 1.13369e-19 ans = 1.1337e-19 2 octave:177> t_test_2(a1,a2) pval: 0 ans = 0 octave:178> t_test_2(a1,a2,">") pval: 0 ans = 0 octave:179> t_test_2(a1,a2,"<") pval: 1 ans = 1 octave:180> mean(a1) ans = 9.9747

26 CHAPTER 2. octave:181> mean(a2) ans = 0.085481 octave:183> A3=randn(10,1)+4; octave:184> t_test(a3,3) pval: 0.0177336 ans = 0.017734 octave:185> t_test(a3,3.5) pval: 0.203474 ans = 0.20347 octave:186> t_test(a3,3.8) pval: 0.658434 ans = 0.65843 octave:187> t_test(a3,4.1) pval: 0.65837 ans = 0.65837 octave:188> t_test(a3,4.3) pval: 0.313878 ans = 0.31388 octave:189> t_test(a3,4.5) pval: 0.128008 ans = 0.12801 octave:190> t_test(a3,4.6) pval: 0.0789323 ans = 0.078932 octave:191> t_test(a3,5) pval: 0.0108304 ans = 0.010830 2.5.8 5 URL http://www.data.kishou.go.jp/climate/cpdinfo/temp/list/an_jpn.html 1. 1995 t 2. 10 10 t

2.5. 27 3. 2.5.9 : S.D. S.J.