RunningGAUSSprogramsUnderOx3PhilipA.VitonOctober9,2003Contents1Introduction22Updates23PrinciplesofConversion34OxEdit44.1ObtainandinstallOxEdit...........................44.2Con gureOxEditforOx............................54.3Con gureOxEditforOxGauss........................54.4SetuptheRunbuttons............................54.5One-linecomments..............................65Anextendedexample65.1GetandinstalltheGausscode........................65.2Preliminarysteps................................75.3Round1relocatingthecode........................75.4Round2initializingglobals........................85.5Round3disambiguatingthecode.....................95.6Round4maxlik...............................95.7Round5load...............................105.8Round6indirection.............................115.9The nalcode..................................115.10Usabilitynotes.................................125.10.1Optimizationfailures..........................125.10.2Robuststandarderrors........................125.10.3Initialpoints..............................135.10.4Dataconversion............................136CaveatandConclusion1511IntroductionThisnotedescribeshowtogetGausscodetorununderJurgenDoorniksOxsystem,version3.x.ItismeantasasupplementtoJurgensowndiscussioninOxAppendix.pdf,distributedwithOx.Frommyperspectiveasacompletebeginner,theproblemwithJurgenswrite-upwasthattheexamplesturnedouttobetooeasytoconvert,anddidntprovideguidanceonwhattodowhenthingsdidntgoquitethatsmoothly.Fortheacademicuser,theadvantageofOx+Gauss(OxGauss)isthatitisine¤ectafreesubstituteforGaussitself.(Notethatthisappliesonlyforacademicresearchandteaching:Oxisotherwisenotfree.)Asalong-timeuserofGaussremarkedtomerecently,Aptechseemstobemakingitmuchmoredi¢cultandexpensivetouse(forexample,moredi¢culttohaveacopyofthesoftwareforhomeusewhenyouhavealicensedo¢ceversion):indeedhewentsofarastoguessthatifthiskeepsup,Gaussdaysarenumbered.Idontknowwhetherthisisanover-reaction,butifitistrue,OxGaussprovidesasolution.ThisnoteisaimedattheGaussuserwhojustwantstogetprogramsrunningunderOxasquicklyaspossible.Forthisreason,IincludedetailsonsettingupOxEdit,thefreeOxtexteditor,forusewithOxGauss.Ifyouhaveanothereditorwhichallowsyoutorunprogramsandcapturetheiroutput,youshouldbeabletogetitworkingwithOxGaussquiteeasily,thoughsyntaxhighlightingmaytakeabitmoree¤orttosetup.IfyoucametoOxafterreadingFranciscoCribari-NetosreviewintheJournalofAppliedEconometrics(Vol12,1997,pp.7789),theresoneveryimportantpointtobemade.FranciscomentionstheavailabilityofaGauss-to-Oxconverter(g2ox.exe).Inmyview,whileusingthisconvertermighthavebeennecessaryinpreviousversionsofOx,youshouldnowavoiditcompletely.Asofversion3,OxcanrunGaussprogramsonitsown,withverylittle xuponyourpart(aswellseebelow),andwithoutconvertingthemtotheOxlanguage.Ifyoudodecidetogiveg2oxatry,bepreparedforlotsof(fairlyroutine)work;youcouldeasilyspend vetotentimesaslongontheconversion(expertocrede)thanifyouuseOxsnativeabilities,asdescribedbelow.2UpdatesThissectionlistsupdatestothediscussion,foreasyreference.October7,2003:ItappearsthatOx3.3hasimprovedtheOxGausssubsystemtothepointthatverylittleofthediscussionofhowtoconvertGausscodeforuseinOxappearsnecessary.Inparticular,Trainsmixed-logitcoderunsout-of-theboxnoreorderingnecessaryifyoujustchangethedata-loadingstatementasdescribedinSection5.7.Also,2version3.3issigni cantlyfasteratcomputingtherobuststandarderrorsduetoachangeinthewayGaussgradpprocedureisimplementedinOx.Obviously,everyoneshouldupgrade.Inmyoriginalwrite-upInotedthatonecouldntrunGaussroutineswhichinvokeitsextra-costmaxlikmodule,andIsuggestedthatitmightbepossibletomapcallstomaxlikintocallstoOxsownoptimizers.ThishasnowbeendonebySébastienLaurentandJean-PierreUrbain.Usingtheirworkitispossibletorunthemixed-logitcodeevenwiththemaxlikoptionspeci ed(acoupleofotheradd-onoptimizersarealsosupported,butIveexperimentedwiththem).Onereasonthisisimportantisthattheincludeddomaxoptimizerishighlysensitivetoanumberorparameters,forexampletheinitialpointandthenumberofHaltondraws.TheimplementationofmaxlikforOxGaussisavailablehere.March5,2003:VERYIMPORTANT:Trainsoriginalcodeappearstohavecontainedanerror,whosesymptomwasthatyougotidenticalresultswhenestimatingamixedlogitmodelwithuniformdraws,nomatterhowmanyrepetitionsyouused.Theerrorhasbeensilentlycorrectedinthelatestversionsfromhiswebsite.Youshouldcheckthatyouranswerschangewiththenumberofrepetitionsbeforeyoubelievetheresults.Itisnotclearwhatwasbeingestimatedinthiscase.Theerrordoesnotseemtoa¤ectestimationwithHaltonnumbers.Asofnow,Trainappearstohavewithdrawnthetwozip lesoriginallyreferredtobelow.Insteadthereisasinglezip le,train0401.zip,containingavarietyof lesassociatedwithacoursehetaughtonsimulationmethodsindiscretechoice.Themixedlogit lesareinthesubfolderps05.mxl,andthemain leismxlp.g.Thisisapanel-dataformulationofthemodel;youcanobviouslyadaptittoanon-panel-datacontextbyspecifyingTIMES=1.Becausehistwooriginalarchivesarenolongeravailable,Ihavewithdrawnreferencestomyconvertedco