### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# Special Topics PSCI 7108

GPA 3.66

### View Full Document

## 7

## 0

## Popular in Course

## Popular in Political Science

This 49 page Class Notes was uploaded by Modesto Renner on Thursday October 29, 2015. The Class Notes belongs to PSCI 7108 at University of Colorado at Boulder taught by Staff in Fall. Since its upload, it has received 7 views. For similar materials see /class/231928/psci-7108-university-of-colorado-at-boulder in Political Science at University of Colorado at Boulder.

## Reviews for Special Topics

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/29/15

Uriivariate Time Series Stationary and Nonstationary Series Strictly Stationary Processes I Issues relating to the stationarity of a time series are im ortant because they he p us understand the behavior and properties ofa series I A series that is not stationary has some undemrable properties that make hypothesis testing umng standard techniques incorrect I A series is strictly stationary if the distribution ofits values remains e same as time progresses e probability that falls Within a particular interval is the same now as at any time in the past or future A Weakly Stationary Series I If a series satis es the follovnng conditions for t1 2 3 00 it is said to be weakly or covariance stationary 1 EU u 2 Myriam ltoo 3 EU 7 in 722417 VIM I 1 means that the series has constant mean I 2 means that the series has constant variance I 3 means that the series has constant autocovariance Autoc ova mc e I Autocovanance dete1m1ne5 howy 15 related to 1t5 premou5 Value5 For a 5tnct1y or weakly 5tat1onary 5e11e5 they depend only on the d1fference between 7 and 1 5o that the covanance between7 andV7 15 the 5ame as the covanance betweenJHo andH7 I The moment EU EUJWH E07 773 012 15 the autocovanance functton When 50 the autocovanance at lagzero 15 obta1ned covanance of Autoc ortelation I Recall that the covanance 15 not that u5eful ofa mea5ute a5 1t depend5 on the un1t5 of measurement of I Autocorrelatton covanance5 normahzed by d1v1d1ng by 7 7n I The 5e11e5 To has the 5tandaId propeme5 of correlauon coef c1ent5 7 1t 15 bounded by ii I Ifwe plot Ts agaJn5t 5 we get the autocorrelatton functton acf or correlogram Autocorrelation of tbill ac tbi l l u mmmmmmm mm mm Autocoiielation of grow a 3 gr ow Ammanquot m WW am am am an nan nan Itup39quot 1111quotIT39luv quot111quot39Lu m m uv n quotWWWis mm mm A Xhite Noise Process I De nition 3 white noise process is one With on discernible structure Formally 7 5 mm m utherwxse I A white noise process has constant mean and VZHZI ACE and zero autocovanances except at lag zero Generating Xhite Noise in STATA gen 21nvnurmlun1furmlH tsllne e ITLMALW W Testing Autocorrelations I If the process that generates yt ha5 a 5tahdard normal d15tr1buuon then the 5arnple autocorrelauon coef c1ent5 are al5o d15tr1buted norm y let5 U5 con5truct con dence 111terval5 for autocorrelatton5 5ee ac grap 5 a oVe I It 15 al5o po551ble to te5t theamt Wt em that all m of the 1k correlatton5 coef c1ent5 are mutmeamgy equal to zero u5mg the Q 5tat15t1c developed by Box and P1erce 1970 BP Q75tat15t1C Q T2 f kl I The correlatton coef c1ent 15 5quared 5o that the po51t1ve and negattve coef uent5 do not cancel each other out The Q75tat15t1c 15 a5yrnptot1cally d15tr1buted a5 X7 w1th df equal to the number of5quare5 111 the 511m I However the BoXIP1erce te5t ha5 mall 5arnple propeme5 leadmg to 1ncorrect 1nference5 1h mall 5arnple5 LjungIBox 1978 Q I LJuthBoX Q 5tat15t1c f Tile 940 15 I A5yrnptot1cally the T2 and Tik terrn5 cancel each other out 5o that the LB forrnulatton 15 eqmvalent to the BP te5t xaidmexa umammm mum a mex nna uuuuu Lunzrqa lt qua vgs39gvz Iususas my mmde astnu 3391th m use usaausunxnd 00591 MOIb bqsequm lmmumxm ummmmm Mm n m av m mm M n mum uzxsu 1mg mmquot VLVLS U 8311811215 b Stationarity and unit root testing Focus on tests for weak statlonanty Recall that weak stauonarlty reqques constant mean constant Vanance an constant autocovanance for each lag I Why 15 stauonanty 1rnportantgt 7 The statlonarlty ofa senes can lnt luence Its behavior For example we use the word shoclf to denote an unexpected change m the Value of a Vanab1eor ettOt Fat a Statlonary serles a shock wm gradually che away That ls the effect of a shock durmg tlme t will have a smaller effect m tlme t1 a sma11et effect m tlme t2 etc 7 A shock to a nonestatlonary senes will be ln nlte 7 The use of nonestatlonary data can lead to 4231471014 72g an 512115th on the slope to notbe dltfetent from zero and the value ofR2 to be zero 7 Thls may seem obmous but 1f two senes ate trendlng over tlme then a tegtesmh ofone on another could have a hlgh Rzand a testatlstlc that IS dltfetent from zero even 1f the two senes are totally unrelated Two Types of NoneStationarity 1 Random Walk wth a Drift y yt71ut 2 Trendestatlonary process stauonary around a trend y ot lut I Note that the random walk model can be generzhzed to the ca5e where 15 an explomve process y WM u Where lt1gtgt1 In practtce th15 case 15 often 1g10red becau5e there are few 5er1e5 where th15 condmon 15 5at15 ed The two more relevant ca5e5 are Z1 and lt1gtlt1 Random Walk 1 Ya U 1 95yn U Vt m U39 quotW 121 Explosive Case Vt 11 1 24 c TrendiStationary Case 39 Recall y ot tur X u run a regression on thls model and obtam the esxduals whxch would have the lmea trend removed sec abs mu g2 c gen 2nvnaxmlumfaxmlll Essen gen y2m llne y Diffe rencing I If a nonistauonary ser1es yt must be d1fferenced d DIDES before 1t becomes stauonary then 1t1s sa1d to be Lntegrated of order d I Thls 1s wrltten ytld I If ytld then Adytl0 Thls means that applang the drfference operator A d DIDES leads to an l0 process 7 a process wth no unlt roots Testing for Unit Roots I One approach would be to exarnlne the autocorrelatton functton ofthe ser1es oflnterest Thls would be anorrect however because the ACF for a unlt root process a random walk w l look ltke 1t decays slowly to zero Thus 1t may be mlstaken for a highly pers1stent but pers1stent process I Thus ACFs cannot be used to test for unlt roots Dickey Fuller Test I Baslc 1dea 1s to test ltigtZl Ln y 17844 11 Agalnst the one7s1ded alternattve ltigtltl The hypotheses of Lnterest are Hnser1es contams a umt root HAser1es IS statlonary ln practtce we esttmate Ay WAyH 4 so that a test ofltigtl 1s equlvalent to a test oleFO Dickey Fuller Tests in Stata quotMum mum smut m m PhillipsePetron Tests just lxke DleCyrFuller tests but they mclude an automath correctlon to t e D procedure to allow for autoconelated residuals The tests often gwe Similar results Criticism ofDF and PP Tests The most unportzht cnttclsm 1s that that power 1s 10w 1f 3 process 1s stattohzry but wth a root close to the honestauohzry boundary for example 295 I Altemauve 1s the KPSS test kpss is a user written do le Next Topics I Usmg tune senes m regessmn 7 Instrumental Vanables 7 Vector Autoregresslon 7 Causahty NONSTATIONARY TIME SERIES COINTEGRATION and VECTOR AUTOREGRESSION NO S tationzry proces 565 Lots ofhme senes exhlblttrmds m the mean mdorvanmce N M opinion ate nonstahonary relationship among stahonaxy vanables temew these ideas and Introduce the notion of comtegmhon Conditions for stationa ty data senes ls mvanzntwnh xespectto hme process is nonrstahonary The charactenshcs we focus on ate mean vananoe and oovananoes estamated tom past data n relationship among stahonaxy vanables Conditions for stationaiity Assume a scoohasuo ume senes 1 jrwhexethexe are Tobsexvahons the followlng requirements E y is independent of I varyt is a constant independent of I covyt yS is a function of IS but not of I or S Conditions for stationaiity Eyt is independent of I that mean This lmphes thatthe expected value wlllbe the sameln any penod Note this would not be sausfled by GDP interest ates or oplnlon An example Take a simple Aka model 3 0 1 lyta 8r So the stable mean xequlxes that 7 lslessrlaan1 Eyt7Eytil EUf Conditions for stationaiity V3304 is a constant independent of I This means thatthe senes musthave a constant Vanznce A nonrstatlonary senes has anomonstmt Vanzncetendmg to infinity Exchange ates and stockpnces tend to have nonrconstznt vehmees Conditions for stationaiity COVUt ye is a function of 13 but not of I or S only how at apart they ate in me not the me atwhich they oecut Some de nitions A stzhonaxy senes is smdto bemtegmted otOtdeto 010 A nonstationary senes is smd to be integrated of Order d 0t 1a This lmphes you have to difference the senes d hmes to make It stahonaxy 1 can Thus the firstrdiffexenced senes ls stahonaxy Spurious regressions regression cottelnnon among the xeslduzls ln oonventlonnl tegtesston models usually nnlslendlng even ltthete was ln fact none Spurious regressions TnPnr L 4 11gt L relahonshp Hence the term quotspurious tegtesston quot So the term tetets to tegtesstons that quot10013006quot e hlgh szalues slgmflcznt smashes 7 but whlch have no mennlng Spurious regressions A spurious tegtesston ls hkely when the model looks lllte As n result the NT the denommntot tn the OLS esnnnntot of 9 does not lntetenoe procedures nte not Valld Spurious regressions mndom walks J and x that wete uncottelated wlth each othet They tegtessedj on Xand found that ln 75 pet cent of cases the ttest on then xe1ected the null that ltwas zeto So ln 75 pet cent otthe cases a spunous slgm cznt telauonshlp was found Spurious regressions performed 7 the thendedto be hl 7 km Dw stausucs wete obsemed 7 the ttests wete Very rmsleadlng andlngs The lnmal soluuonwas to use tustdlttetences Now researchers stst test tot colntegmhon between J and x First differences So ln flzstrdlfference form the xegxesslon would be Ayt a1 lm Vt Vt St 7871 process whlch ls autoconelated In thls case the OLS estarnates ate shll conslstent although lnefflclmt the hypothesls tesung First differences great cate This ledto workbang donem differences Detrending data Nonrstahonaxy data must have the ttend removedbefore you can use it Thete ate two common approaches to this 7 detxendmg usmg a me ttend 0t some detemmsue funth of me e um dettetenees Xhxch approach is the best Detrending data It depends on the source otthe nonrstahonanty We have to two types of nonrstahonanty e deterrmmshc trendbehavxour e stochastic 0t random ttend behaviour Deterministic trends anda mudam component yr f t 8t at Niid 00quot2 We mightwnte this as a meat ume trend pmess y a tst that can be used in regression analysis 5Fyt 07 l339t Deterministic trends proces ses y Newbold 1974 trending behavior follow scochasuc trends By direct Substitution Stochastic Trends A common model is the random wamwma a daft y D erts rgt 8t N iid0o z y ZHHSH 10 possiblywith a nonrzexo mean Stochastic trends daffexencedsenes that Is a functan utthe constant and an aunt yr D erte gt ytiytilagt Ayt Dl8t stationary DSP process otra Trend 2nd Difference stationary processes So we can have two types oftxendmg nonrstahonary sen e A senes which can be rmdexed stationary by taking dnffexences 15 called a differencestahonmy DSP process L L L L A A m A trend is called a trendstahonary TSP process We need to compaxeTSFs to DsPs to understandwhatthexssues are tem mu yteld totally dnfferent outcomes stahonanty ls Tracing the DSP history We can see ths by stamng both processes off attxme 0 mum 1 ThesuccesswevabesoftheD at y1y0a81 y27y1a82y0a28182 ytyoon vt t v 8 111 Comparing the TSP and DSP The TSP is y yo t 8 The DSP IS because the vananee om 15 equal to alt Implications becaus e 1 and rare nonrstahonary The xesicmals mm that regression willnotbe mummy Unit root testing The tests have become known as unit root tests mo in a polynomal Unit roots Take a simple AR1 process yr 0044 gt We can wnte this in lag operator form as P010t 8 Unit roots Underwhat conditions wtu this process be stationary Ifthe root of leoL0 IS greaterthan one m absolute value The root IS L1a Unit roots So foxL gt 1we require 71ltzzlt1 IfL 1 for ample then the process 15 nonrstationary This IS a umt root process and would lmply that 011 Testing for a unit root So an obmous testm t D J H 8 Is to test whether usmg a Letest Under Huthe senesy IS a DSP orI1 Fuller m mi STATA Augmented Dickeye Fuller tes ts for a unit root Thete ate a few Variants to the DickeyrFullex 1979 test The test is Vahd only xfthe errors m the test tegtesston ate whxte hotse to msute that the residuals ate semlly uncorrelated p s YH a2t ZBiAytrHl 8t i2 Augmented Dickeye Fuller tests for a unit root Appropnate cubical Values atttet for each V211an of the test Zivot and Ahdtews 1992 suggest tests that allow for bxeahng ttehds p AYt 30 YH azt Z BiAytrHl 8t i2 Cointegration usan nonstahonary undaffexenced data An equxhbnum can be de ned as some long tun steady state We rmght de ne the longrmn steady state as a y ytytrlyt72quot39 The process wm stay In ths equmbnum unm 1L1 shocked Cointegration yanables x andy y D thsyrefr x Wr71gr In the steadyesmte ye a 6 7xs 1T5 1T5 Cointegration Butm a differenced model the steadyrstate dnffexences are allzexo Aye Myth Axt 7M4 V There 15 thus no 1onng soluuon The rst dxfferenced equauon only desmbes shortrrun relauonshxps levels not dxffermces Cointegration DSP s The answetls yes unless The DSP s ate colntegmted Thls development oarne lnlhally torn Glanget 1981 Cointegration If a senes follows a mndomwalkthen ln fust cllttetenoes lt ls stahonmy 11 In thls oase e senes ls lntegmted of oldet 1 ot A stahonmy senes ls lntegmted of oldet 0 ol10 11 yanable you can get a spunous tegtesslon The teslcluals ln thls oasewlll be nonrstahonmy11 yanables ln the teglesslon So two 10 yanables wlll ptocluoe 10 teslduals And two 11 yanables wlll usually ptocluoe 11 teslduals Cointegration Thete ls one case whete thls ls not so Thatls the case called comtegmhon teslduals 1n thls ease you can tun tegtesslons on leyels wlthout 105mg any quotlongrxunquot lnfoxrnahon and not encounter the spunous tegtesslon ptoblena txmdmg together such that the difference between them ls stauonaly teslduals wlll be 10 Cointegration a xtgt ytxt11 Ithe llnear comblnatlon 8 yr iai x I0 Theay and x are eomlegaled A Simple Test For Cointegration Ths test ls dueto Engle and Gangs 1987 Esamace the followmg regression model m levels yr m x a ryext 11 Perform an Augmmted chkeyeFullerLesL oh the reslduals F t 8H 211 Aspp error 11 The hull hypoLhesls HE M Thls means that the reslduals have a null root and therefore y and x are nm eomlegaled The levelsregesslon IS spunous Ifthe reslduals are 10 Lheny and are colntegated The cntlcal values are avallable h an565 1998 Table 101 An ErroreCorrection Model exlsts a shomuh em correcting model P 397 Ay 9yH 706 xewZr xm Zplz ym u 10 11 Thls form allows longrrun com onean ofvarlables lo obey equlllbrlum relauonshlps the levels colntegratlng relauonshlp The larger Lhe qulcker a senes adjusts to longrrun equlllbnum slahdard regresslon analysls applles VECTOR AUTOREGRESSION Mouvauon own past hstones and the pasthxstones ofthe othetvaaables vanab1es m questaon e Nohon o predictive toteoastmg says that mtomataon m the hstory of one to lust toteoastang tom the htstoty of the second vanable 7 Useful tot Gtanget causahty testang ootteotaon meohamsm VE Cuttent quotoonttovetstf ls concemedthh themcoxpomhon of quotpnorsuwlthm an exphatBayesmn fmmewoxk Paots regarding laglength pametetvalues causahty VECTOR AUTOREGRESSION Constdet a bwanate firstrorderVectorautoregresslon VAR Y 10 122 Y11YH Y12Zt71 Syt Z bzo b21Yt Y21YH Y22Zt71 Szt The two vauables y and ate endogenous a demataons oy and o anda zero oovananoe Note a shockaw affects y duectly and mduectly Note thete ate 10 pammetexs to estamate Transform to a Standard VAR1 estamates of the coeffxcxents m the stmotutal VAR1 The stmctuml VAR is not a teduoed foxrn To solve to a teamed fozrnwnte the stmctuml VAR m mamx foxrn as 1 be yt bm v V yet 8y ba 1 Zt bzn V21 v22 ZH a BXLI zt 1quot1xH 3t Transform to a Standard VAR1 Premulhphcahon by Bquot allows us to obtam a standard VAR1 th I D 1quotle 3 x1 Bquot1quotU BquotI 1XH Bquotal xt A Ale 91 Thls can be esumased by OLS whlch ylelds oohslssens esumases The VAR ls used to exzmme the lntenelahonshlps among yauables equlyalehs of an Aka model Stablhty ehsss lf Am gt0 as h gt no A Standard VAR1 The enortexrns e and e are functions ofthe stmctuml shocks 5m and a devmhons o and o2 and a nonzero ooyahahoe see below Note there are 9 parameters to eshmase Y aln allytrl alZZt71 elc Z a2n azlYLel aZZZLrl ezc ell 8w bush blzbzl em 82 7 bzlsyt1 7 bleZl The error term variancecovariance matrix Then ooyahahoe ls glyeh by a 7b a a 7b a EeneuElt s 2 gtlt 2 2 ya liblzbzl Nelsen Ulz bnci blzCFZ1blzbn2 The error term yauanceooyauanoe mamx ls gle by 2 Z 7 61 512 2 512 62 Estimation of a Standard VARltpgt The geneml VARp ls gle by xt A0 Ale Azxt2 Apxkp Estamate eaoh equataon by OLS The xvanables ate determlnedby theory The numbet of lags p ate detemmned by the data uslng hypothesls tests Thete ate nn7 p coef clents to estamate Thus some equataons wlllbe oyetpatametenzed too many yanables lag lenth andtlnal model Likelihood Ratio Hypothesis Testing in a Standard VARltpgt It ls common to test tot lag length m the general VARp Usually lag lenth ls the same 111 each Onemethod equauon ls to use a fomal likelihood tauo test Estamate two models one wlth u lags and one wlth t lags ugtt oase calculate the ooyananoe matrix otthe reslo uals NXZUIHZ In ea Calculate the followmg test sta nsno C1H Erlilrl 2u 2 np1ls a small sample ooneonon 3 undet the null hypothesls the extm uet lags ate stanstaoally Insigni cant Information Criterion in a Standard VARltpgt AIC T ln 2 2an n SBC T ln gt an nlnT theory Itls posslble often to get oonmonng tesults Granger Causality in a Standard VAR vmbie using standard Etests Consider an equation tom 2 VAR2 model yt 33910 allyt71 a3912yt72 a132t71 a14Zt72 ell Ftom 2 theoretical pomt of View we may wsh to test whethet z quotGrangercausesquot y Ths can betested using 2 simple Etest that H1 230 and 250 Identi cation in a Stande VAR1 PF Hr n m pmmetets m the standard VAR No pmmetets m the standard VARO e the VAR s undendenhfied VARis exactlyidenh ed Sum 1980 suggests 2 teeutswe system to identh the model lettmg b 0 1 b12Ytbm7n YUMYH 8m 01 Z hm 72 722 27 8 Identi cation in a Stande VAR1 b20mphes Y 1 7132 hm 1 7132 7 72 m 1 7b2 5y Z 01 b2 01 72 v22 Z7 01 8 yaman a12Y17l en Z am a2 312 27 e2 m t w equauons am bm b12b2n 12 vate a 12225 2 an 7 7 7 b2v2 2127 v2 vare2 7 6 2 7112 712 b12722 7122 V22 Vene2 431252 Identi cation in a Stande VAR1 VAR bzro lmphes y does not have a contemporaneous effect on 2 A but only an affects z contemporaneously The KesldJZIS of en are cmeto pufe shocks to z choleski decomposin on Impulse Response Functions mmal shock on the Xmas y a a a y 7 e m n 12 s 1 n 21 am all all Ztrl all an em all elk Impulse Response Functions 11 Subsumung in expressions for stxuctuml shocks gives m a a 2 Z 321 2 22 91H Z Z en an an 4 ll bizbzi Em yfi ulti my gym 2 z m1 1221 2m The M are used to generate the effects of structural shocks on y and 2 h p en The 2 are eumuhuve multipliers The 2 as new are the longrmn muiupuefs Variance Decompositions Understanding the properties of forecast errors is helpful in uneovenng interrelationships among vanabies in the model m a sequence due to its quotownquot shocks Venus shocks to othexvanables honzons we can say than is exogenous 7M o0 Xtl X Z igtlri i0 Variance Decompositions The one step ahead forecast as no Etxt1 x Z Pistlri l 1 The onerstep ahead forecast enons m The nessep ahead forecast enons n71 Km Etxtsn 2 meme 11 The nessep ahead forecast error foxvznabley is ym Emn 1108mn h18w1 11n 18y11 n08am n18ma 12n 18n1 Variance Decompositions Denote the vananee onhe nessep ahead forecast enoxvanznce ofy as for 6yn2 Gynz 5 1102 HINDI nn 1z G 1202 12ltDZ 12n 12 The forecast enoxvanance decompositions are proportions of gym due to shocks to y6 02 H12 4r n712lt5yn2 due to shocks to 26 1202 1212 4r un712lt5yn2 Maximum Likelihood for the Masses Donald Green January 2002 What is maximum likelihood estimation MLE The following paper work through a series of examples that illustrate how MLE works across a wide array of applications A Simple Introductory Example CoinFlipping If we ip a coin six times and each ip is independent of the others what are the odds of obtaining two heads The answer depends on whether the coin is biased or not If the coin is Fair pheads 5 the likelihood L of obtaining k 2 heads in n 6 ips is L pkl pH 234375 71 mm m That is when we ip a fair coin six times we have roughly a l in 4 chance of coming up with exactly two heads But what if the coin were biased and the probability of heads were 2 Then the likelihood of obtaining 2 heads increases to 24576 Trying out some different values leads us to conclude that a probability of heads equal to iyields the largest likelihood of all 329218 In other words a biased coin with pheads gwould maximize the likelihood of observing 2 heads in 6 tries Note a subtlety here We39re not saying that the coin is likely to have a pheads The likelihood properly refers to the observed outcome 2 heads out of 6 not the coin When we identify the parameter value that maximizes the likelihood of obtaining the data we are saying that the odds of obtaining the observed result are greatest when pheads At first glance this aspect of maximum likelihood seems unsatisfying after all we generally want to form some assessment about the coin itself The point to remember however is that maximum likelihood is simply an estimation procedureone of many potential ways in which one might generate a guess as to what the true pheads is It turns out that maximum likelihood estimates have many desirable properties especially when the sample size is fairly large Think of L as a function that is a quantity whose value depends on the number of ips n heads obtained k and p the true probability of obtaining heads with that coin When n and k are given as in the foregoing example it39s not hard to find the value of p call it PML that maximizes this function simply by trying out different potential values of p In this case the search process can be speeded considerably by taking the derivative of L with respect to p setting the result equal to zero and solving for p see below This procedure yields a closedform expression for the maximum likelihood estimate of p namely f which is what intuition would suggest In many cases however no closedform solution is feasible and when the number of parameters is large this grid search technique becomes tedious or impractical Since we39re interested in figuring out how to solve maximization problems in general it pays to invest some time learning about optimization I have put an optimization program GREENOPT on my website When using optimization programs it is conventional to maximize the natural logarithm of L rather than L itself In general the expression for LogL is easier to manipulate on paper and to evaluate with a computer Conceptually replacing L with LogL has no significance since the maximum value of L will also maximize LogL But now the function to be maximized is a bit more tractable 1nL 1nkznquotikz 1011107 n k1111 P So from now on when we speak of the likelihood function we ll have in mind the loglikelihood function The GAUSS code on my website shows how GREENOPT can be used to maximize this function First values for the data are inserted n 6 and k 2 A starting value is provided called p0 so that GREENOPT knows where to begin its iterative search for the maximum of the loglikelihood function A procedure called qfctp is designed to return the value of logL for various guesses of p When this program is executed we obtain three pieces of output a maximum likelihood estimate of 33333 for p a standard error forISML of 19245 and a loglikelihood of l l l 103 The first number is what we obtained above The logL value is simply the log of 329218 which as we noted above is the value of the likelihood function evaluated at PML 33333 The only new number is the standard error which provides a rough sense of the sampling variability of the estimate I say rough sense because the standard errors are only approximations in small samples The standard errors are obtained in the following way Form a matrix of the second derivatives of the likelihood function with respect to the parameters In this case we have just one parameter so our matrix is just a scalar Invert this matrix and multiply it by l The diagonal elements represent the sampling variances of the parameters Now maximizing functions inevitably means taking derivatives Your calculus background is probably as rusty as mine so here is a recap of the basic ideas The maximum of a wellbehaved function is obtained by finding the place where the derivative equals zero and establishing that the second derivative the derivative of the derivative is negative The rules of derivatives are as follows Where c is a constant and f and g are functions a dx 0 Mzc dx dx 64qu WW 61mg 1 dg dx dx dx dfgl 1 dg dx gdxfdx Lg dlfglzgdx fdx dx g2 d1nf z i 1 dx f dx These rules should tide you over for most problems And of course if you have doubts about your answers either find wellknown results in textbooks or run your calculus through an analytic math program such as Mathematica For our binomial example the first derivatives of the loglikelihood function are The second derivatives are 6L k n k 6p6p in2 11172 Since the second derivatives must be negative setting the first derivative to zero will locate the maximum of the function 6L n k 0 6p 1 p implies that k P n And for p a 6L k n k 6106 in2 11172 The standard error can then be calculated as SE03 J In sum MLE proceeds in the following way 1 Stipulate a likelihood function for the data 2 Take the logs of this likelihood function 3 Take the derivative of the loglikelihood function with respect to the parameters 4 If possible set the derivatives to zero and solve for the parameters 5 If possible calculate the second partial derivatives with respect to the parameters Form a matrix of these second partial derivatives Invert this matrix and multiply by l The standard errors are the diagonal elements of the resulting matrix evaluated at the values of the parameter estimates Each of these results is displayed in the accompanying graphs Now let39s turn to some other examples Basics of Poisson Regression The Poisson distribution is a good starting point because it involves just a single parameter Besides which the Poisson distribution can be a useful device for studying event counts over time or space Consider the simple case in which we draw a random sample from a population distributed Poisson with parameter A Let observed variable be denoted y The likelihood function for the data Lyl l l is n 711 He 11 y Thus the loglikelihood for the data LYl is L nlZyl lnl Zy Based on the first order conditions it is easy to show that the ML estimator is simply the mean of the y Since 6Lnamp0 M 1 hi 7 Suppose however that the data are generated not by one 2 but by several These underlying propensities might result from different exogenous influences associated with particular observations In the case of hate crime for example one might suppose that all else being equal counties in which rightwing extremist groups congregate will tend to experience more crossburnings than counties that witness little rightwing activity This reasoning would lead us to represent H as a variable that changes as a consequence of exogenous influences X Since 2 must necessarily be nonnegative it is conventional to parameterize 11 by exponentiating the parametric relationship betweenX and 21 A gum emwww I Thus the loglikelihood for the data LYX is LZL ZyllnLZyl Ze Zy1X Zyz This function is easily maximized using iterative numerical methods such as those available using GAUSS The resulting parameter estimates are interpreted just as regression estimates although one must be careful to take into account the exponential translation of X into 21 Linear Regression with Normal Disturbances Maximum likelihood can be applied as well to regression problems in which the disturbances come from a normal distribution Consider the linear model y abxl ul If we assume that u is drawn from a normal population with mean L1 a bx and variance 0392 the likelihood function for may be written 1 LYu0392 ne I arm2 L 2039 J 2 1 Zyl a bx12 LY ab039 nexp 2 I Mo 2 i 2039 l Thus the loglikelihood for the data is bx2 LYab0392 ln 27239 ln 0392 L 2 2 Z 202 Taking the partial derivative with respect to each of the parameters we find the first order conditions which when set to zero enable us to solve for the parameters that maximize the likelihood function 6b 039 6Lleyl belz czle 2 O2 239 S tt39 6L 0 39 e in 1ves g 3 g bzzxxyz azxx 2x Next we consider the partial derivative of the loglikelihood function with respect to the parameter a 6LZyl na ble 661 0392 0392 0392 6L Setting 0 gives 6a Notice that when b is assumed to be zero as would be the case if we were simply estimating Ll the mean of y then a is simply the average value of y Finally we consider the partial derivative of the loglikelihood with respect to the disturbance variance n y a bx 2 71 6 Elnaz Zfo 2 6L 2 n IZUA a bxx 602 602 20392 20394 Setting this quantity equal to zero and solving for 0392 02 2m abx12 7 Thus we have a biased estimator for the disturbance variance which is simply the average of the squared residuals A residual is defined as y 51 bx In order to find estimators for a and b however we need to solve the two first order conditions for these two unknowns Above we found that bzzxxyz azxx 2x Substituting the formula for a gives 2x A few lines of algebra later we discover that ZMZE Z 99 y n b x 2 z x Z I 7 Note that this result indicates that the b may be estimated merely by calculating the covariance between x1 and y and dividing it by the variance of x This formula an easytoimplement closedform solution is precisely what we ordinarily use With an estimate of b in hand we may now solve recursively for a ando z Finally consider the variances of 51 and b First we must calculate the second partial derivatives of the likelihood function with respect to a and b 0L L 661661 0392 w12 abab 0 2 6L 2x1 6616b 0392 Next we put these elements into a matrix We may then express the negative inverse of the matrix of second derivatives as 6L 6L 1 n 2x1 661661 6616b 0392 0392 6L 6L Z x Z x am 61361 02 02 Factoring out 039 2 gives 02 n 2x a 2x3 zx 2x1 2x12 nZZxIZ lel2 Zx n The diagonal elements in this matrix are the sampling variances of 51 and b respectively Note for instance that the 22 element can be expressed 2 Oquot Varw nVarx Simultaneous Equations with Observed or Unobserved Variables The extention to more complex problems is quite straightforward Consider simultaneous equationseither recursive or nonrecursive For the moment suppose that all of the latent variables are observed directly that is Without measurement error Let K observed variables be Y The observed covariance matrix of Y is denoted S Using standard Ll SREL notation let B denote the matrix of causal effects between y and y J Similarly let the disturbances associated with each y be denoted CK The expected matrix of variances and covariances of the CK is called LP As Hayduk p116 notes the predicted covariance matrix from this system of equations is 2 1 B 1 PI B 139 Assuming that the disturbances are drawn from a multivariate normal population the loglikelihood function is F 1n2trSZ 1 lnS K The operator stands for the determinant of the matrix The tr operator refers to the sum of the diagonal elements of a matrix What could be simpler The function is easily programmed in GAUSS39 see for example GAUSS does LISREL on my website Maximize that function with respect to the parameters in B and LP and you can mimic the routines used in commercial software The extension to unobserved latent variables is straightforward The likelihood function remains the same assuming that the measurement errors 8k come from a mulitinormal distribution Letting A stand for the matrix of factor loadings and G stand for the measurement error variancecovariance matrix the predicted covariance matrix is HOW 2 A1 B 1 PI B 139A Concluding Comments The basic mechanics of maximum likelihood estimation are similar across a wide array of different problems Specify a likelihood function and find the parameter values that maximize it The trickiest part is specifying a likelihood model that is appropriate to the substantive application at hand This task will become easier as you become familiar with a wide array of probability models Here we have presented some of the more common models in social science the binomial Poisson normal and multivariate normal There are many others as well as extensions of these basic models Introduction to Time Series Analysis I De nition any unit observed repeated over any number of periods time can mean many things calendar time dwmqy clock time irregularly spaced observations examples lots of economic series public opinion polls although not equally spaced wars con ict though lots of zeros also called longitudinal data in sociology amp psychology some distinctions between discrete and continuous time H Why not Just use OLS assumption covuz O for 239 if called serial or auto correlation consequence ofignoring parameter estimates are unbiased but are inefficient positive serial correlation9 se s biased downward increase probability of a type I error R2 will b in ated HI Concept of a Lagged Variable simply the value of the variable observed last period write the lagged value of y as y can also think about variables in terms of f1rst difference Ay y yH can have lags and differences of various lengths can have seasonal lags business cycles etc IV Graphical Tests for Autocorrelation reg grow Lgrow graph current value of at and any of its lagged values LO o o C oo o o o o 0 D o 0 a 0 0 o o u o 2 a r E q 0 7V 39 0 0 go o a on can dmoa392000 o g o 0 00 bowel no n o 000 o o 00 39 a n a 00 0 0 0 o o o 00quot o o a o g n u o 0 a w LO O 395 6 5 Residuals L graph a against time m E o K 195bq1 1950q1 199bq1 2005q1 I I 1970q1 1980q1 qdate V Statistical Tests for Autocorrelation Durbin Watson Test think ofit this way ut puH vt where v N0o2 The DW test is set up as H0 920 H1 Q O under the null the errors at t 1 and t are independent in fact we can test this Without running the above regression Durbin and Watson 1951 developed their test statistic as T 2 22 22712 DW H quot2 u MK u N The key to the DW test is that the statistic can lay in the interval 0 5 DW 5 4 Consider the implications of DW taking three important values 0 2 and 4 0 3 0 DWZZ This case is Where there is no autocorrelation in the residuals and the null will not be rejected 0 3 1 DWZZ This case is Where there is perfect positive autocorrelation in the residuals 0 3 1 DWZ4 This case is Where there is perfect negative autocorrelation in the residuals Problems 1 There are zones Where the test is inconclusive 2 Test assumes a constant in the regression 3 The regressors must be nonstochastic more later 4 There cannot be any lagged endogenous variables 5 Only tests for rst order autocorrelation Breusch Godfrey Test allows for a relationship between at and several of its lags 1 Estimate a regression and obtain residuals 2 Regress residuals on all regressors and lagged residuals t 2 70 71X12 7222 p1 271 quot39pk tek V2 3 Obtain R2 from this regression 4 Letting T denote the number of observations the test statistic is given by 2 TkR2 N Zk In Stata grow lgrow l2grow l3grow lpresparty reg Source l SS df MS Number of obs 205 F 4 200 19656 Model 1 126790123 4 316975308 Prob gt F 00000 Residual l 322521112 200 161260556 Resguared 07972 Adj Resguared 07932 Total 1 159042234 204 779618795 Root MSE 12699 grow 1 Coef Std Err t Pgtltl 95 Conf Interval grow Ll 1 1114057 0680431 1637 0000 9798832 1248231 L2 1 71989961 1030539 7193 0055 74022077 0042155 L3 1 72578891 0681239 7379 0000 73922223 71235558 presparty l L1 l 73008717 0933092 7322 0001 74848678 71168756 icons 1 1228134 1652851 743 0000 9022094 1554059 bgodfrey BreuscheGodfrey LM test for autocorrelation Prob gt chi2 lagsltpgt chi2 df 1 2322 1 01276 H0 no serial correlation bgodfrey lag2 BreuscheGodfrey LM test for autocorrelation lagsltpgt 1 chi2 df 2 l 20833 2 H0 no serial correlation Prob gt chi2 00000 VI 80 you have autocorrelation What should you do if you know the form of autocorrelation like the form of heteroscedasticity you can use GL8 We can estimate p see DW test above and use that value Use p to transform y X and u Estimate transformed regression This is the Cochrane Orcutt iterative procedure Prais and Winsten propose a way to preserve the rst obs Estimating Prais Winsten regressions in STATA prais grow lpresparty nolog Praisewinsten AR1 regression is iterated estimates Source 1 SS df MS Number of obs 208 M 1 206 219 Model 1 511853582 1 511853582 Prob gt F 01405 Residual 1 481671408 206 233821072 Risquared 00105 Adj Risquared 00057 Total 1 486789944 207 235164224 Root MSE 15291 grow 1 Coef Std Err t Pgt1t1 95 Conf Interval presparty 1 L1 1 73274558 2976456 7110 0273 79142779 2593664 icons 1 3552439 5966484 595 0000 2376119 472876 rho 1 8262063 Durbin7Watson statistic original 0360340 Durbin7Watson statistic transformed 1137487 Note 1 if you use predict after prais it does not incorporate p 2 it will iterate until convergence 3 assumes rst order serial correlation VII Dynamic Models can depend on previous values of y a yHut called an autoregressive model can depend on previous values of X y ot xH ut called a distributed lag model can have any number oflags in both types of models can have both autoregressive distributed lag model Very easy to estimate in STATA using the lag operator 1 1 X reg grow lgrow l2grow Source l SS df MS Number of obs 206 F 2 203 35164 Model 1 123601279 2 618006394 Prob gt F 00000 Residual l 356774004 203 175750741 Risguared 07760 Adj Resguared 07738 Total 1 159278679 205 776969167 Root MSE 13257 grow l Coef Std Err t Pgtltl 95 Conf Interval grow Ll 1 1260623 0602503 2092 0000 1141827 137942 L2 1 7510829 0602537 7848 0000 76296323 73920257 icons 1 8757694 1528142 573 0000 5744627 1177076 reg grow 1pre5party Source l SS df MS Number of obs 208 F 1 206 1563 Model 1 112437881 1 112437881 Prob gt F 00001 Residual l 148228004 206 719553418 Risguared 00705 Adj Resguared 00660 Total 1 159471792 207 770395132 Root MSE 26824 grow l Coef Std Err t Pgtltl 95 Conf Interval presparty l L1 1 77374174 1865471 7395 0000 71105204 7369631 icons 1 3573913 1865471 1916 0000 3206127 39417 reg grow 1grow 12grow 1pre5party Source 1 SS df MS Number of obs 206 F 3 202 24289 Model 1 124707562 3 415691875 Prob gt F 00000 Residual 1 345711169 202 171144143 Risquared 07830 Adj Risguared 07797 Total 1 159278679 205 776969167 Root MSE 13082 grow 1 Coef Std Err t Pgt1t1 95 Conf Interval grow 1 Ll 1 1248394 0596497 2093 0000 1130778 136601 L2 1 75211364 0595968 7874 0000 76386481 74036247 presparty 1 L1 1 72403133 0945204 7254 0012 74266866 70539401 1 9758942 1558557 626 0000 6685815 1283207 icons Digression other operators Lag operator is 1 Lead operator is f Difference operator is 1 again can use any number after 1 f or d Xhy might lagged va ables be useful theory omission of relevant variables that may themselves be autocorrelated autocorrelation due to unparameterized seasonality BUT the use of lagged endogenous variables violates the assumption that the explanatory va ables are non stochastic This is because by de nition the value ofy is determined by an error and thus yt1 is also a function of an error at t 1 This leads to biased parameter estimates but the estimates are consistent meaning that this bias will disappear asymptotically there may be difficulty in interpretation when there are a large number oflagged variables Overview of Issues 1 Univariate Time Series Diagnostics and Forecasting ARI A models Diagnostics rolling and recursive regression 2 Properties of stationary and non stationary data Unit Roots Tests for and in the face of structural breaks 3 Multiple Time Series Simultaneous Equations Instrumental Variables Causality Vector Autoregressions 4 Long Run Relationships Cointegration Tests If time permits Models for volatility

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.