Docsity

Histogram and Normal Distribution: Understanding Continuous Data, Slides of Calculus for Engineers

Partial preview of the text

Download Histogram and Normal Distribution: Understanding Continuous Data and more Slides Calculus for Engineers in PDF only on Docsity!

  • Engr/Math/Physics
    • Chp
  • Statistics-

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

HistoGram ≡ Frequency Chart

  • A HistoGram shows how OFTEN some event

Occurs

  • Histograms are

often constructed

using Frequency

Tables

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-Aug

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')

Histograms In MATLAB

  • Next Example: Max

Temp at Stockton

AirPort in Jul-Aug

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')

hist Result for Stockton

 It was HOT

in Summer

 Bin Width =

= 2.6 °F

(^080 85 90 95 100 105 )

2

4

6

8

10

12

14

16 Stockton Airport - Jul-Aug

No. Days

Max. Temp (°F)

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')

(^080 85 90 95 100 105 )

1

2

3

4

5

6

7

8

9

10 Stockton, CA - Jul-Aug

No. Days

Max. Temp (°F) 060 65 70 75 80 85 90 95

1

2

3

4

5

6

7

8

9

10 Oakland, CA - Jul-Aug

No. Days

Max. Temp (°F)

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')

(^060 65 70 75 80 85 90 95 100 105 )

2

4

6

8

10

12

14

16 Oakland, CA - Jul-Aug

No. Days

(^60 65 70 75 80 85 90 95 100 105 110) Max. Temp (°F) 0

2

4

6

8

10

12

14

16 Stockton, CA - Jul-Aug

No. Days

Max. Temp (°F)

hist Numerical Output

  • Bin-Count and Bin-Locations (Frequency

Table) for the Oakland Data

[u, v] = hist(TmaxOAK,x) u = 0 3 11 7 15 9 6 4 1 2 1 0 3 0 0 0 0 0 0 0 0 v = 60.0000 62.5000 65.0000 67.5000 70.

72.5000 75.0000 77.5000 80.0000 82. 85.0000 87.5000 90.0000 92.5000 95. 97.5000 100.0000 102.5000 105.0000 107.

Histogram Commands - 1

Command Description
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.

Data Statistics Tool - 1

  • Make Line-Plot

of Temp Data

for Stockton,

CA

  • Use the Tools

Menu to find

the Data

Statistics Tool

Data Statistics Tool - 2

  • Use the Tool

to Add Plot

Lines for

  • The Mean
  • ±StdDev

Probability

  • Probability ≡ The LIKELYHOOD that a

Specified OutCome Will be Realized

  • The “Odds” Run from 0% to 100%
  • Class Question: What are the

Odds of winning the California MEGA-

MILLIONS Lottery?

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