9 views

Uploaded by Omar Ali

- CALCULATING Standard Deviation
- Project
- 1305373847645_14 D6774-02
- Statistics Formula Sheet
- Measuring Systems - Problem Set 10 - Solutions
- Probability-chapter 1 Random Variables
- 5_Estimation Confidence Interval
- solutionsChapter-8-F07
- Estimation
- Analysis of Mean & Std Dev
- 13 i
- The Impact of Visual Aids in Teaching English
- Research Methodology -Finalppt
- Invest Return
- Standard Deviation and Variance
- CFM ROss Solutions
- QC Assignment Fall 2013
- lippoldt2014
- Quality Management ISO 17025:2005
- AP Bio Math and Statistics

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.

- CALCULATING Standard DeviationUploaded byAgung Jatiariska
- ProjectUploaded byne002
- 1305373847645_14 D6774-02Uploaded byPhung Duoc
- Statistics Formula SheetUploaded byGohÄr ÈjÁz
- Measuring Systems - Problem Set 10 - SolutionsUploaded byLinh Tran
- Probability-chapter 1 Random VariablesUploaded byEr Baer
- 5_Estimation Confidence IntervalUploaded bysunil
- solutionsChapter-8-F07Uploaded byJohnJoseph
- EstimationUploaded byMehdi Hooshmand
- Analysis of Mean & Std DevUploaded bysunithanitw
- 13 iUploaded byapi-230427224
- The Impact of Visual Aids in Teaching EnglishUploaded byA Praveen Raj
- Research Methodology -FinalpptUploaded byNithin Kumar
- Invest ReturnUploaded by29_ramesh170
- Standard Deviation and VarianceUploaded bystiker4
- CFM ROss SolutionsUploaded byHai Ha
- QC Assignment Fall 2013Uploaded byM. Yunus
- lippoldt2014Uploaded bySumi Tarigan
- Quality Management ISO 17025:2005Uploaded byGerrit Van Der Walt
- AP Bio Math and StatisticsUploaded byJuan Carlos Mejia Macias
- PROBABILISTIC ANALYSIS OF FATIGUE CRACK GROWTH USING MOMENT METHODUploaded bySarfaraz Nawaz Shaha
- Exploratory Experimental Studies Comparing Online and Offline Programing PerformanceUploaded byLouie Helm
- 10[1].1.1.43.2990Uploaded bykcvara
- Quality (2)Uploaded byMY NAME IS NEERAJ..:):)
- Burns05 Im 16Uploaded byvanityagi
- Medical Report : Literature Review ReportUploaded byWiswa Deadman
- Observation on abundance and group diversity of soil microarthropods with special reference to acarines at four differently used soil habitats.Uploaded byIJSRP ORG
- SPC CalculationsUploaded byVinoth Kumar
- 260947535-Iteman-4-3-Manual.pdfUploaded byHaudy Rois
- EPQ testovi i resenja test licnosti.pdfUploaded byPitagoraBGD

- Topic 1 WbleUploaded byHan Yong
- ForecastUploaded bytychester
- 4. Blocking FactorsUploaded bydwiyuliani59
- MATH1041 Final Cheat SheetUploaded byBasil Razi
- Quartiles Deciles and PercentilesUploaded byClerenda Mcgrady
- 380 Spss Exercise Answer SheetUploaded bySanctaTiffany
- Notes PSYC 355 Unit 1.3Uploaded byJayke Haven
- Simple Guide to MinitabUploaded byDedi Suryadi
- Hypothesis Tests ExercisesUploaded byHaleyRae Holmes
- Multilevel models slidesUploaded bySlava Yurkov
- StatisticsUploaded bymukhamad ikhwan nahdudin
- CQE Body of KnowledgeUploaded byRaj Lally Batala
- Ips7e Ism Ch01Uploaded bysubash1111@gmail.com
- Time Series Analysis and Its Applications codeUploaded byvtt20121981
- Ordered SpssUploaded byDian Nurma Utami
- 19 Partial and SemiUploaded byrohan48
- Data_Analaysis_textbook Proposal 2016 12 16_publicUploaded byGabor Bekes
- Quantitative Methods of Economics MCQ'SUploaded byGuruKPO
- curv&surface fittingsUploaded byKoray Torun
- mvtnormUploaded byVincentLiang
- 3 - 2 measure probability distributionUploaded byapi-101303155
- Variability FinalUploaded byRonza
- MB0024Uploaded byanon-791644
- Karan PatilUploaded bykaran patil
- Chapter 6 AssignmentUploaded byadee_uson
- A Meta-Analysis of the Effects of Humor on AdvertisingUploaded bycartegratuita
- DOE Course - Parts 1-4oUploaded bysan moedano
- Chapter 04 AnswersUploaded bysadfj545
- 3A Demand EstimationlUploaded byAlok Shukla
- Chapter 5 Concept Description Characterization and Comparison 395Uploaded bySailaja Naidu