stat151_class1

Embed Size (px)

Citation preview

  • 8/10/2019 stat151_class1

    1/38

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    STAT 151 Introduction to Statistical Theory

    August 21, 2014

    STAT 151 Class 1 Slide 1

    http://find/http://goback/
  • 8/10/2019 stat151_class1

    2/38

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    Instructor and TAs (weekly consultation location and hours, byappointments only)

    DenisHY LEUNGSOE5047

    email:[email protected]: 68280396Tues 4-6pm, Wed/Thurs 9-11am

    TAs SOE Grp Study Rm 4-7 (Rm 4023)

    Mon 12-3pm DANG VU Dieu [email protected]

    Wed 12-3pm HO Yan [email protected]

    Thu 4-7pm Muhammad Hafiz Bin [email protected]

    Thu 12-3pm LAU Jin [email protected]

    STAT 151 Class 1 Slide 2

    http://find/
  • 8/10/2019 stat151_class1

    3/38

  • 8/10/2019 stat151_class1

    4/38

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    Assessments

    Class Participation (10%)

    Projects (40%)

    1 project with presentations 16%

    2 projects without presentations 24% (2 12%)

    Each projects grade includes 6% individual assessment(quizzes)

    Exam (50%) Closed book but one 2-sided A-4 cheat sheet is allowed

    STAT 151 Class 1 Slide 4

    I d i R d P b bili P b bili l P b bili di ib i Di C i

    http://find/
  • 8/10/2019 stat151_class1

    5/38

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    Structure of each class

    New materials (

  • 8/10/2019 stat151_class1

    6/38

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    Data

    Survival time (in years) in 70 cancer patients

    0.67 0.01 0.481.060.85 0.45 0.19 0.78 1.23 0.180.372.170.15 1.19 0.581.220.72 0.671.420.020.12 0.50 0.15 0.81 0.64 0.22 0.05 0.55 0.46 0.830.46 0.56 0.82 0.072.280.34 0.64 0.09 0.77 0.260.45 0.41 0.23 0.16 0.39 0.29 0.62 1.09 0.14 0.49

    0.66 0.89 0.99 0.98 0.95 0.14 0.03 0.012.620.990.081.391.31 0.50 0.74 1.19 0.15 0.14 1.18 1.53Orange - Subtype I Black - Subtype II

    Outcome (H vs. T) in tossing a coin 10 times

    H H T H T T H T T T

    Occurrence of financial crises

    Mexican

    82

    S&L

    84

    Black Mon.

    87

    Comm. RE

    91

    Asian

    97

    LTCM

    98

    Dotcom

    00

    Subprime

    07

    Euro

    12?

    STAT 151 Class 1 Slide 6

    http://find/
  • 8/10/2019 stat151_class1

    7/38

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

  • 8/10/2019 stat151_class1

    8/38

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    Randomness

    Observation fromsurvival timedata - Whydo some patientslivelonger thanothers?

    Subtype I - 1.06 2.17 1.22 1.42 2.28 2.62 1.39 1.18 1.53average 1.65

    Subtype II - 0.67 0.01 0.48 0.85 0.45 0.19 0.78 1.23 0.18 0.37 0.151.19 0.58 0.72 0.67 0.02 0.12 0.50 0.15 0.81 0.64

    0.22 0.05 0.55 0.46 0.83 0.46 0.56 0.82 0.07 0.340.64 0.09 0.77 0.26 0.45 0.41 0.23 0.16 0.39 0.290.62 1.09 0.14 0.49 0.66 0.89 0.99 0.98 0.95 0.140.03 0.01 0.99 0.08 1.31 0.50 0.74 1.19 0.15 0.14average 0.50

    I has a better chance of survival because it has a higher average than II

    There are still variations within each subtype - inevitable in the real world

    We attribute (accommodate) these (unexplained) variations as random

    Chance and randomness can be described using probability theory

    STAT 151 Class 1 Slide 8

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/http://goback/
  • 8/10/2019 stat151_class1

    9/38

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    Definition of probability - Coin tossing data

    Toss 1 2 3 4 5 6 7 8 9

    Outcome H T T H H T H T H

    Proportion

    ofh

    eads

    0.0

    0.2

    0.4

    0.6

    0.8

    1.0

    1 2 3 4 9 50 100 500 1000

    probability = 0.5

    Number of tosses

    The long run proportion (frequency) of heads is the probability of heads.

    STAT 151 Class 1 Slide 9

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/http://goback/
  • 8/10/2019 stat151_class1

    10/38

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    Insight from coin tossing experiment

    Probability is the long run frequency of an outcome

    Probability cannot predict individual outcomes

    However, it can be used to predict long run trends

    Probability always lies between 0 and 1, with a value closer to1 meaning a higher frequency of occurrence

    Probability is numeric in value so we can use it to:

    - compare the relative chance between different outcomes(events)

    - carry out calculations

    STAT 151 Class 1 Slide 10

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    11/38

    y y y

    Probability Axioms - Urn model (1)- drawing marbles from an urn(with replacement)

    12

    4

    3 5Probability

    35

    25

    Draws

    1 2 3 4 5 6 7 8 9 ......

    STAT 151 Class 1 Slide 11

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    12/38

    y y y

    Urn model (2)

    Five possible Outcomes: 1 2 43 5

    Interested in Event A:

    A={ 1 4 5 }; hence an event is a collection ofoutcomes

    P(A) =3

    5

    = 0.6(60%) = Number of marbles in A

    Total number of marbles

    STAT 151 Class 1 Slide 12

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    13/38

    y y y

    Complementary events

    Marbles in urn: 1 2 43 5

    Interested in A: (Not A)

    A

    = 2 3 A, sometimes written as AC, is called the complementaryevent ofA

    Chance of = 1chance of

    P(A) = 1 P(A) = 1 3

    5=

    2

    5

    STAT 151 Class 1 Slide 13

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    14/38

    Joint probability - independent events - Drawing a blue in draw 1 anda green in draw 2 (with replacement)

    Aand B areindependentmeans the occurrence of one event doesnot change the chance of the other

    12

    4

    3 5

    Draws

    1 2

    A= { in 1st draw}

    B= { in 2nd draw}

    P(A) =3

    5

    ; P(B) =2

    5P(Aand B) =

    35

    25

    = 6

    25= P(A)P(B)

    STAT 151 Class 1 Slide 14

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/http://goback/
  • 8/10/2019 stat151_class1

    15/38

    Joint probability and disjoint events

    Two events A and B aredisjoint or sometimes called mutuallyexclusive if they cannot occur simultaneously: P(A and B)=0

    Example

    P( and in a singledraw) = 0

    STAT 151 Class 1 Slide 15

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    16/38

    Conditional probability

    Conditional probability isauseful quantification of howtheassessment ofchance changed due to new information: IfA happened, what is the chance

    ofB?

    The conditional probability of B given A is written as P(B|A)

    Example Drawing marbles WITHOUT replacement

    ?A= { in 1st draw}

    B= { in 2nd draw}

    P(B) =2

    5

    P(B|A) =24

    2

    5

    2

    4because has been drawn

    P(A and B) =2

    4

    3

    5= P(B|A)P(A) =

    6

    20= P(B)P(A)

    ;

    STAT 151 Class 1 Slide 16

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    17/38

    Conditional probability and independence

    The following relationships hold ifA and Bare independent

    P(A|B) = P(A)

    P(B|A) = P(B)

    P(A and B) = P(A)P(B)

    Independence is NOT the same as mutually exclusive (disjoint),which is P(Aand B) = 0.

    STAT 151 Class 1 Slide 17

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    18/38

    The multiplication rule

    P(AB) = P(A|B)P(B) = P(B|A)P(A) Multiplication Rule

    Example

    Marbles in urn: 1 2 43 5

    P( and Odd) = P( |Odd)P(Odd) =

    1

    3

    3

    5

    =

    1

    5

    = P(Odd| )P( ) =

    1

    2

    2

    5

    =

    1

    5

    Rearranging the multiplication rule:

    P(A|B) = P(AB)

    P(B)

    STAT 151 Class 1 Slide 18

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    19/38

    Partition rule

    P( ) = P( and odd) + P( and even)

    = P({ 1 5 }) + P({ 4 })

    = 2

    5+

    1

    5

    = 3

    5

    STAT 151 Class 1 Slide 19

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    20/38

    Union of events (1)

    Unionof events can sometimes be bestvisualized using aVenn diagram(JohnVenn, 1834-1923)Example What is the probability of drawing

    a or an odd number ?

    12

    4

    3 5

    UrnGreen

    Odd

    12

    4

    35

    ;

    STAT 151 Class 1 Slide 20

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    21/38

    Union of events (2)

    P( or odd) = P( ) + P(Odd) P( and odd)

    = 2

    5+

    3

    5

    1

    5

    = 45

    In general, ifAand B are:

    disjoint, then P(A or B) = P(A) + P(B)

    not disjoint, then P(Aor B) = P(A) + P(B) P(AB)

    STAT 151 Class 1 Slide 21

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    22/38

    Probability tree

    Probability tree is useful for studying combination of events. Branches of a tree areconditionalprobabilities.

    ExampleDrawing two marbles from urn without replacement:

    Draw 1

    Draw 2

    P( ) = 35 24

    24

    = P( | )

    P( ) = 35 24

    24 = P( | )

    35

    Draw 2

    P( ) = 25 34

    34

    = P( | )

    P( ) = 25 14

    14 = P( | )

    25

    STAT 151 Class 1 Slide 22

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    23/38

    Bayes Theorem (Thomas Bayes, 1701-1761)

    Trees are useful for visualizing P(B|A) when Bfollows from A in a natural (time)order. Manyproblemsrequire P(A|B), Bayes Theorem provides an answer.

    ExampleTesting for an infectious disease.

    Disease

    Test

    P(D T) = 99100 910

    T

    910

    = P(T|D)

    P(D T) = 99100 110T

    1

    10 =P

    (T|D

    )

    D

    99100

    Test

    P(D T) = 1100 110

    T1

    10

    = P(T|D)

    P(D T) = 1100 910T

    910 = P(T|D)

    D

    1100

    What is P(D|T) or P(D|T)?

    STAT 151 Class 1 Slide 23

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    24/38

    Bayes Theorem (2)

    P(D|T) = P

    (D

    T

    )P(T) =

    P

    (T

    |D

    )P

    (D

    )P(T)

    = P(T|D)P(D)

    P(TD) + P(T D)

    Partition rule

    = P

    (T|D

    )P

    (D

    )P(T|D)P(D) + P(T|D)P(D)

    Multiplication rule

    =9

    10 1100

    910

    1100+

    110

    99100

    = 1

    12

    In general,

    P(A|B) = P(B|A)P(A)

    P(B)

    STAT 151 Class 1 Slide 24

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/http://goback/
  • 8/10/2019 stat151_class1

    25/38

    Data revisited- Discrete vs. Continuous Data

    Discrete - countable number of possible values

    Examples

    (1) Coin Tossing: H H T H T T H T T TTwo possible values: H or T

    (2) Financial crisis: 1982, 1984, 1987,... (No. of crises in adecade)Many possible values: 0, 1, 2, 3, 4,...

    Continuous- values fall in an interval (a, b), acould be andbcould be

    ExampleSurvival time in cancer patients: 0.67 0.01 0.48 1.06 0.85 0.45 ...0 < survival time < a positive number

    STAT 151 Class 1 Slide 25

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    26/38

    First look - summary statistics

    Nave methods

    Numerical summary: Min, max, mean, variance, etc.Graphical summary: Histogram, pie chart, bar graph, etc.Tabular summary: Tables of frequencies

    Attributes

    Quick and dirtyIdentify potential problems, errors

    Flaws

    Difficult to generalize especially when the dataset iscomplicatedNot easily portable cannot describe a chart or graph unlessyou can see it!

    STAT 151 Class 1 Slide 26

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    27/38

    What do we do about data?

    Financial crises data

    Mexican

    82

    S&L

    84

    Black Mon.

    87

    Comm. RE

    91

    Asian

    97

    LTCM

    98

    Dotcom

    00

    Subprime

    07

    Euro

    12?

    We may be interested in X, the number of crises in the next decade. Possible questions:

    What is the probability ofX=0, or 1, or 2, or 3 or...?Probability distribution - tells us the long run frequencies (chances) of the possibleoutcomes

    On average, how many crises in a decade?Expectation (Expected value) - tells us the weighted average of the possibleoutcomes, where the weights are the probabilities

    How likely will Xdiffer from the expected?Standard deviation (Variance) - tells us the weighted average of deviations of thepossible outcomes from the expected value

    STAT 151 Class 1 Slide 27

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    28/38

    Discrete distributions - Tossing a coin

    (H) or (T) ?

    Long run frequencies

    H T

    12

    12

    The long run frequencies are 1/2 each forH and T there is equal chance for H or T

    ;

    STAT 151 Class 1 Slide 28

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/
  • 8/10/2019 stat151_class1

    29/38

    Discrete distributions - Drawing a marble

    1 24

    3 5

    1 2 3 4 5 ?

    1 2 3 4 515

    15

    15

    15

    15

    35

    25

    ;

    The long run frequencies tell us there is equal chance for 1, 2, 3, 4and 5 but there is a higher chance for blue than green

    STAT 151 Class 1 Slide 29

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    http://find/http://goback/
  • 8/10/2019 stat151_class1

    30/38

    Discrete probability distributions

    X H T

    P(X) 1212

    X 1 2 3 4 5

    P(X) 1515

    15

    15

    15

    35

    25

    X a1 a2 a3 ...

    P(X) P(a1) P(a2) P(a3) ...

    Probability distribution function

    ;

    A probability distribution summarizes the long run frequencies (chances) of thepossible outcomes ofX

    STAT 151 Class 1 Slide 30

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    P b bili di ib i f di d i bl

    http://find/http://goback/
  • 8/10/2019 stat151_class1

    31/38

    Probability distribution for a discrete random variable

    X is the unknown outcome.X is called a discreterandomvariable ifits value can onlycomefrom a countable

    number of possible values: a1, a2, ...,ak.Examples

    Coin toss: X= H or T (2 possible values)Marbles: X= 1, 2, 3, 4, or 5 (5 possible values)Financial crisis: X= 0, 1, 2, 3,... (Infinite but countable number of possiblevalues)

    P(X = ai) gives the probability X = aiand is called a probability distributionfunction.A valid probability distribution function must satisfy the following rules:

    P(X = ai) must be between 0 and 1

    We are certain that one of the values will appear, therefore:

    P(X = a1 or X = a2 or ...X = ak) = P(X = a1) + P(X = a2) + ... + P(X = ak) X=a1,X=a2,...are disjoint events

    = 1

    STAT 151 Class 1 Slide 31

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    E l P b bili di ib i f h b f d i bl

    http://find/
  • 8/10/2019 stat151_class1

    32/38

    Example: Probability distribution of the number from drawing a marble

    X 1 2 3 4 5P(X) 0.2 0.2 0.2 0.2 0.2

    P(X= 1) = 0.2

    P(X 3) = P(X= 3) + P(X= 4) + P(X= 5) = 0.6

    P(X = 1.5) = 0

    P(X

    >5) = 0

    1 = P(X= 1)+P(X= 2)+P(X= 3)+P(X= 4)+P(X = 5)

    STAT 151 Class 1 Slide 32

    http://find/
  • 8/10/2019 stat151_class1

    33/38

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    P b bilit dist ib ti f ti s d i bl

  • 8/10/2019 stat151_class1

    34/38

    Probability distribution for a continuous random variable

    A continuous randomvariable, X, is a random variable withoutcomethat fallswithin a range or interval, (a, b)

    Examples

    X= survival time of a patient: (a, b) = [0, 150] yearsX= return from an investment of 10000; (a, b) = [10000,) dollarsX= per capita income; (a, b) = [0, 1000000000000] dollars

    The probability distribution ofX

    is defined by a (probability) densityfunction (PDF), f(x). The interpretation of f(x) is similar to probability butthere are subtle differences:

    f(x) 0 for any value ofx in (a, b)f(x) = P(X = x) = 0 for any value of xP(r X s) = P(r < X < s)

    since P(X=r)=P(X=s)=0

    probability ofX between r and s

    P(a X b) = 1 since Xmust fall within (a, b)

    Thecumulative distribution function (CDF for short), written as F(x), isdefined as P(X x)

    STAT 151 Class 1 Slide 34

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    Example survival data

    http://find/
  • 8/10/2019 stat151_class1

    35/38

    Example - survival data

    Density of survival time

    X (Timeinyears)

    Den

    sity

    0 1 2 3 4 5

    f(x)= 1.5e1.5x

    f(x) =ex, >0 is called an

    exponential density

    Different values ofcan be usedto model different populations

    All exponential densities have the

    same shape but different gradientsso it is easy to describe to others

    Allows us to make probabilitystatements about survival times wehave and have notobserved

    The area under f(x) is 1 whichmeans the probability of dyingbetween time 0 and is 1

    STAT 151 Class 1 Slide 35

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    Some calculations

    http://find/
  • 8/10/2019 stat151_class1

    36/38

    Some calculations

    X (Timeinyears)

    De

    nsity

    0 1 2 3 4 5

    f(x)= 1.5e1.5x

    P(X >2) = 0.049 is theredarea under the curve and can beobtained by analytical or numerical (computer) analysis

    STAT 151 Class 1 Slide 36

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    Some calculations

    http://find/http://goback/
  • 8/10/2019 stat151_class1

    37/38

    Some calculations

    X (Timeinyears)

    De

    nsity

    0 1 2 3 4 5

    f(x)= 1.5e1.5x

    P(X 1) = P(0< X 1) = 0.776 is theredarea under the curveand can be obtained by analytical or numerical analysis.

    STAT 151 Class 1 Slide 37

    Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous

    Some calculations

    http://find/
  • 8/10/2019 stat151_class1

    38/38

    Some calculations

    P(X 2|X >1) = P(1< X and X 2)

    P(X >1)

    conditional probability

    = P(1< X 2)P(X >1)

    = 1 P(X 1) P(X >2)

    1 P(X 1)

    = 1 0.776 0.049

    1 0.776= 0.781

    STAT 151 Class 1 Slide 38

    http://find/