0 Up votes0 Down votes

9 views3 pagesDec 21, 2013

© Attribution Non-Commercial (BY-NC)

PDF, TXT or read online from Scribd

Attribution Non-Commercial (BY-NC)

9 views

Attribution Non-Commercial (BY-NC)

- Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
- Hidden Figures Young Readers' Edition
- The Law of Explosive Growth: Lesson 20 from The 21 Irrefutable Laws of Leadership
- The Art of Thinking Clearly
- The E-Myth Revisited: Why Most Small Businesses Don't Work and
- The Wright Brothers
- The Other Einstein: A Novel
- State of Fear
- State of Fear
- The Power of Discipline: 7 Ways it Can Change Your Life
- The Kiss Quotient: A Novel
- The 10X Rule: The Only Difference Between Success and Failure
- Being Wrong: Adventures in the Margin of Error
- Algorithms to Live By: The Computer Science of Human Decisions

You are on page 1of 3

probability in eecs

function [INVD] = invdist(P) %This function computes the invariant distribution % of a stochastic matrix P N = size(P, 2); B = (P - eye(N)); B(1:N,N) = ones(N, 1); o = zeros(1, N); o(N) = 1; INVD = o*inv(B);

As an example,

P = [0, 0.3, 0.7; 0, 0.4, 0.6; 1, 0, 0]; invdist(P)

ans = 0.4000 0.2000 0.4000

B.4

Condence Intervals

We experiment with confidence intervals . Let { Xn , n 1} be i.i.d. with mean and variance 2 . We explained in Section 2.3 that a 95% condence interval for the mean is, provided that n is sufciently large, 2 2 [n , n ] n n X1 + + X n n is the sample mean. We test this condence interval for coin ips. For coin ips, i.e., B( p) random variables, we know that n = var( Xn ) = p(1 p) 1/4. We then use the upper bound 1/2 on the standard deviation in the condence intervals that are then given by 1 1 [ n , n + ]. n n The code below generates i.i.d. B( p) random variables X (1), . . . , X ( N ) and computes their sample mean. It then calculates the bounds of the condence interval. Figure B.3 shows the results. where

p

1 n + n

n 1 n n n := X1 + + Xn n n

Figure B.3: Condence intervals for the bias of a coin using a bound on the variance.

matlab

167

\color{blue} \begin{verbatim} %Flip coin N times; these are B(p) random variables %Construct confidence interval % % N = 300; p = 0.3; Y = zeros(1,N); U = ones(1,N); M = p*U; L = zeros(1,N); Y(1) = (rand(1) < p); for j = 2:N Y(j) = ((j - 1)*Y(j-1) + (rand(1) < p))/j; b = 1/sqrt(j); U(j) = Y(j) + b; L(j) = Y(j) - b; end plot([Y;L;U;M])

n n + 2 n n :=

2 n :=

X1 + + Xn n ( X1 n ) 2 + + ( Xn n ) 2 n

I nstead of using an upper bound on the condence interval, one may use the sample standard deviation. In that case, the condence interval is 2n 2n [n , n ] n n where

2 X 2 + + Xn = 1 2 n n is the sample variance. Here is the code with the modication. Figure B.4 shows the result. Initially, the estimate n of the standard deviation is not very good. However, for large n, this estimate becomes better than an upper bound and results in smaller condence intervals. 2 n

n n 2 n

Figure B.4: Condence intervals for the bias of a coin using the sample variance.

%Flip coin N times %Repeat M times % p = P(1) = 1 - P(0) N = 300; p = 0.3; Y = zeros(1,N); %sample mean U = ones(1,N); % upper bound of CI M = p*U; % center of CI

168

probability in eecs

L = zeros(1,N); % lower bound of CI S = U; % sample second moment Y(1) = (rand(1) < p); S(1) = Y(1)^2; for j = 2:N R = (rand(1) < p); % coin flip Y(j) = ((j - 1)*Y(j-1) + R )/j; S(j) = S(j-1) + R^2; b = 2/sqrt(j); sigma = sqrt(S(j)/j - Y(j)^2); % samplestandard deviation U(j) = Y(j) + b*sigma; L(j) = Y(j) - b*sigma; end plot([Y;L;U;M])

n :=

2 n :=

X1 + + Xn n ( X1 n ) 2 + + ( Xn n ) 2 n

The code given above can be used for other distributions. Here is an example with exponential random variables. Figure B.5 shows the results.

%Generate N Exp with mean mu %Constuct confidence interval % based on sample mean and sample variance % p = P(1) = 1 - P(0) N = 300; mu = 7; Y = zeros(1,N); %sample mean U = ones(1,N); % upper bound of CI M = mu*U; % center of CI L = zeros(1,N); % lower bound of CI S = U; % sample second moment Y(1) = random(exp, mu); S(1) = Y(1)^2; for j = 2:N R = random(exp, mu); % exponential Y(j) = ((j - 1)*Y(j-1) + R )/j; S(j) = S(j-1) + R^2; b = 2/sqrt(j); sigma = sqrt(S(j)/j - Y(j)^2); % sample standard deviation U(j) = Y(j) + b*sigma; L(j) = Y(j) - b*sigma; end plot([Y;L;U;M])

n n + 2 n n

n n 2 n

Figure B.5: Condence intervals for the mean of exponential random variables using the sample variance.

- ch09.randvarUploaded byamisha2562585
- Application of Statistical Concepts in the Determination of Weight Variation in Samples (Autosaved)Uploaded byBulawan LaNeref Oremse
- ch06testUploaded bySatyam Rai
- STAT Final SampleUploaded byabrammazal42003
- Kjellgren - A comparison of the restorative effect of a natural environment with that of a simulated natural environment.pdfUploaded byanggun
- Maths Coursework - Mayfield SchoolUploaded bygeorgesmart1
- Biostat to AnswerUploaded bySamantha Arda
- The Revised Children Anxiety testUploaded byAnonymous jH2v0B
- 7 Outcome Measure..Uploaded bymanojpuru
- STATS WSUploaded bybigbang
- BIO 31.02 Computation Exercise 6 Solutions.xlsxUploaded byDara Kwon
- AQA-SS1A-W-MS-JUN06Uploaded byNawsheen Lallmohamed
- Statistics and Probability TestUploaded byAnnSequias
- UntitledUploaded byapi-126876773
- presentasi onielUploaded byoniel
- Stats_ Measures of VariationUploaded bymurtaza5500
- article_wjpps_1399003981Uploaded byNerita Puputh
- Consumer PanelsUploaded byvaibhav1211
- Data Prep 101Uploaded bydatasenter
- UC Excel 2010 - Module 2 - CalculationsUploaded byJulio César Rosales Peñate
- FrequentlyUploaded byvijay2101
- OutputUploaded byJ R
- MCS_var_red1.pdfUploaded byvago sin voz
- MSA4th_Page88Errata.pdfUploaded byErick Alvarado
- mennis_cagis06Uploaded byliveris
- skittle project snUploaded byapi-258541165
- Tabel 1Uploaded byVhytaKwOnyuree
- Variables y ParametrosUploaded byMarjorie Lisseth Calderón Lozano
- 7_29-31.pdfUploaded byfahmie halim
- 260947535-Iteman-4-3-Manual.pdfUploaded byHaudy Rois

- Olympiad Combinatorics.pdfUploaded byKrutarth Patel
- A memorandum regarding AMORC (1930).pdfUploaded bysauron385
- XA00162220 (1)Uploaded byOvidiu Si Roxana Ivascu
- appL.pdfUploaded byArkn Kiki
- Measurement of Fluorescence Quantum YieldsUploaded byChaudhary Mandeep Singh Dalal
- API675 USUploaded byAKSHEYMEHTA
- b18887-34Uploaded bymehdi810
- DpiUploaded by2vij
- 345KV Autotransformer Spec(08.29.2012)Uploaded byDante Filho
- MN StarterUploaded byKeyboardMan1960
- Place DescriptionUploaded byVictor Manuel Felix Menchaca
- BIOLOGY-9.xlsxUploaded byMary Grace Josef
- Balassa-1963.pdfUploaded byNicolas D. Lopez Verhelst
- 5 Template Artikel Ilmiah.docxUploaded byIFan Ferdiansyah
- 100 Ways to Achieve Success in Any FieldsUploaded byVnAy Vn
- Hopi Time ControversyUploaded byforum_ubx
- EDL Upgrading SPBG Bogor - Electrical.xlsxUploaded by17crush
- MS22045_00E 12V 16V 2000 M84 M94 Instructions for Exchange of AssembliesUploaded bymar
- PM6 Battery OperatedUploaded bydhirajkumar_1
- weebly resumeUploaded byapi-370117987
- GROM-USBUploaded byLambert Deemsterhede
- APC200 ECM-ECI Generic Error Codes Ver3.5Uploaded byYıldırım Danış
- District Heating Services_Wood PlcUploaded bymaverik29
- Rapid Mini Wet Blot | xitij instrument pvt ltdUploaded byTeju Patil
- SPURGIN_SERRANO-PICHE_3501fall2008_WEBUploaded byLeo Spurgin
- Electronic EngineeringUploaded byPidikiti Surendra Babu
- audio-spot-lightingUploaded byDebjyoti Sarkar
- 80-20-WHITE-PAPER-by-Tom-Meyer.pdfUploaded bymdmonzurh1
- Type of Joint of Thermit Weld PowderUploaded byAmiableimpex
- “STUDY OF NATURAL FIBERS AS AN ADMIXTURE FOR CONCRETE MIX DESIGN”Uploaded byJOHN FHILIP ORIT

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.