北大暑期课程《回归分析》LinearRegressionAnalysis讲义1上课讲义.docx
- 文档编号:30531234
- 上传时间:2023-08-16
- 格式:DOCX
- 页数:15
- 大小:78.12KB
北大暑期课程《回归分析》LinearRegressionAnalysis讲义1上课讲义.docx
《北大暑期课程《回归分析》LinearRegressionAnalysis讲义1上课讲义.docx》由会员分享,可在线阅读,更多相关《北大暑期课程《回归分析》LinearRegressionAnalysis讲义1上课讲义.docx(15页珍藏版)》请在冰豆网上搜索。
北大暑期课程《回归分析》LinearRegressionAnalysis讲义1上课讲义
Class1:
Expectations,variances,andbasicsofestimation
Basicsofmatrix
(1)
I.OrganizationalMatters
(1)Courserequirements:
1)Exercises:
Therewillbeseven(7)exercises,thelastofwhichisoptional.Eachexercisewillbegradedonascaleof0-10.Inadditiontothegradedexercise,ananswerhandoutwillbegiventoyouinlabsections.
2)Examination:
Therewillbeonein-class,open-bookexamination.
(2)Computersoftware:
Stata
II.TeachingStrategies
(1)Emphasisonconceptualunderstanding.
Yes,wewilldealwithmathematicalformulas,actuallyalotofmathematicalformulas.But,Idonotwantyoutomemorizethem.WhatIhopeyouwilldo,istounderstandthelogicbehindthemathematicalformulas.
(2)Emphasisonhands-onresearchexperience.
Yes,wewillusecomputersformostofourwork.ButIdonotwantyoutobecomeacomputerprogrammer.Manypeoplethinktheyknowstatisticsoncetheyknowhowtorunastatisticalpackage.Thisiswrong.Doingstatisticsismorethanrunningcomputerprograms.WhatIwillemphasizeistousecomputerprogramstoyouradvantageinresearchsettings.Computerprogramsarelikeautomobiles.Thebestautomobileisuselessunlesssomeonedrivesit.Youwillbethedriverofstatisticalcomputerprograms.
(3)Emphasisonstudent-instructorcommunication.
Ihappentobelieveinstudents'judgmentabouttheirowneducation.EventhoughIwillbeultimatelyresponsibleiftheclassshouldnotgowell,Ihopethatyouwillfeelpartoftheclassandcontributetothequalityofthecourse.Ifyouhavequestions,donothesitatetoaskinclass.Ifyouhavesuggestions,pleasecomeforwardwiththem.Theclassisasmuchyoursasmine.
Nowletusgettotherealbusiness.
III
(1).ExpectationandVariance
RandomVariable:
Arandomvariableisavariablewhosenumericalvalueisdeterminedbytheoutcomeofarandomtrial.
Twoproperties:
randomandvariable.
Arandomvariableassignsnumericvaluestouncertainoutcomes.Inacommonlanguage,"giveanumber".Forexample,incomecanbearandomvariable.Therearemanywaystodoit.Youcanusetheactualdollaramounts.
Inthiscase,youhaveacontinuousrandomvariable.Oryoucanuselevelsofincome,suchashigh,median,andlow.Inthiscase,youhaveanordinalrandomvariable[1=high,2=median,3=low].Orifyouareinterestedintheissueofpoverty,youcanhaveadichotomousvariable:
1=inpoverty,0=notinpoverty.
Insum,themappingofnumericvaluestooutcomesofeventsinthiswayistheessenceofarandomvariable.
ProbabilityDistribution:
TheprobabilitydistributionforadiscreterandomvariableXassociateswitheachofthedistinctoutcomesxi(i=1,2,...,k)aprobabilityP(X=xi).
CumulativeProbabilityDistribution:
ThecumulativeprobabilitydistributionforadiscreterandomvariableXprovidesthecumulativeprobabilitiesP(X≤x)forallvaluesx.
ExpectedValueofRandomVariable:
TheexpectedvalueofadiscreterandomvariableXisdenotedbyE{X}anddefined:
E{X}=
P(xi)
where:
P(xi)denotesP(X=xi).ThenotationE{}(read“expectationof”)iscalledtheexpectationoperator.
Incommonlanguage,expectationisthemean.Butthedifferenceisthatexpectationisaconceptfortheentirepopulationthatyouneverobserve.Itistheresultoftheinfinitenumberofrepetitions.Forexample,ifyoutossacoin,theproportionoftailsshouldbe.5inthelimit.Ortheexpectationis.5.Mostofthetimesyoudonotgettheexact.5,butanumberclosetoit.
ConditionalExpectation
Itisthemeanofavariableconditionalonthevalueofanotherrandomvariable.
Notethenotation:
E(Y|X).
In1996,per-capitaaveragewagesinthreeChinesecitieswere(inRMB):
Shanghai:
3,778
Wuhan:
1,709
Xi’an:
1,155
VarianceofRandomVariable:
ThevarianceofadiscreterandomvariableXisdenotedbyV{X}anddefined:
V{X}=
(xi-E{X})2P(xi)
where:
P(xi)denotesP(X=xi).ThenotationV{}(read“varianceof”)iscalledthevarianceoperator.
SincethevarianceofarandomvariableXisaweightedaverageofthesquareddeviations,(X-E{X})2,itmaybedefinedequivalentlyasanexpectedvalue:
V{X}=E{(X-E{X})2}.Analgebraicallyidenticalexpressionis:
V{X}=E{X2}-(E{X})2.
StandardDeviationofRandomVariable:
ThepositivesquarerootofthevarianceofXiscalledthestandarddeviationofXandisdenotedbyσ{X}:
σ{X}=
Thenotationσ{}(read“standarddeviationof”)iscalledthestandarddeviationoperator.
StandardizedRandomVariables:
IfXisarandomvariablewithexpectedvalueE{X}andstandarddeviationσ{X},then:
Y=
isknownasthestandardizedformofrandomvariableX.
Covariance:
ThecovarianceoftwodiscreterandomvariablesXandYisdenotedbyCov{X,Y}anddefined:
Cov{X,Y}=
where:
P(xi,yj)denotes
)
ThenotationofCov{,}(read“covarianceof”)iscalledthecovarianceoperator.
WhenXandYareindependent,Cov{X,Y}=0.
Cov{X,Y}=E{(X-E{X})(Y-E{Y})};Cov{X,Y}=E{XY}-E{X}E{Y}
(Varianceisaspecialcaseofcovariance.)
CoefficientofCorrelation:
ThecoefficientofcorrelationoftworandomvariablesXandYisdenotedbyρ{X,Y}(Greekrho)anddefined:
where:
σ{X}isthestandarddeviationofX;σ{Y}isthestandarddeviationofY;CovisthecovarianceofXandY.
SumandDifferenceofTwoRandomVariables:
IfXandYaretworandomvariables,thentheexpectedvalueandthevarianceofX+Yareasfollows:
ExpectedValue:
E{X+Y}=E{X}+E{Y};
Variance:
V{X+Y}=V{X}+V{Y}+2Cov(X,Y).
IfXandYaretworandomvariables,thentheexpectedvalueandthevarianceofX-Yareasfollows:
ExpectedValue:
E{X-Y}=E{X}-E{Y};
Variance:
V{X-Y}=V{X}+V{Y}-2Cov(X,Y).
SumofMoreThanTwoIndependentRandomVariables:
IfT=X1+X2+...+Xsisthesumofsindependentrandomvariables,thentheexpectedvalueandthevarianceofTareasfollows:
ExpectedValue:
;
Variance:
III
(2).PropertiesofExpectationsandCovariances:
(1)PropertiesofExpectationsunderSimpleAlgebraicOperations
Thissaysthatalineartransformationisretainedaftertakinganexpectation.
iscalledrescaling:
isthelocationparameter,
isthescaleparameter.
Specialcasesare:
Foraconstant:
Foradifferentscale:
e.g.,transformingthescaleofdollarsintothescaleofcents.
(2)PropertiesofVariancesunderSimpleAlgebraicOperations
Thissaystwothings:
(1)Addingaconstanttoavariabledoesnotchangethevarianceofthevariable;reason:
thedefinitionofvariancecontrolsforthemeanofthevariable[graphics].
(2)Multiplyingaconstanttoavariablechangesthevarianceofthevariablebyafactoroftheconstantsquared;thisistoeasyprove,andIwillleaveittoyou.Thisisthereasonwhyweoftenusestandarddeviationinsteadofvariance
isofthesamescaleasx.
(3)PropertiesofCovarianceunderSimpleAlgebraicOperations
Cov(a+bX,c+dY)=bdCov(X,Y).
Again,onlyscalematters,locationdoesnot.
(4)PropertiesofCorrelationunderSimpleAlgebraicOperations
Iwillleavethisaspartofyourfirstexercise:
Thatis,neitherscalenorlocationaffectscorrelation.
IV:
Basicsofmatrix.
1.Definitions
A.Matrices
Today,Iwouldliketointroducethebasicsofmatrixalgebra.Amatrixisarectangulararrayofelementsarrangedinrowsandcolumns:
Index:
rowindex,columnindex.
Dimension:
numberofrowsxnumberofcolumns(nxm)
Elements:
aredenotedinsmallletterswithsubscripts.
Anexampleisthespreadsheetthatrecordsthegradesforyourhomeworkinthefollowingway:
Name1st2nd....6th
A710......9
B65......8
............
Z89......8
Thisisamatrix.
Notation:
IwilluseCapitalLettersforMatrices.
B.Vectors
Vectorsarespecialcasesofmatrices:
Ifthedimensionofamatrixisnx1,itisacolumnvector:
Ifthedimensionis1xm,itisarowvector:
y'=|
....
|
Notation:
smallunderlinedlettersforcolumnvectors(inlecturenotes)
C.Transpose
Thetransposeofamatrixisanothermatrixwithpositionsofrowsandcolumnsbeingexchangedsymmetrically.
Forexample:
if
Itiseasytoseethatarowvectorandacolumnvectoraretransposesofeachother.
2.MatrixAdditionandSubtraction
Additionsandsubtractionoftwomatricesarepossibleonlywhenthematriceshavethesamedimension.Inthiscase,additionorsubtractionofmatricesformsanothermatrixwhoseelementsconsistofthesum,ordifference,ofthecorrespondingelementsofthetwomatrices.
Examples:
3.MatrixMultiplication
A.Multiplicationofascalarandamatrix
Multiplyingascalartoamatrixisequivalenttomultiplyingthescalartoeachoftheelementsofthematrix.
B.MultiplicationofaMatrixbyaMatrix(InnerProduct)
TheinnerproductofmatrixX(axb)andmatrixY(cxd)existsifbisequaltoc.Theinnerproductisanewmatrixwiththedimension(axd).TheelementofthenewmatrixZis:
c
k=1
NotethatXYandYXareverydifferent.Veryoften,onlyoneoftheinnerproducts(XYandYX)exists.
Example:
BAdoesnotexist.ABhasthedimension2x1
Otherexamples:
If
whatisthedimensionofAB?
(3x3)
If
whatisthedimensionofBA?
(5x5)
If
whatisthedimensionofAB?
(1x1,scalar)
If
whatisthedimensionofBA?
(nonexistent)
4.SpecialMatrices
A.SquareMatrix
B.SymmetricMatrix
Aspecialcaseofsquarematrix.
For
.Alli,j.
A'=A
C.DiagonalMatrix
Aspecialcaseofsymmetricmatrix
D.ScalarMatrix
E.IdentityMatrix
Aspecialcaseofscalarmatrix
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 回归分析 北大 暑期 课程 回归 分析 LinearRegressionAnalysis 讲义 上课
![提示](https://static.bdocx.com/images/bang_tan.gif)