Presentation is loading. Please wait.

Presentation is loading. Please wait.

ENGR-25_Lec-19_Statistics-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

Similar presentations


Presentation on theme: "ENGR-25_Lec-19_Statistics-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed."— Presentation transcript:

1

2 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu Engr/Math/Physics 25 Chp7 Statistics-1

3 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 2 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Learning Goals  Use MATLAB to solve Problems in Statistics Probability  Use Monte Carlo (random) Methods to Simulate Random processes  Properly Apply Interpolation or Extrapolation to Estimate values between or outside of know data points

4 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 3 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Histogram  Histograms are COLUMN Plots that show the Distribution of Data Height Represents Data Frequency  Some General Characteristics Used to represent continuous grouped, or BINNED, data –BIN  SubRange within the Data Usually Does not have any gaps between bars Areas represent %-of-Total Data

5 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 4 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods HistoGram ≡ Frequency Chart  A HistoGram shows how OFTEN some event Occurs Histograms are often constructed using Frequency Tables

6 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 5 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Histograms In MATLAB  MATLAB has 6 Forms of the Histogram Cmd  The Simplest Hist(y)  The Plot Statement Generates a Histogram with 10 bins  Example: Max Temp at Oakland AirPort in Jul-Aug08 TmaxOAK = [70, 75, 63, 64, 65, 66, 65, 65, 67, 78, 75, 73, 79, 71, 72, 67, 69, 69, 70, 74, 71, 72, 71, 74, 77, 77, 86, 90, 90, 70, 71, 66, 66, 72, 68, 73, 72, 82, 91, 82, 76, 75, 72, 72, 69, 70, 68, 65, 67, 65, 63, 64, 72, 70, 68, 71, 77, 65, 63, 69, 69, 67] hist(TmaxOAK), ylabel('No. Days'), xlabel('Max. Temp (°F)'), title('Oakland Airport - Jul-Aug08')

7 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 6 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods hist Result for Oakland  It was COLD in Summer 08  Bin Width = (91-63)/10 = 2.8 °F

8 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 7 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Histograms In MATLAB  Next Example: Max Temp at Stockton AirPort in Jul-Aug08 Hist(y)  The Plot Statement Generates a Histogram with 10 bins TmaxSTK = [94, 98, 93, 94, 91, 96, 93, 87, 89, 94, 100, 99, 103, 103, 103, 97, 91, 83, 84, 90, 89, 95, 94, 99, 97, 94, 102, 103, 107, 98, 86, 89, 95, 91, 84, 93, 98, 104, 105, 107, 103, 91, 90, 96, 93, 86, 92, 93, 95, 95, 86, 81, 93, 97, 96, 97, 101, 92, 89, 92, 93, 94] hist(TmaxSTK), ylabel('No. Days'), xlabel('Max. Temp (°F)'), title(‘Stockton Airport - Jul-Aug08')

9 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 8 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods hist Result for Stockton  It was HOT in Summer 08  Bin Width = (107-81)/10 = 2.6 °F

10 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 9 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods hist Command Refinements  Adjust The number and width of the bins using hist(y,N) hist(y,x) Where –N  an integer specifying the NUMBER of Bins –x  A vector that Specs CENTERs of the Bins  Consider Summer 08 Max-Temp Data from Oakland and Stockton  Make 2 Histograms 17 bins 60F→110F by 2.5’s

11 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 10 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods hist Plots  17 Bins >> hist(TmaxSTK,17), ylabel('No. Days'), xlabel('Max. Temp (°F)'), title('Stockton, CA - Jul- Aug08')>> hist(TmaxOAK,17), ylabel('No. Days'), xlabel('Max. Temp (°F)'), title('Oakland, CA - Jul- Aug08')

12 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 11 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods hist Plots  Same Scale >> x = [60:2.5:110]; >> hist(TmaxSTK,x), ylabel('No. Days'), xlabel('Max. Temp (°F)'), title('Stockton, CA - Jul- Aug08') >> x = [60:2.5:110]; hist(TmaxOAK,x), ylabel('No. Days'), xlabel('Max. Temp (°F)'), title('Oakland, CA - Jul- Aug08')

13 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 12 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods hist Numerical Output  Hist can also provide numerical Data about the Histogram n = hist(y) Gives the number of values in each of the (default) 10 Bins  For the Stockton data k = 2 5 1 10 16 7 9 2 7 3  We can also spec the number and/or Width of Bins >> k13 = hist(TmaxSTK,13) k13 = 2 2 4 4 6 10 10 7 5 2 6 2 2 >> k2_5s = hist(TmaxOAK,x)

14 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 13 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods hist Numerical Output  Bin-Count and Bin-Locations (Frequency Table) for the Oakland Data >> [u, v] = hist(TmaxOAK,x) u = 0 3 11 7 1 5 9 6 4 1 2 1 0 30 0 0 0 0 0 0 0 v = 60.0000 62.5000 65.0000 67.5000 7 0.0000 72.5000 75.0000 77.5000 80.0000 82.5000 85.0000 87.5000 90.0000 92.5000 95.0000 97.5000 100.0000 102.5000 105.0000 107.5000 110.0000

15 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 14 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Histogram Commands - 1 CommandDescription bar(x,y) Creates a bar chart of y versus x. hist(y) Aggregates the data in the vector y into 10 bins evenly spaced between the minimum and maximum values in y. hist(y,n) Aggregates the data in the vector y into n bins evenly spaced between the minimum and maximum values in y. hist(y,x) Aggregates the data in the vector y into bins whose center locations are specified by the vector x. The bin widths are the distances between the centers.

16 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 15 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Histogram Commands - 2 CommandDescription [z,x] = hist(y) Same as hist(y) but returns two vectors z and x that contain the frequency count and the 10 bin locations. [z,x] = hist(y,n) Same as hist(y,n) but returns two vectors z and x that contain the frequency cnt and the n bin locations. [z,x] = hist(y,x) Same as hist(y,x) but returns two vectors z and x that contain the frequency count and the bin locations. The returned vector x is the same as the user-supplied vector x.

17 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 16 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Data Statistics Tool - 1  Make Line- Plot of Temp Data for Stockton, CA  Use the Tools Menu to find the Data Statistics Tool

18 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 17 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Data Statistics Tool - 2  Use the Tool to Add Plot Lines for The Mean ±StdDev

19 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 18 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Data Statistics Tool - 3  Quite a Nice Tool, Actually  The Result  The Avg Max Temp Was 96.97 °F

20 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 19 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Probability  Probability  The LIKELYHOOD that a Specified OutCome Will be Realized The “Odds” Run from 0% to 100% What are the Odds of winning the California MEGA-MILLIONS Lottery?  Class Question: What are the Odds of winning the California MEGA-MILLIONS Lottery?

21 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 20 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 175 711 536... EXACTLY???!!!  To Win the MegaMillions Lottery Pick five numbers from 1 to 56 Pick a MEGA number from 1 to 46  The Odds for the 1 st ping-pong Ball = 5 out of 56  The Odds for the 2 nd ping-pong Ball = 4 out of 55, and so On  The Odds for the MEGA are 1 out of 46

22 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 21 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 175 711 536... Calculated  Calc the OverAll Odds as the PRODUCT of each of the Individual OutComes This is Technically a COMBINATION

23 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 22 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 175 711 536... is a DEAL!  The ORDER in Which the Ping-Pong Balls are Drawn Does NOT affect the Winning Odds  If we Had to Match the Pull-Order: This is a PERMUTATION

24 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 23 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normal Distribution - 1  Consider Data on the Height of a sample group of 20 year old Men  We can Plot this Frequency Data using bar >> y_abs=[1,0,0,0,2,4,5, 4,8,11,12,10,9,8,7,5, 4,4,3,1,1,0,1]; >> xbins = [64:0.5:75]; >> bar(xbins, y_abs), ylabel('No.'), xlabel('Height (Inches'), title('Height of 20 Yr-Old Men')

25 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 24 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normal Distribution - 2  We can also SCALE the Bar/Hist such that the AREA UNDER the CURVE equals 1.00, exactly  The Game Plan for Scaling Calc the Height of Each Bar To Get the Total Area = [Bin Width] x [Σ(individual counts)] The individual Bar Area = [Bin Width] x [individual count] %-Area any one bar → [Bar Areas]/[Total Area]

26 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 25 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normal Distribution - 3  We can Use bar to Plot the Scaled-Area Hist. >>y_abs=[1,0,0,0,2,4,5,4,8,11,12,10,9,8,7,5,4,4,3,1,1,0,1] ; >> xbins = [64:0.5:75]; >> TotalArea = sum(0.5*y_abs) >> y_scale = 100*y_abs/TotalArea; >> bar(xbins, y_scale), ylabel('Fraction (%/inch)'), xlabel('Height (inches)'), title('Height of 20 Yr-Old Men')

27 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 26 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normal Distribution - 4  This is a Good Time for a UNITS Check Remember, our GOAL → the Area Under the Curve = 1  Recall From the Plot the UNITS for the y-axis → %/inch (?)  The Units come from these MATLAB Statements  So TotalArea is in inchesNo.  Now y_scale TotalArea = sum(0.5*y_abs) Bin Width in INCHES y_scale = 100*y_abs/TotalArea; Cont. on Next Slide

28 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 27 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normal Distribution - 5  The Units Analysis for y-scale  Recall From MTH1 that for y = f(x) displayed in BAR Form the Area Under the Curve y_scale = 100*y_abs/TotalArea;

29 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 28 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normal Distribution - 6  In this Case y(x) → y_scale in %/inch Δx → Bin Width = 0.5 in inches  Then The Units Analysis for Our “integration”  Check the integration Example

30 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 29 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normal Distribution - 7  Example  71”  The 71” Bar Area = HgtWidth:  Alternatively from the Absolute values The Total Abs Area = 50 No.inch 

31 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 30 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Probability Distribution Fcn (PDF)  Because the Area Under the Scaled Plot is 1.00, exactly, The FRACTIONAL Area under any bar, or set-of-bars gives the probability that any randomly Selected 20 yr-old man will be that height  e.g., from the Plot we Find 67.5 in → 8 %/in 68 in → 16 %/in 68.5 in → 22%/in  Summing → 46 %/in  Multiply the Uniform BinWidth of 0.5 in → 23% of 20 yr-old men are 67.25- 68.75 inches tall

32 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 31 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Random Variable  A random variable x takes on a defined set of values with different probabilities; e.g.. If you roll a die, the outcome is random (not fixed) and there are 6 possible outcomes, each of which occur with equal probability of one-sixth. If you poll people about their voting preferences, the percentage of the sample that responds “Yes on Proposition 101” is a also a random variable –the %-age will be slightly differently every time you poll.  Roughly, probability is how frequently we expect different outcomes to occur if we repeat the experiment over and over (“frequentist” view)

33 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 32 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Random variables can be Discrete or Continuous  Discrete random variables have a countable number of outcomes Examples: Dead/Alive, Red/Black, Heads/Tales, dice, counts, etc.  Continuous random variables have an infinite continuum of possible values. Examples: blood pressure, weight, Air Temperature, the speed of a car, the real numbers from 1 to 6.

34 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 33 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Probability Distribution Functions  A Probability Distribution Function (PDF) maps the possible values of x against their respective probabilities of occurrence, p(x)  p(x) is a number from 0 to 1.0, or alternatively, from 0% to 100%.  The area under a probability distribution function curve is always 1 (or 100%).

35 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 34 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Discrete Example: Roll The Die 1/6 145623 xp(x) 1p(x=1)=1/6 2p(x=2)=1/6 3p(x=3)=1/6 4p(x=4)=1/6 5p(x=5)=1/6 6p(x=6)=1/6

36 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 35 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Continuous Case  The probability function that accompanies a continuous random variable is a continuous mathematical function that integrates to 1.  The Probabilities associated with continuous functions are just areas under a Region of the curve (→ Definite Integrals)  Probabilities are given for a range of values, rather than a particular value e.g., the probability of getting a math SAT score between 700 and 800 is 2%).

37 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 36 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Continuous Case PDF Example  Recall the negative exponential function (in probability, this is called an “exponential distribution”):  This Function Integrates to 1 zero to infinity as required for all PDF’s

38 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 37 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Continuous Case PDF Example x p(x)=e -x 1  For example, the probability of x falling within 1 to 2:  The probability that x is any exact value (e.g.: 1.9976) is 0 we can ONLY assign Probabilities to possible RANGES of x x 1 12 p(x)=e -x NO Area Under a LINE

39 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 38 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Gaussian Curve  The Man-Height HistroGram had some Limited, and thus DISCRETE, Data  If we were to Measure 10,000 (or more) young men we would obtain a HistoGram like this  As We increase the number and fineness of the measurements The PDF approaches a CONTINUOUS Curve

40 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 39 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Gaussian Distribution  A Distribution that Describes Many Physical Processes is called the GAUSSIAN or NORMAL Distribution  Gaussian (Normal) distribution Gaussian → famous “bell-shaped curve” –Describes IQ scores, how fast horses can run, the no. of Bees in a hive, wear profile on old stone stairs... All these are cases where: –deviation from mean is equally probable in either direction –Variable is continuous (or large enough integer to look continuous)

41 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 40 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normal Distribution  Real-valued PDF: f(x) → −∞ < x < +∞  2 independent fitting parameters: µ, σ (central location and width)  Properties: Symmetrical about Mode at µ, Median = Mean = Mode, Inflection points at ±σ  Area (probability of observing event) within: ± 1σ = 0.683 ± 2σ = 0.955  For larger σ, bell shaped curve becomes wider and lower (since area =1 for any σ)

42 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 41 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normal Distribution  Mathematically Where –σ 2 = Variance –µ = Mean  The Area Under the Curve

43 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 42 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 68-95-99.7 Rule for Normal Dist 68% of the data 95% of the data 99.7% of the data σσ 2σ2σ2σ2σ 3σ3σ3σ3σ

44 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 43 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 68-95-99.7 Rule in Math terms…  Using Definite-Integral Calculus

45 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 44 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods How Good is the Rule for Real?  Check some example data:  The mean, µ, of the weight of a large group of women Cross Country Runners = 127.8 lbs  The standard deviation (σ) for this Group = 15.5 lbs

46 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 45 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 127.8143.3112.3 68% of 120 =.68x120 = ~ 82 runners In fact, 79 runners fall within 1σ (15.5 lbs) of the mean

47 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 46 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 127.896.8 95% of 120 =.95 x 120 = ~ 114 runners In fact, 115 runners fall within 2σ of the mean 158.8

48 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 47 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods 127.881.3 99.7% of 120 =.997 x 120 = 119.6 runners In fact, all 120 runners fall within 3σ of the mean 174.3

49 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 48 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Estimating µ & σ (1)  The Location & Width Parameters, µ & σ, are Calculated from the ENTIRE POPULATION Mean, µ Variance, σ 2 Standard Deviation, σ  For LARGE Populations it is usually impractical to measure all the x k  In this case we take a Finite SAMPLE to ESTIMATE µ & σ

50 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 49 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Estimating µ & σ (2)  Say we want to characterize Miles/Yr driven by Every Licensed Driver in the USA  We assume that this is Normally Distributed, so we take a Sample of N = 1013 Drivers  We Take the Mean of the SAMPLE  Use the SAMPLE- Mean to Estimate the POPULATION-Mean

51 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 50 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Estimating µ & σ (3)  Now Calc the SAMPLE Variance & StdDev  Estimate Number decreased from N to (N – 1) To Account for case where N = 1 –In this case x-bar = x 1, and the S 2 result is meaningless standard deviation: positive square root of the variance –small std dev: observations are clustered tightly around a central value –large std dev: observations are scattered widely about the mean

52 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 51 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Sample Mean and StdDev Sample Mean Calculate the Population Variance, σ 2, from: Sample Variance But we cannot know the true population mean µ so the practical estimate for the sample variance and standard deviation would be:

53 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 52 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Error Function (erf) & Probability  Guass’s Defining Eqn  This looks a lot Like the normal dist  Now Let  Consider the Gaussian integral  Or

54 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 53 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Error Function (erf) & Probability  Subbing for x & dx  As  ReArranging

55 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 54 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Error Function (erf) & Probability  Now the Limits  Plotting  This Fcn is Symmetrical about y = 0  Recall  And the erf properties erf(0) = 0 erf(h) = 1

56 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 55 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Error Function (erf) & Probability  By Symmetry about y = 0 for  Thus  So Finally integrating − h to B

57 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 56 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Error Function (erf) & Probability  Note That for a Continuous PDF Probability that x is Less or Equal to b Probability that x is between a & b  The probability for the Normal Dist  But

58 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 57 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Error Function (erf) & Probability  If We Scale this Properly we can Cast these Eqns into the ½erf Form  MATLAB has the erf built-in, so if we have the sample Mean & StdDev We can Calc Probabilities for Normally Distributed Quantities

59 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 58 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods All Done for Today Gaussian? Or Normal?  Normal distribution was introduced by French mathematician A. De Moivre in 1733. Used to approximate probabilities of coin tossing Called it the exponential bell-shaped curve  1809, K.F. Gauss, a German mathematician, applied it to predict astronomical entities… it became known as the Gaussian distribution.  Late 1800s, most believe majority of physical data would follow the distribution  called normal distribution  Recall De Moivre’s Theorem

60 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 59 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu Engr/Math/Physics 25 Appendix

61 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 60 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Basic Fitting Demo File % Bruce Mayer, PE % ENGR25 * 11Apr10 % file = Demo_Basic_Fitting_Stockton_Temps_1004.m % TmaxSTK = [94, 98, 93, 94, 91, 96, 93, 87, 89, 94, 100, 99, 103, 103, 103, 97, 91, 83, 84, 90, 89, 95, 94, 99, 97, 94, 102, 103, 107, 98, 86, 89, 95, 91, 84, 93, 98, 104, 105, 107, 103, 91, 90, 96, 93, 86, 92, 93, 95, 95, 86, 81, 93, 97, 96, 97, 101, 92, 89, 92, 93, 94] Ntot = length(TmaxSTK) nday = [1:Ntot]; plot(nday, TmaxSTK, '-dk'), xlabel('No. Days after 31Jun08'), ylabel('Max. Temp (°F)'), title('Stockton, CA - Jul-Aug08')

62 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 61 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normal or Gaussian?  Normal distribution was introduced by French mathematician A. De Moivre in 1733. Used to approximate probabilities of coin tossing Called it exponential bell-shaped curve  1809, K.F. Gauss, a German mathematician, applied it to predict astronomical entities… it became known as Gaussian distribution.  Late 1800s, most believe majority data would follow the distribution  called normal distribution

63 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 62 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Carl Friedrich Gauss

64 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 63 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Normal Dist Data Ht (in)No.Area (BW*No.)No./TotAreaBW*(No./TotArea) 64 10.5 0.02001.00% 64.5 000.00000.00% 65 000.00000.00% 65.5 000.00000.00% 66 210.04002.00% 66.5 420.08004.00% 67 52.50.10005.00% 67.5 420.08004.00% 68 840.16008.00% 68.5 115.50.220011.00% 69 1260.240012.00% 69.5 1050.200010.00% 70 94.50.18009.00% 70.5 840.16008.00% 71 73.50.14007.00% 71.5 52.50.10005.00% 72 420.08004.00% 72.5 420.08004.00% 73 31.50.06003.00% 73.5 10.50.02001.00% 74 10.50.02001.00% 74.5 000.00000.00% 75 10.50.02001.00%  50.0  100.00%

65 BMayer@ChabotCollege.edu ENGR-25_Lec-19_Statistics-1.ppt 64 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods SPICE Circuit


Download ppt "ENGR-25_Lec-19_Statistics-1.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed."

Similar presentations


Ads by Google