introduction to time series in r

Post on 16-Aug-2015

233 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Time series in R

TRANSCRIPT

1IntroductiontobasictimeseriesfunctionsinRThischapterintroducesyoutosomeof thebasicfunctionsinRforplottingandanalyzingunivariatetimeseriesdata.Manyofthethingsyoulearnherewillberelevantwhenwestartexaminingmultivariatetimeseriesaswell.WewillbeginwiththecreationandplottingoftimeseriesobjectsinR,andthenmovesontodecomposition, dierencing, andcorrelation(e.g., ACF, PACF)beforeendingwithttingandsimulationofARMAmodels.1.1TimeseriesplotsTimeseriesplotsareanexcellentwaytobegintheprocessofunderstandingwhatsortofprocessmighthavegeneratedthedataofinterest.Traditionally,timeserieshavebeenplottedwiththeobserveddataonthe y-axisandtimeon the x-axis. Sequential time points are usually connected with some form ofline,butsometimesotherplotformscanbeausefulwayofconveyingimpor-tantinformationinthetimeseries(e.g.,barplotsofsea-surfacetemperatureanomoliesshownicelythecontrastingElNi noandLaNi naphenomena).Letsstart byimportingsomedata; therecordof theatmosphericcon-centrationofCO2collectedattheMaunaLoaObservatoryinHawaiimakesaniceexample.Thedatalecontainssomeextrainformationthatwedontneed,sowellonlyreadinasubsetofthecolumns(i.e.,1,2&5).# get CO2 data from Mauna Loa observatoryww1

top related