Bayes’ Rule)(
)()|(
)|(
dP
hPhdP
dhp ) data the seen having after hypothesis ofty (probabili posterior
data) the ofy probabilit (marginal evidence data
is hypothesis the if data the ofty (probabili likelihood
data)any seeing before hypothesis ofty (probabili belief prior
dh
h
h
:)|(
:)()|()(
true) :)|(
:)(
dhP
hPhdPdP
hdP
hP
h
sides both on
y probabilitjoint same the
),(),(
)()|()()|(
grearrangin -
(model) hypothesish
datad
rule Bayes'ingUnderstand
hdPhdP
hPhdPdPdhp
•Ex:)(
)()|(
)|(
CP
YesRainPYesRainCP
CYesRainP
)conditionsclimatic the on based Rain getting ofty (probabili Posterior
evidence? getting ofy probabilit the is what(Rain) outcome past the (Given likelihood
) Rain the getrting ofty (probabili belief prior
:)|(
evidence thegetting ofy probabilitPrior :)()|()(
) :)|(
:)(
CRainP
RainPRainCPCP
RainCP
RainP
h
Example of BayesTheorem
•Given:
•A doctor knows that covid causes fever 50% of the time
•Prior probability of any patient having covid is 1/50,000
•Prior probability of any patient having fever is 1/20
•If a patient has fever, what’s the probability he/she has covid?0002.0
20/1
50000/15.0
)(
)()|(
)|(
SP
MPMSP
SMP
Linear Regression
•Thelinearregressionmodelassumesthattheresponsevariable(y)isa
linearcombinationofweightsmultipliedbyasetofpredictorvariables
(x).Thefullformulaalsoincludesanerrortermtoaccountforrandom
samplingnoise.Forexample,ifwehavetwopredictors,theequation
is
•yistheresponsevariable(alsocalledthedependentvariable)
•β’saretheweights(knownasthemodelparameters),
•x’sarethevaluesofthepredictorvariables,and
•εisanerrortermrepresentingrandomsamplingnoiseortheeffectof
variablesnotincludedinthemodel.
•Theclosedformsolutionexpressedinmatrixformis:
•Thismethodoffittingthemodelparametersbyminimizingthe
RSS/MSEiscalledOrdinaryLeastSquares(OLS).
•Whatweobtainfromfrequentistlinearregressionisasingleestimate
forthemodelparametersbasedonlyonthetrainingdata.Ourmodelis
completelyinformedbythedata:inthisview,everythingthatweneed
toknowforourmodelisencodedinthetrainingdatawehave
available.
•Oncewehaveβ-hat,wecanestimatetheoutputvalueofanynewdata
point by applying our model equation: