Thursday 9 November 2017

Moving Gjennomsnittet Ttr


quantmod Kvantitativ Financial Modeling amp Trading Framework for R Hvis det var et område av R som var litt mangelfull, var det evnen til å visualisere økonomiske data med standard finansielle kartverktøy. På grunn av ingen annen pakke som implementerte dette, tok Quantmod opp samtalen og tok et skudd på å gi en løsning. Det som startet med en enkelt OHLC kartleggingsløsning, har vokst til et høyt konfigurerbart og dynamisk kartleggingsanlegg som i versjon 0.3-4, med mer kjølighet slated for 0.4-0 og utover. For nå kan vi se på hva det er på plass: Finansielle diagrammer i quantmod: Det meste av kartingsfunksjonaliteten er utformet for å brukes interaktivt. Følgende eksempler skal være veldig enkle å replikere fra kommandolinjen eller ditt personlige GUI valg. Kjører fra et skript krever litt ekstra forsiktighet, men er nå mulig også. Lar deg kartlegge Introduksjon chartSeries chartSeries er hovedfunksjonen som gjør alt arbeidet i quantmod. Hilsen av as. xts det kan håndtere ethvert objekt som er tidsserier som, betyr R objekter av klasse xts. dyrehage . tidsserier . det er . ts. irts. og mer Som standard er alle serier som er. OHLC kartlagt som en OHLC-serie. Det er et type argument som lar brukeren bestemme seg for stilen som skal gjengis: tradisjonelle bar-diagrammer, stearinlys og matchstick-diagrammer - tynne lys. få det :) - så vel som linjediagrammer. Standardvalgsautomaten lar programvaren bestemme, lys der theyd er synlig tydelig, matchsticks hvis mange poeng blir kartlagt, og linjer hvis serien ikke er av en OHLC-natur. Hvis du ikke liker å spesifisere typen for å overstyre denne virkemåten, er du fri til å bruke wrapperfunksjonene i neste avsnitt, eller bruke setDefaults fra den ugudelig kule og nyttige standardpakken (tilgjengelig på CRAN). Faktumet at jeg skrev det har ingenting å gjøre med min påtegning :) gt getSymbols (GS) Goldman OHLC fra yahoo 1 GS gt chartSeries (GS) Legg merke til automatisk matchestick-stil gt vel endre dette i neste avsnitt gt, men for nå er greit. gt Den grunnleggende kartingsfunksjonaliteten forsøker ikke å gå for langt fra de vanlige bruksmønstrene i R. selv om du ikke vil kunne bruke noen av de standard grafikkverktøyene for å vise diagrammer. quantmods oh-so-wise forfatter har forsøkt å forutse det behovet med spesielle funksjoner for å gjøre opp for denne mangelen. Et raskt skritt tilbake, for å forklare akkurat hva som skjer bak kulissene i chartSeries, kan være i orden skjønt. Kartleggingen styres gjennom en to-trinns prosess. For det første blir dataene undersøkt, og grunnleggende beslutninger om hvordan man best tegner serien, er beregnet. Resultatet av dette er et internt objekt - referert til som en chob (ch art ob ject). Dette objektet sendes deretter til hovedtrekkingsfunksjonen (ikke å bli kalt direkte) som skal trekkes til skjermen. Formålet med separasjonen er å muliggjøre mer imponerende dynamisk stilutvidelser, samt modifikasjoner, for å være så naturlig å utføre som mulig. Når endringer gjøres i det nåværende diagrammet, enten det legger til tekniske indikatorer eller endrer originale parametere, for eksempel diagrammet, blir det lagrede chob-objektet ganske enkelt endret og deretter revet opp uten mye kjedelig brukerdrift. Målet var å få det til å fungere uten ekstra brukerinnsats - og for å avslutte det gjør det bare. Kartlegging av snarveier - barChart, lineChart og candleChart. Mens chartSeries er den primære funksjonen som kalles når du tegner et diagram i quantmod - er det på ingen måte den eneste måten å få noe gjort på. Det er innpakningsfunksjoner for hver av hovedtypene av diagrammer som for øyeblikket er tilgjengelige i quantmod. Wrapper-funksjoner eksisterer for å gjøre livet litt lettere. Bar stil diagrammer, både hlc og ohlc varianter er direkte tilgjengelig med barChart. lysestake kartlegging kommer naturlig gjennom candleChart wrapper funksjonen, og linjer via kryptisk navngitt - du gjettet det - lineChart. Det er ikke mye spesielt med disse funksjonene utover det åpenbare. Faktisk er de en liners som bare kaller chartSeries med passende forandrede standard args. Men de gjør et fint tillegg til stallen. gt først noen høyt nærme stilstenger, monokromatisk tema gt barChart (GS, themewhite. mono, bar. typehlc) gt hva med noen lys, denne gangen med farge gt candleChart (GS, multi. colTRUE, themewhite) gt gt og nå en linje med standard fargevalg gt lineChart (GS, line. typeh, TANULL) Som du kan se, er det litt fleksibilitet når det gjelder visning av informasjonen din. Det du kanskje har lagt merke til, er de forskjellige argumentene til hvert av anropene. Nå, ta en titt på hva noen av dem gjør. Formelle argumenter: Farger, subsetting, tick-markeringer. Det beste stedet for fullstendig informasjon om hvilke argumenter funksjonene tar, er i dokumentasjonen. Men for nå, ta en titt på noen av de vanlige alternativene du kan endre. Sannsynligvis er det viktigste fra et brukbarhetssynspunkt argumentet undergrupper. Dette tar en xtsISO8601 stilbasert streng og begrenser plottet til det angitte datetime-spekteret. Dette begrenser ikke dataene som er tilgjengelige for de tekniske analysefunksjonene, begrenser bare innholdet som er tegnet på skjermen. Av denne grunn er det mest fordelaktig å bruke så mye data som du har tilgjengelig, og deretter gi chartSeries funksjonen med delsettet som du vil se. Denne subsetting er også tilgjengelig via et anrop til zoomChart. Et eksempel, eller tre, skal bidra til å klargjøre bruken. gt hele serien gt chartSeries (GS) gt nå - litt, men av subsetting gt (07 desember til siste observasjon i 08) gt candleChart (GS, subset2007-12 :: 2008) gt litt annen syntaks - etter det faktum. gt endrer også x-akse-merkingen gt candleChart (GS, themewhite, typecandles) gt reChart (major. ticksmonths, subsetfirst 16 uker) Tre ting i notatet på det siste diagrammet. Først var bruken av reChart å endre det opprinnelige diagrammet. Dette tar de fleste argumenter fra de opprinnelige kartleggingssamtalene, og gir mulighet for raske endringer i diagrammer. Være det å endre farge temaer eller subsetting - det kommer ganske bra. Det andre bemerkelsesverdige elementet er bruken av den første syntaksen inne i delmengden. Dette gir et litt mer naturlig uttrykk for hva du kan være etter, og krever ikke at du vet noe om seriedatoer eller - tider. Det endelige elementet i notatet i det siste bildet er tick. marks argumentet. Dette er en del av den opprinnelige chartSeries-funksjonaliteten, og den brukes til å endre plasseringen av etiketter i diagrammet. Ofte jobber den automatisk valgte avstanden - drevet av xts-funksjonen axTicksByTime, en god nok jobb - det kan hende du ønsker å tilpasse produksjonen ytterligere. I dette tilfellet merket vi de store flåttene med månedens begynnelse. Teknisk analyse og diagramSeries Oppdatert og klar til å gå er noen fantastiske verktøy fra TTR-pakken av Josh Ulrich. tilgjengelig på CRAN. Det er nå mulig å bare legge til dusinvis av tekniske analyseverktøy for å kartlegge med ingenting mer enn en enkel kommando. De nåværende indikatorene fra TTR-pakken, samt noen få opprinnelser i quantmod-pakken, er: Alt ovenfor fungerer mye som TTR-basisfunksjonene som de kaller. Den primære forskjellen er at add-familien til samtaler ikke inkluderer datarg argumentet, da dette er avledet fra det nåværende diagrammet. Noen eksempler vil fremheve hvordan du bygger diagrammer med de innebygde indikatorene. gt getSymbols (GS) Goldman OHLC fra yahoo 1 GS gt TA-argumentet til chartSeries er en måte å spesifisere gt indikatoranrop på som skal brukes på diagrammet. gt NULL mener ikke å tegne noen. gt gtSeries (GS, TANULL) gt Nå med noen indikatorer anvendt gt gt chartSeries (GS, themewhite, TAaddVo () addBBands () addCCI ()) gt Det samme resultatet kunne oppnås en gt bit mer interaktivt: gt gtSeries , themewhite) tegne diagrammet gt addVo () legg til volum gt addBBands () legg til Bollinger Bands gt addCCI () legg til Commodity Channel Index En av de nyeste og mest spennende tilleggene til den nyeste Quantmod-utgivelsen inneholder to nye kartverktøy som er laget for å legge til tilpassede indikatorer langt raskere enn tidligere mulig. Den første av disse er addTA. Dette er en stor utvidelse til den tidligere addTA-funksjonen, ved at den nå gir mulighet for å trekke vilkårlig data på diagrammer. Fungerer som i hovedsak en wrapper til dine data, det eneste kravet er at dataene har det samme antall observasjoner som originalen, eller være av klasse xts, og datoene er innenfor det opprinnelige datas tidsintervall og skala. Det er mulig å få disse nye dataene plottet i sitt eget TA-underkort (standard), eller overlappet på hovedserien. Den andre og potensielt mer interessante funksjonen er newTA. Dette er den etterlengtede skjelettfunksjonen for å skape tilpassede TA-indikatorer som skal legges til et diagram. Det tar skjelettkonseptet ett skritt videre, og dynamisk skaper funksjonskoden som trengs for en ny indikator, basert på funksjonen du har passert til den. I hovedsak er det litt selvbevisst programmering som gjør at nye indikatorer er ganske intuitive og praktisk talt smertefrie. Gitt sin heller cutting edge evner, er det på grunn av eksperimentelle. Heldigvis hvis alt annet feiler, og hva du får, er ikke det du forventet, kan du alltid endre koden som er opprettet for å bedre passe dine behov. Et raskt blikk på å legge til tilpassede indikatordata og opprette en ny indikator fra grunnen av. gt getSymbols (YHOO) Yahoo OHLC fra yahoo 1 YHOO gt addTA lar deg legge til grunnleggende indikatorer gt til diagrammene dine - selv om de ikke er en del av quantmod. gt gtSeries (YHOO, TANULL) gt Deretter legger du til Åpne for Lukk prisendring gt ved hjelp av Quantmod OpCl funksjon gt gt addTA (OpCl (YHOO), colblue, typeh) gt Ved å bruke newTA er det mulig å lage din egen gt generiske TA-funksjon --- La oss kalle det til å addOpCl gt addOpCl lt-newTA (OpCl, colgreen, typeh) gt gt addOpCl () Mer å komme. Det er mye mer å si om chartSeries og quantmods nåværende og fremtidige visualiseringsverktøy, men for nå er det på tide å kalle det en dag (eller 30) og konkludere denne introduksjonen til kartlegging i quantmod. Fremtidige tillegg til dette nettstedet og dokumentasjonen vil inneholde flere detaljer om interaksjon med diagrammene - nå og i kommende utgivelser, nye layoutalternativer og en mulig forgang til helt nye visualiseringsverktøy og - teknikker. Men for nå er det alt jeg har. Denne programvaren er skrevet og vedlikeholdt av Jeffrey A. Ryan. Se lisens for detaljer om kopiering og bruk. Copyright 2008.IFC - Tracking Radars For å komme inn i radar eller Nike Acquisition Radars, gå til. Kontrollene for disse radarene ble plassert i Radar Control Van, som var plassert svært nær batteristyringsvognen og samme størrelse. John Porter, leder av SF-88, rapporterer at batteristyringsvognen er 20,5 fot lang, 8 fot bred, 7 fot høy, med en 6,5 ft tungen. Dette er en Nike Hercules tracking radar. Det kan være en rakettrapporteringsradar (MTR), en Target Tracking Radar (TTR) eller en Target Ranging Radar (TRR). Detaljer er skjult under vindskjermen, noe som reduserer vindtrykk og buffeting. Hjultransportkjøretøyet er fremdeles til stede, når det fjernes, støttes antennen av tre justerbare ben i en trekant. Denne Nike X-Band (ca. 10 GHz) Target Tracking eller Missile Tracking radarantenne er uten vindskjermen. Bildet er fra et Nike-nettsted som nylig (2016) kom ut av drift på Folgaria, TN, Italia. Det er nå en del av et flott Nike Hercules museum på den siden. Også, TM9-5000-18 NIKE I SYSTEMS - TTR TRANSMITTER OG RECEIVER CIRCUITRY er tilgjengelig for en annen (mer detaljert) visning av noe av dette materialet. (Nike 1 Ajax var forgjengeren til Nike Hercules, men de samme prinsippene gjelder.) Fra FM 44-1-2 ADA Referennce Handbook, 15. juni 1984, se side 21 Ringer av supersoniske stålsporing antenne tårnene Nike sporing antenner trenger ekstrem pekingsnøyaktighet. Nike Hercules har en rekkevidde på over 90 miles, og systemet skal kunne lede en rakett til med i 10 eller 12 meter der Target Tracking Radar sier målet er. Dette betyr at Target Tracking Radar (gir målplassering) og Missile Tracking Radar (som gir Hercules-missilstedet) må nøye justeres (diskuteres nedenfor). Også effekten av - solens varme forvrenger antennens monteringer - vindkraften som forvrenger antennemottakene må også minimeres. For å oppnå dette, brukes et dobbelt tårn: - det indre tårnet støtter antennen - det ytre tårnet støtter vindskjermen og nyanser i det indre tårnet. Bildene nedenfor er av IFC-området i SF-88, nord for San Francisco. Det indre tårnet, betong - med tre fremspring på toppen for de tre antennefotene. Foto courtesy of Greg Brown Det ytre tårnet nyanser det indre tårnet som reduserer differensialvarme på solsiden av det indre tårnet. Den støtter også tilgangsstigen, vindskjermen, arbeidsplattformen og skinnen. De tre padsene som er merket 0 er pads støttet av det indre tårnet, og støtter de tre antenneputene. Den delvise hvite sirkelen er restene av vindskjermen boble støtte. Dette bildet viser de to separate basenhetene, det ytre rektangel som støtter det ytre ståltårnet, den indre rundbetongen som støtter det indre runde betongstårnet. Foto på grunn av Greg Brown Tracking Antenne Base Bilder Utstyr som brukes til BoreSighting Dette er kontrollboksen og kabelen som brukes til å foreta fine antennepekingsjusteringer under bore-observasjon og andre justeringsprosedyrer Dette er teleskopet som brukes i bore-observasjon og andre justeringsprosedyrer. Nasjonalparkstjenesten har avviklet fra denne enheten - Koblinger på en sporingsantenne Dette kan kalles tilkoblingssiden til en Nike Tracking Antenna. Den inneholder også to oppbevaringsrom for ofte brukt utstyr. De fleste kontaktene bruker lavstrøm (signal) kontakter, her er et eksempel. Den eksponerte kontakten er for de tre koaksialkablene som bærer mellomfrekvens (60 MHz) signaler til radarkontrollvognen for ytterligere forsterkning. De er Sum, Azimuth Error og Elevation Error signaler. Sporing av antennebaselektronikk Dette er magnetron og andre høyspenningsforsyninger, og forsterkerne pleide å drive antennens azimut og høydemotorer. De er på motsatt side i forhold til kontaktsiden. Målsporingsoperatørposisjoner Dette er målsporingskonsollene, hver med omfang og kontroller som merket. De så veldig ut til både Nike Ajax og Nike Hercules. I Nike Hercules ble en tilleggsposisjon, sporingstilsynet, lagt til for å hjelpe til med å koordinere aktiviteter og betjene anti-jamming kontrollene. Bilde av Radar Control van på Ft. Sill-museet fra Al Harvard Pan-adapter-mulighet for anti-jamming og kontroller under venstre, TTR Magnetron kontrollerer under høyre, Azimuth-rekkevidde rett fra Greg Brown Dette bildet er av A-Scope-chassiset i målsporhøydeposisjonen trukket ut. (Alle A-Scope-chassisene er identiske) Dette bildet er av de drevne målsporskonsollene og anti-jamming kontroller av et italiensk system, fra Ramiro Carli Ballola Tracking Supervisor Controls Dette var bare Nike Hercules - en fjerde mann sto bak de tre sporingsoperatørene og brukte dette avtagbare anti-jamming kontrollpanelet. Jeg har vist dette i stor detalj, da jeg er fascinert, og forestiller meg hva alt kan gjøres for å unngå jamming-signaler. TTR - MTR Magnetron, type WE 5780 En magnetron er et spesialisert vakuumrør som er i stand til å lage overraskende kraftige pulser (100s kilowatt) mikrobølgeffekt fra kraftige pulser med høy spenning (ca. 30 Kv) strøm (ca. 30 ampere). Western Electric type WE 5780 magnetron ble brukt i Nike Target Tracking radars. Dette er en tunbar magnetron med frekvens sentrert på 10 GHz (3 cm bølgelengde). Jon Elson sendte disse bildene fra Jon: ARGhhhh. Jeg har hatt denne magnetronen med meg i over 40 år, den har satt i en boks i min nåværende garasje i 25 år. Ta det ut for å ta et bilde, og jeg DROPPED det DAMN Jeg antar at jeg kunne fudge det sammen igjen for et bilde. Dette er utvendig tuning utstyr - av til venstre er en liten gearet motor, deretter en fleksibel kabel med innsiden vridningsmekanisme, til 90 graders vinkel, til orm kjøring. Dette gjorde det mulig for TTR å forsøke å unngå forstyrrelser og jamming ved å endre frekvens - 10 Mottakeren registrerte automatisk magnetronfrekvensendringene (AFC) Her er et datablad fra frank. pocnetsheets20155780.pdf Bredde på bredde er vanligvis definert som bredden mellom halv kraftpunkter av fjernlyset til en antenne. Wikipedia gir en formel for en typisk parabolisk strålebredde som: BeamWidthInDegrees 70 WaveLength AntennaDiameter hvor WaveLength og AntennaDiameter er i de samme enhetene. Ved hjelp av faktorer av - bølgelengde 3 cm - antennediameter (ca. 5 fot) 152 cm gir en Nike-antennestrålbredde på ca. 1,4 grader En liten (smal) strålebredde i en sporingsantenne er en god ting, noe som gir: - mer radarenergi på mål og gevinst (bedre område) - bedre målvinkelbestemmelse - bedre motstand mot off-aksen som strammer Nike-sporantenner hadde en strålebredde på ca. 1,4 grader, det vil si at det meste av senderens kraft var konsentrert på ca 1,4 grader bredt og 1,4 grad høy. Selv om TRR (Target Ranging Radar) hadde kortere bølgelengde, ble den ikke brukt til vinkelbestemmelse. Ajax Target Tracking Radar Den tidligere Nike Ajax tracking radar hadde et effektivt utvalg på rundt 50 miles. Oversikt Denne antennen (neste fire bilder) er på Historical Electronics Museum nær Ft. Meade, MD. Et flott sted å besøke. -)) Det brukte en Fresnel linse type fokusering slik. Boresighting var identisk med de senere Hercules Tracking antenner. Leveling var selvsagt en stor avtale. Target Tracking og Missile Tracking radars må ha en felles vertikal referanse. To nivåer i rette vinkler brukes for enkelhets skyld. Dette var ett ben av stativstøtten til en sporingsantenne. Hetten dekker et 1-tommers heksbolthode som skal vri for å utjevne antennen. Jeg var veldig imponert over glattheten i rotasjonen i asimut. Lageret hadde ingen tilsynelatende spill, men var lett og glatt å bevege seg. I 2012 spurte jeg Kennith Behr om dette. Han sa at dette var en Kaydon Bearing og ga dette bildet. viser utviklingen av Fresnel-formen av metallplaten linseantenne. Kapittel 3, METAL-PLATE LENS ANTENNER av Paul Wade. Dette inneholder følgende diagrammer. En diskusjon av metalliske forsinkelseslinser, som brukt av Nike Ajax sporingradarer, ble presentert i dette utgaven av Bell System Technical Journal. Bell og Western Electric (et datterselskap) designet og bygget Nike IFC-utstyret. Et Life Magazine-bilde - på Red Canyon - muligens tropper fyrer Nike Ajax-utstyret før de tar det til et sted i en by. En annen mulighet er at troppene kommer tilbake til årlig gjenopptakelse fra innbyggert utstyr. Hercules Target Tracking Radar Nike Hercules Tracking Radars hadde et maksimumsområde på 200 000 meter, litt over 110 miles. (Dette var en vanskelig grense som sporingsskjermene og dataskalering hadde den grensen.) For en interessant sammenligning med den tidligere (WWII) SCR-584, klikk her. Nike Hercules-systemene hadde to Target Tracking Radars som var eksternt liknende. Interne forskjeller inkluderte bruk av forskjellige frekvensbånd. De to radarene ble brukt i stedet for den vanlige radaren for å bekjempe fiendens jamming. En rekke strategier gjorde livet til fiendens jammere ekstremt vanskelig. (Nike Ajax-systemene hadde en målsporingsradar). Nike Hercules Target Tracking Radar (TTR) (Bilde er 33 K Bytes) (Foto kreditt Rolf Goerigk) Tau gjerdet og støtter er det bare under vedlikehold for å redusere ulykker - fjernet under normal drift. Under normal drift omgir en sfærisk vindskjerm antenna for å redusere vindstyrker og sporingsfeil. Utsikt over elektronikk (Foto kreditt Rolf Goerigk) Gaston Dessornes vil. Kjenne den omtrentlige vekten til MTR TTR mobile tower (Se bildet vedlagt) Følgende bilder er fra skanning av TM9-1430-253-34 av GoogleBooks Alle praktiske (og tunge) elektronikk ble plassert i stativbasen. Dette inkluderte strømforsyninger, magnetforsterkere for å kjøre drivmotoren. Dette er baksiden av TTR-antennen - laget så lett som praktisk - Elektrisk tilkobling, dvs. kontroller, høydevinkelspenninger, effekt, mellomfrekvenskanaler. ble laget med basen via slipringer. Her er en slip-ring-enhet som kobler de roterende delene elektrisk, brukes både i asimut og en annen for høyde. Azimuth-senderen er et presis-sinus-cosinuspotensiometer som hjelper til å konvertere polære koordinater (vinkler) til kartesiske koordinater (x, y): -)) Selv om det er betydelig kompleksitet, har vi sjelden hatt problemer med radarene (eller resten av Nike IFC-systemet). Det var ekstremt godt designet og produsert :-)) Ganske mye en glede å fortsette å løpe. Dessverre har Western Electric, designeren og produsenten blitt demontert av regjeringen. I spesielle situasjoner, som tyfonfare eller arktiske forhold, ble det inkludert et stort beskyttelsesdeksel som kunne gi ekstra beskyttelse. Disse dekslene var formet som muslingeskall som kunne lukkes i veldig dårlige forhold. Se bilder Sidevisning. Kvartalsutsikt og Alaska plasseringsinformasjon Site Peter og Site Summit. Jeg gjetter (vær så snill å korrigere meg) at hvis muskelskjellene ble stengt, kunne ikke sporingsradarne brukes. Fra Rolf Goerigk. Spesifikasjon for Target Tracking Radar (TTR) inkluderer: Short Pulse (SP) 0,25 mikrosekunder Long Pulse (LP) 2,5 mikrosekunder Radar mottakerskap Det er to skap, side om side, nesten speilbilder av hverandre, en for Target Tracking Radar (TTR), og en for Missile Tracking Radar (MTR). For-modernisering, støvsuger Den første døren på skapet til venstre for målsporingskonsollene åpnes i Target Tracking Radar Receiver Cabiner. Det viste skapet er for Hercules, men Ajaxen var veldig lik. På en gang kunne jeg fortelle deg funksjonen og hvordan du kan justere alt her - Chassiset på døren er Test Chassis, som brukes til å teste riktig funksjon av alt i kabinettet. Den lukkede døren til venstre er veldig lik for missilsporingsradaren. Hver inneholder 60 MHz Intermediate Frequency (IF) forsterkere for Sum, Elevation Error og Azimuth Error, Automatisk Gain Control for IF forsterkere, Range Unit, kretser som muliggjør automatisk sporing i høyde, azimut og rekkevidde, og et testpanel som også kan kontrollere boreområdet mastelektronikk. Post-modernisering, Solid State, Transistorer All informasjon og bilder fra Mr. Ramiro Carli Ballola Jeg sender deg noen bilder som er relevante for BC vanen faktisk plassert på Base Tuono, dette er den siste konfigurasjonen frosset i 2005 (ingen endring forutsatt eller autorisert) for alle nasjoner som deltar i WSPC. Som jeg allerede forklarte de tre resterende landene, var ITALIA-Hellas og TYRKIA, i slutten av 2005 begynte HELLAS å avvikle systemet, etterfulgt av ITALIA i 2007, etter at WSPC kom inn i likvidasjonsfasen. for begge MTRTTR subAssy starter fra toppen er listelisten som følger: 1) Belyst AFC 2) IF forsterker SUM 3) IF forsterker AZ 4) IF forsterker El 5) Video og AGC forsterker 6) Servo Error Converter AZ 7) Servo Error Omformer EL På de to dørene, enten MTR eller TTR fra toppen, er listen følgende: 1) IF testgenerator (som den gamle kammeret) 2) Feilspenningsmonitor (som den gamle kammeret) 3) AZ Feil Modultaor 4) EL Feil Modulator TTR-seksjon høyre side LPSP-filtre fra toppen: 1) SUM LP og SP-filtre 2) AZ LP og SP-filtre 3) EL LP og SP-filtre MTR-delen venstre side SP-filtre fra toppen: 1) Sum 2) AZ 3) El Relativ til LIN LOG-kretsene, fremdeles fra toppen: 1) IF-forsterker 2) Langpulsfilter 3) Lin Log-forsterker Multibaneproblemer Arbeidsforhold OK - Du kan få mesteparten av det ovenfor fra en seriøs radarbok. Nå for en praktisk detalj: - ((Radarbølger er bare en (veldig) lavfrekvent lysbølge. Dette er både gode og dårlige nyheter. Den gode nyheten er at radarbølgene reflekterer ledende overflater som fly. er det at radarbølger reflekterer overflater du ønsker de ikke ville, som jord eller vann (med forskjellige dielektriske konstanter i forhold til luft) mellom deg og flyet du prøver å spore. Her er to historier en historie og en annen historie som involverer Missile Tracking Radarlåsing - På refleksjon av et missil. Dette er en visualisering av problemet og en graf som viser sporingsfeil for et plan i uspesifisert høyde med en radar på uspesifisert høyde og frekvens med strålebredde ca. 3 ganger Nike 3 centimeter bølgelengde. Denne utgaven fortsetter for omtrent 3 sider om denne effekten. Ovennevnte prøve er fra 1980-utgaven av Introduksjon til Radar Systems av Merrill I Skolnik. Mens du prøver å kontakte forfatteren for tillatelse til å publisere, (ingen kontakt ennå) Jeg fant ut at han er i live, fremdeles foreleser og forfatter. Ifølge radarcon2008.orgbioSkolnik. html. Dr. Merrill Skolnik fungerte som superintendent for Radar-divisjonen ved US Naval Research Laboratory i Washington, D. C fra 1965 til 1996. og har alle slags anerkjennelser. Hvis du er seriøst interessert i moderne radar (inkludert Lidar), bør du få en av hans mer moderne bøker. Ovennevnte avsnitt angir en grunn til at Nike-oppdraget var mot høyflygende fly, og noen motiver for å utvikle homing missiler som HAWK, og de mer sofistikerte metodene i PATRIOT. Gode ​​nyheter Diagrammet kan tolkes for å indikere at feilen mellom to tett adskilte radarer, involvert med lave vinkler av forhøyning av målet, vil ha lignende feil - at feilen fra MTR som sporer missilet i inngangspunktet, vil bli stort sett kompensert ved feilen i målsporingsradaren som sporer målet til det samme avskjæringspunktet. - De to feilene i stor grad kansellerer - Dårlige nyheter Hvis raketsporingsradaren sporer refleksjonen eller bildet - det vil miste oversikten over missilen, og det er ingen praktisk måte å gjenvinne spor før missil selvdestrukter etter å ha mistet sporingskommandesignalet fra MTR . Gode ​​nyheter -)) Effekten ble kjent og korrigert for inntil dømt ikke et problem. Dette var vanligvis lett i USA Rolf Goerigk-rapporter fra Tyskland Et godt eksempel var den daglige MSL-anskaffelsesprosedyren. På grunn av antennestrålenes vanligvis lave beite vinkel ble flervågseffekter overvåket i høyde. Ved å bruke NIKE amplitude monopulse var det ingen kur. MSL ble vurdert ikke-operativ. Tenk deg, ser gjennom det monterte teleskopet, se noen kyr i stedet for den automatisk sporet raketten. Men visningspunktet eller styringspunktet var ikke reflekteringspunktet, men i stedet var summen av direkte og indirekte RF-energi fra MSL. Refleksjonspunktet endret seg med sesong og dagtid og noen ganger gått i det hele tatt. Det var et veldig interessant tilfelle, og jeg lærte mye. Jeg var forlovet (igjen) i den hemmelige historien. Det var veldig varmt og følsomt. Denne saken er omtalt i enkelte radarbøker. Krigsløsningen Flytte lastebiler mellom MTR og MSL, det virket Radar Aiming Alignment inkludert boresighting Radarjustering er rimelig komplisert. Hver radar (målsporing av missilsporing) må være individuelt planlagt og boresighted. Da må de to radarene være justert slik at deres potensiometre leser det samme når begge er pekte i samme retning. Deretter må stillingsforskjellen for missilsporingsradaren fra målsporingsradaren plasseres i datamaskinen for den korreksjonen. Dette er en borestedmast (15 K bytes). Testsignalradarbølgene kommer ut av fôringshornet i midten av X på toppen, og de fire sidene i X på toppen er optiske mål for teleskopene på radarene (TTR, TRR og MTR). Flere detaljer her En liten refleks klystron, som dette, ble brukt til å generere ekkopulsen via føderhornet til sporingsantenne som ble boresighted. Radarmottakerens følsomhet kan også kontrolleres ved å dempe utgangen av dette røret. Røret er ca 3 tommer, 8 centimeter, fra rørbunn til topp. Den lange tappen under bunnen er den koaksiale utgangsstrukturen som gir en bølgeleder. Dette er en boreplassmast (34 K bytes) som senkes. Når den er på plass, er den lange polen vertikal. Bilde fra Rolfs NIKE Pages av goerigkonlinehome. de. I listemodus kan den organiseres i følgende hovedtrinn: Individuell nivellering (alle sporingsradarer) Nivåindikeringsinstrumentet var en robust versjon av Precision-ingeniørenes nivå montert på den roterende delen av antennen. Instrumentjusteringen ble kontrollert ved å nivellere antennen, og deretter rotere antennen 180 grader og sikre at instrumentet fremdeles angir nivå. Hvis ikke, justerte du nivået til det angav samme feil fremover og bakover. Du re-leveled antennen og sjekket på nytt. (Denne justeringen var ganske stabil.) Antennens nivå var generelt ikke stabilt. Individuell bore sighting (alle sporingsradarer) Slå på Bore Sight Test Mast oscillator - Når test mast kontroll boksen sensorer X-Band pulser, - det vil generere ekko pulser på samme frekvens fra feed horn Lås på oscillator Spor i automatisk Set teleskop i monteringsposisjon, posisjon 1, observere mål Sett teleskop i monteringsposisjon, posisjon 2, observere mål Juster teleskop (ikke radar) for korrekt boresyn. Slå ned boringssiktestmastoscillatoren. Mål missil - og målsporings-teleskoper ved hverandres krysshår. Juster potensiometerjusteringer Pass på at rakettsporingsposisjonen for rakettsporingen var i datamaskinen. Nivelleringsjusteringen var den mest plagsomme på mange nye steder. Det ville kjøre om ganske mye (kreve relevans flere ganger om dagen) til betongpadsene slo seg ned i bakken. Da ville justeringene ikke være påkrevd mer enn en gang om dagen. Dette ga en nøyaktig nøyaktighet mellom raketsporingsradar og målrapporteringsradarer på omtrent 1,5 tommer i tusen meter (forutsatt at borestedet mast var omtrent 250 meter fra radarene ). På 110 miles (200 000 meter) ville det være omtrent 300 tommer eller i størrelsesorden 25 fot. Det er mange flere feilkilder i systemet - selvfølgelig - men systemet var interessant nøyaktig. I vinkelmål var boresight-feilen ca. 0,0025 grader, eller omtrent 10 buksekunder. Vinkelstørrelsen på en stjerne i et kraftig teleskop på jorden er om lag 1 buksekunder på grunn av atmosfæriske problemer. For en interessant sammenligning med tidligere (andre verdenskrig) SCR-584, klikk her. Frank E. Rappange påpeker at det er en sjekk som viser at alle justeringer VIRKELIG VIRKER. . Hovedprøven (som måtte utføres hver 6. time, da på 30 SOA) var den samtidige sporingstesten. I denne testen ble MTR satt til hudspormodus, og både TTR (og TRR) og MTR låst på samme mål. BCO kunne lese spenningsforskjellen for posisjonene til de respektive radarene i BC vanen. Readings were made for both TTR and TRR in the difference pulse modes. It was the decision of the BCO to accept the system or not. Radar Range Determination Radar waves (and light and other electromagnetic waves) travel through air almost as fast as in a vacuum. Fortunately for engineers and users, air pressure, humidity, and other atmospheric variables do not affect the speed of travel very much. To make matters even easier for the Nike problem, any variations that do occur are largely canceled out at the end of the flight, as both the radar beams are traveling through very similar air conditions. Errors due to refractive effects due to differences in air pressure along the beams cancel out. So a common crystal oscillator was used to calibrate the range systems of both the missile and target radars. This adjustment was fortunately very stable, rarely needed tweaking unless a component was changed. There is a circuit called a phantastron that has a remarkably linear pulse delay time from a voltage input. The Range Operator (or range tracking servo system) operates a linear potentiometer which provides the range voltage for: Elevation potentiometers, see Height Determination below Azimuth potentiometers, see Radar Azimuth Determination below Range gate for displays and for servo gating This diagram came as a shock when I was looking through technical manuals in 2015. I had never seen it in trainning nor on site. It must have been discussed on one of the days I was on KP. (The Army had a bad habit of making their slave wage students take their turns doing KP (Kitchen Police, washing pots and pans, mopping the mess hall. ) during technical trainning. The Air Force is much more enlightened, hiring civilians to do kitchen chores instead of techie students.) Good thing the range units didnt fail on our site, would have taken me some time to fix things, or call in ordnance. (There were two range units, one for the Target Tracking, The other for the missile tracking.) Maybe Lopresti or Sizlak (the other two IFC techies) didnt have KP on their sequence. Radar Height Determination Digital - post-modernization - from Ramiro Carli Ballola Note: during the post 1975 modernizations, including replacing many analog components with digital components, the elevation trig potentiometers were replaced by digital angle resolvers. Here is an explanation of a digital angle resolver. The output was sent to a little digital computer in the RC van where the height was computed from the digitalslantrange times the sin of this angle and the groundrange determined from the cosine of this angle. Gathering the details, and educating me (Ed Thelen) is an on-going effort (November 2015) by Ramiro Ballola :-)) Please be patient, these were major philosophical, data flow, and processing changes. going back to the RAEMOD, with the change of the potentiometers in the antennas, in the exploded view photo included at nr 26 you should see fisically the optical resolver inside the TTR azimuth encoder assembly, they were the same on the elevation and equally the same for TTRMTRTRR Inside the functional schematic photo you should see a little part of the RSPU Angle encoder section and you should read the input from synchro and resolver from the antenna and the first data conversion, to be sent to the Coordinate Converter Section (via PCS), than to the TDP (Track data processor) and to the Digital computer in the BC Van Ed Thelen here - The above two diagrams provide fascinating hints of the digitized (azimuth and elevation) angle data sent by the antenna circuitry to the RC van to help provide X, Y, and Z information of the radar target. Ramiro is continuing to collect photos, diagrams, and information. from Ramiro Nov 19, 2015 Ed, if you remember after boresight check before the Orientation, one check was mandatory to be performed and it was the KDP (Known Datum Point) to define the TTR (considered as System center) azimuth position respect to the North Geographic, this value recorded inside the TTR RSPU, together with the Orientation Elevation position and the Range zero check value SP and LP, was the reference you recall to intialize the system. Of course in the MTR RSPU the azimuth reference value was the Orientation value. Ed Thelen here - None of the above, except boresighting - done daily -. and determination of north - done once on Ajax sites -, is unfamiliar to this Ajax techie. I (and this description) have a long way to go - we had no RSPU to initialize - Radar Azimuth (horizontal direction) Determination Digital - post-modernization Note: during the post 1975 modernizations, including replacing many analog components with digital components, the azimuth trig potentiometers were replaced by a digital angle resolver. Here is an explanation of a digital angle resolver. The output was sent to a little digital computer in the RC van where the groundrange and angle were used to compute the E-W and N-S ground values. height was computed from the digitalslantrange times the sin of this angle. Tracking Radar Physical Support One of the many keys to precision tracking between the target and missile tracking radars is the fact that (small) identical errors of tracking by both the target and missile tracking radars cancel out. Example, if both the target and missile tracking radars say that their respective tracks are both 100 yards higher than absolute height, the actual miss distance (if every thing else was perfect) would be 0 yards. Very Interesting and Useful This way, errors due to radar wave (like light wave) refraction in the atmosphere cancel out if both radars are tracking the same point in space (in this discussion we ignore the slightly different paths due to the slightly different physical location of the two radars. The Nike Ajax system assumed that wind buffeting of the two tracking radars would be sufficiently similar so that accurate enough tracking could be accomplished. Since the Nike Hercules had an effective range more than 3 times the Ajax, and a real range more than 4 times the Ajax, errors due to wind buffeting and similar errors could be 3 or 4 times larger, and possibly render Hercules ineffective (too inacurate) at longer ranges. Bubbble surrounds each tracking antenna To counter the wind buffeting, the tracking radars were enclosed in an air inflated fabric bubble. This greatly reduced the wind forces on the tracking antennas. Even if the wind gust shifted the bubble a few inches, the air f orces on the antennas would be greatly reduced during the shift of the bubble. The bubble also protected the antenna from much of the differential heating due to the sun heating (expanding) one side of the mount and antenna relative to the other side (shady side) of the mount and antenna. Although both tracking antennas would likely be illuminated by the sun the same way, vertical alignment was usually made by one person at slightly different times (an error source) and one was never confident that everything was identical anyway. Wind Force and Sun Heating on Tower Mount Ideally, the radars could be located on high ground, well above surrounding trees, buildings. However, in flater areas, towers had to be used to get the tracking radars high enough. The wind also supplies forces and torques on radar towers. The forces and especially the torques shift the top of the tower in space, and shift its angle with the vertical. The shift in space (inches) is much much smaller than other errors, but the shift in angle from vertical could result in much more severe errors. To provide improved resistance to angle errors due to torque in the tower, the tower was actually a double tower. The outer tower was buffeted by the wind, and also the differential expansion due to the sun light heating it. The platform at the top of the outer tower also supported the bubble that protected the antenna from the wind. The inner tower supported the antenna. The inner tower was largely isolated from the wind and the sun which resulted in much more stablity. Image of tower showing: - outer tower platform - bubble base - foot pad from inner tower Simultaneous Tracking Test (the proof) Did all of the above boresighting adjustments and alignments REALLY yield a system that could get a missile within kill distance of the target There is a way to check Have BOTH the target tracking radars and the missile tracking radar track the same target (aircraft). If both radars say the aircraft is in the same place . the tracking system is correctly aligned. Periode. No guess work, no theory, no it oughta, the tracking system IS correctly aligned . Assuming the computer works, the missile takes commands, etc. that NIKE system is capable of guiding the missile to the target However, you remember that the Missile Tracking Radar (MTR) tracks a beacon in the missile, not the skin of the missile. So, (FOR THIS TEST) the MTR is set to: a mode to track the MTR radar reflection from a target, not the missile beacon remove the delay of the beacon (a fixed delay between receiving the MTR radar signal and the firing of the beacon) from the MTR range system The above two changes permit MTR to track the aircraft just the same as the TTR system. An aircraft flies about, and the computer voltages representing N-S, E-W, UP-DOWN for the MTR and the TTR are compared. They ideally should be identical. Placing a sensitive volt meter between say the target radar N-S and the missile radar N-S should ideally yield zero at all times while tracking the same aircraft. In practice they rarely are completely identical due to at least the following error sources. different parts of the aircraft reflect (glint) differently at different angles different pointing servo gains and damping actual level errors actual boresight and alignment errors errors in the range, elevation, azimuth potentiometers errors in components in the computer a wide variety of mechanical errors such as binding, looseness. In spite of the above long list of possible error sources, people at NIKE sites had to and did prove - frequently - that the tracking system errors were very few yards at ranges in excess of 50 miles. Unbelievable but true Simulated Tracking (and jamming) using the T-1 System Tracking aircraft with a NIKE system is trivial if the aircraft is not using jamming . With no jamming, you can easily teach your junior high school kid to be a good NIKE radar operator in an afternoon. A group of afternoon trained junior high kids could do all the NIKE aircraft radar tracking operations necessary to shoot down a non-jamming aircraft. The airforces of the world spend a great deal of time and money to try to defeat radar - and many interesting jamming methods have been developed and are used. How do you train NIKE people to track aircraft that are using Electronic CounterMeasures - ECM (jamming) How do you maintain and enhance this difficult skill Using friendly aircraft for this training and skill maintenance has many disadvantages, including: The friendly air force is unlikely to wish to fly aircraft for hours per day around the various sites to assist in trainning and honing the friendly anti-aircraft forces. Occasional tests may be OK, but almost every day The friendly air force may not wish to turn on their latest and greatest ECM (jamming) equipment for analysis by non-friendly agents. I presume these, and other, reasons led to the development of the ANMPQ-T1 Electronic Warfare Simulator (developed by ITT Baltimore, MD ) which was housed in one very large trailer. The operators in the T-1 trailer could exercise the radar operators in both the Battery Control (BC) van (acquisition operators and battery commander) and the Radar Control (RC) van (Target Tracking operators (azimuth, elevation, range) and Missile Tracking operator. with many types and quantities of interesting ECM (jamming) problems. Jammingspoofing slides from the archives of Association of Old Crows aoc. adobeconnectjammingtechniques5-1-14recordinglauncherfalsefcsContenttruepbModenormal (The introductory part, relative to the pulsed, non-coherent techniques used in Nike) With the Improved Nike Hercules, the jammerspoofer had to fool two different frequency radars in range. Note the attempt to both: a) obscurehide the target b) fool the range operatorsystem to track a fake target Also note: this does not include mechanical jamming, such as chaff, corner reflectors, decoys. This is where ECM was for Nike Ajax and modern techniques are much more interesting. For more details on the T-1 unit, see Lesson 8. Target Simulation - 1.2 megabytes There is a T1 manual on-line at T1 ANMPQ-T1 (another site)(.zip -.pdf files)(10 files totaling 6 Mbytes) For a more general discussion of jamming, go here. LOPARHIPAR target video and ECM was created using sync and preknock signals from the radar. Antenna rotation was slaved to the radar by a device called a flying spot scanner and video was triggered using a system called an antenna pattern generator which simulated not only the main antenna lobe but side lobes as well. By changing the position of the main lobe, the target could be moved in azimuth at will and the ECM would also be positioned along the main lobe. TTR and MTR video was generated much the same as the IF test pulse except that the TTR was given sum, azimuth and elevation signals and long and short pulse. Azimuth and elevation signals were controlled through servos which were slaved to the antenna and range simulation was done by delaying the video from sync. The system could generate 6 independent targets with 4 types of Electronic jamming on 4 different carriers in addition to Acq and track chaff and angle deception. Army Navy Mobile Radar Signal Simulator. I worked on them for about 10 years, a great training device. Simulated up to 6 targets, ECM, and ground clutter. The Chaff cabinet was a bitch to maintain. The T1 also had a reusable missile. The T1 was heat sensitive and the IF strips had to be retuned as the trailer got warmer. The Simulations were injected at the RC BC Vans not at the radars. First, let me say something about analyzing the ECMECCM situation for Nike or any other system. That is somewhat akin to painting a moving train. Technology advances tend to make the advantage shift between ECM and ECCM. So, Im not surprised that some point in time the SSKP was as low as 85. However, I have watched as Air Force planes tried to break Hercules System lock after the TRR was added to the system and they could not do that. I have even read letters from Air Force organizations requesting that Nike not track their planes using their ECCM, because it tended to undermine the confidence of their pilots in their ECM equipment. I dont know the time period that the simulations were done. Ability to do meaningful simulations developed as technology did, so the sophistication (accuracy) of the simulation could be called into question. Second, all simulations involve some approximations and assumptions. Thus, simulations have to go through a validation process to determine the accuracy of the simulation. I have never heard of any meaningful simulations involving the Nike Hercules systems. That doesnt mean there werent any, just that if the 20 or so years working with and around Nike, I would have expected to see something about it. Jeg håper dette hjelper. If you have comments or suggestions, Send e-mail to Ed Thelen Updated November 18, 2015Using R for Time Series Analysis Time Series Analysis This booklet itells you how to use the R statistical software to carry out some simple analyses that are common in analysing time series data. This booklet assumes that the reader has some basic knowledge of time series analysis, and the principal focus of the booklet is not to explain time series analysis, but rather to explain how to carry out these analyses using R. If you are new to time series analysis, and want to learn more about any of the concepts presented here, I would highly recommend the Open University book 8220Time series8221 (product code M24902), available from from the Open University Shop . In this booklet, I will be using time series data sets that have been kindly made available by Rob Hyndman in his Time Series Data Library at robjhyndmanTSDL . If you like this booklet, you may also like to check out my booklet on using R for biomedical statistics, a-little-book-of-r-for-biomedical-statistics. readthedocs. org. and my booklet on using R for multivariate analysis, little-book-of-r-for-multivariate-analysis. readthedocs. org . Reading Time Series Data The first thing that you will want to do to analyse your time series data will be to read it into R, and to plot the time series. You can read data into R using the scan() function, which assumes that your data for successive time points is in a simple text file with one column. For example, the file robjhyndmantsdldatamisckings. dat contains data on the age of death of successive kings of England, starting with William the Conqueror (original source: Hipel and Mcleod, 1994). The data set looks like this: Only the first few lines of the file have been shown. The first three lines contain some comment on the data, and we want to ignore this when we read the data into R. We can use this by using the 8220skip8221 parameter of the scan() function, which specifies how many lines at the top of the file to ignore. To read the file into R, ignoring the first three lines, we type: In this case the age of death of 42 successive kings of England has been read into the variable 8216kings8217. Once you have read the time series data into R, the next step is to store the data in a time series object in R, so that you can use R8217s many functions for analysing time series data. To store the data in a time series object, we use the ts() function in R. For example, to store the data in the variable 8216kings8217 as a time series object in R, we type: Sometimes the time series data set that you have may have been collected at regular intervals that were less than one year, for example, monthly or quarterly. In this case, you can specify the number of times that data was collected per year by using the 8216frequency8217 parameter in the ts() function. For monthly time series data, you set frequency12, while for quarterly time series data, you set frequency4. You can also specify the first year that the data was collected, and the first interval in that year by using the 8216start8217 parameter in the ts() function. For example, if the first data point corresponds to the second quarter of 1986, you would set startc(1986,2). An example is a data set of the number of births per month in New York city, from January 1946 to December 1959 (originally collected by Newton). This data is available in the file robjhyndmantsdldatadatanybirths. dat We can read the data into R, and store it as a time series object, by typing: Similarly, the file robjhyndmantsdldatadatafancy. dat contains monthly sales for a souvenir shop at a beach resort town in Queensland, Australia, for January 1987-December 1993 (original data from Wheelwright and Hyndman, 1998). We can read the data into R by typing: Plotting Time Series Once you have read a time series into R, the next step is usually to make a plot of the time series data, which you can do with the plot. ts() function in R. For example, to plot the time series of the age of death of 42 successive kings of England, we type: We can see from the time plot that this time series could probably be described using an additive model, since the random fluctuations in the data are roughly constant in size over time. Likewise, to plot the time series of the number of births per month in New York city, we type: We can see from this time series that there seems to be seasonal variation in the number of births per month: there is a peak every summer, and a trough every winter. Again, it seems that this time series could probably be described using an additive model, as the seasonal fluctuations are roughly constant in size over time and do not seem to depend on the level of the time series, and the random fluctuations also seem to be roughly constant in size over time. Similarly, to plot the time series of the monthly sales for the souvenir shop at a beach resort town in Queensland, Australia, we type: In this case, it appears that an additive model is not appropriate for describing this time series, since the size of the seasonal fluctuations and random fluctuations seem to increase with the level of the time series. Thus, we may need to transform the time series in order to get a transformed time series that can be described using an additive model. For example, we can transform the time series by calculating the natural log of the original data: Here we can see that the size of the seasonal fluctuations and random fluctuations in the log-transformed time series seem to be roughly constant over time, and do not depend on the level of the time series. Thus, the log-transformed time series can probably be described using an additive model. Decomposing Time Series Decomposing a time series means separating it into its constituent components, which are usually a trend component and an irregular component, and if it is a seasonal time series, a seasonal component. Decomposing Non-Seasonal Data A non-seasonal time series consists of a trend component and an irregular component. Decomposing the time series involves trying to separate the time series into these components, that is, estimating the the trend component and the irregular component. To estimate the trend component of a non-seasonal time series that can be described using an additive model, it is common to use a smoothing method, such as calculating the simple moving average of the time series. The SMA() function in the 8220TTR8221 R package can be used to smooth time series data using a simple moving average. To use this function, we first need to install the 8220TTR8221 R package (for instructions on how to install an R package, see How to install an R package ). Once you have installed the 8220TTR8221 R package, you can load the 8220TTR8221 R package by typing: You can then use the 8220SMA()8221 function to smooth time series data. To use the SMA() function, you need to specify the order (span) of the simple moving average, using the parameter 8220n8221. For example, to calculate a simple moving average of order 5, we set n5 in the SMA() function. For example, as discussed above, the time series of the age of death of 42 successive kings of England appears is non-seasonal, and can probably be described using an additive model, since the random fluctuations in the data are roughly constant in size over time: Thus, we can try to estimate the trend component of this time series by smoothing using a simple moving average. To smooth the time series using a simple moving average of order 3, and plot the smoothed time series data, we type: There still appears to be quite a lot of random fluctuations in the time series smoothed using a simple moving average of order 3. Thus, to estimate the trend component more accurately, we might want to try smoothing the data with a simple moving average of a higher order. This takes a little bit of trial-and-error, to find the right amount of smoothing. For example, we can try using a simple moving average of order 8: The data smoothed with a simple moving average of order 8 gives a clearer picture of the trend component, and we can see that the age of death of the English kings seems to have decreased from about 55 years old to about 38 years old during the reign of the first 20 kings, and then increased after that to about 73 years old by the end of the reign of the 40th king in the time series. Decomposing Seasonal Data A seasonal time series consists of a trend component, a seasonal component and an irregular component. Decomposing the time series means separating the time series into these three components: that is, estimating these three components. To estimate the trend component and seasonal component of a seasonal time series that can be described using an additive model, we can use the 8220decompose()8221 function in R. This function estimates the trend, seasonal, and irregular components of a time series that can be described using an additive model. The function 8220decompose()8221 returns a list object as its result, where the estimates of the seasonal component, trend component and irregular component are stored in named elements of that list objects, called 8220seasonal8221, 8220trend8221, and 8220random8221 respectively. For example, as discussed above, the time series of the number of births per month in New York city is seasonal with a peak every summer and trough every winter, and can probably be described using an additive model since the seasonal and random fluctuations seem to be roughly constant in size over time: To estimate the trend, seasonal and irregular components of this time series, we type: The estimated values of the seasonal, trend and irregular components are now stored in variables birthstimeseriescomponentsseasonal, birthstimeseriescomponentstrend and birthstimeseriescomponentsrandom. For example, we can print out the estimated values of the seasonal component by typing: The estimated seasonal factors are given for the months January-December, and are the same for each year. The largest seasonal factor is for July (about 1.46), and the lowest is for February (about -2.08), indicating that there seems to be a peak in births in July and a trough in births in February each year. We can plot the estimated trend, seasonal, and irregular components of the time series by using the 8220plot()8221 function, for example: The plot above shows the original time series (top), the estimated trend component (second from top), the estimated seasonal component (third from top), and the estimated irregular component (bottom). We see that the estimated trend component shows a small decrease from about 24 in 1947 to about 22 in 1948, followed by a steady increase from then on to about 27 in 1959. Seasonally Adjusting If you have a seasonal time series that can be described using an additive model, you can seasonally adjust the time series by estimating the seasonal component, and subtracting the estimated seasonal component from the original time series. We can do this using the estimate of the seasonal component calculated by the 8220decompose()8221 function. For example, to seasonally adjust the time series of the number of births per month in New York city, we can estimate the seasonal component using 8220decompose()8221, and then subtract the seasonal component from the original time series: We can then plot the seasonally adjusted time series using the 8220plot()8221 function, by typing: You can see that the seasonal variation has been removed from the seasonally adjusted time series. The seasonally adjusted time series now just contains the trend component and an irregular component. Forecasts using Exponential Smoothing Exponential smoothing can be used to make short-term forecasts for time series data. Simple Exponential Smoothing If you have a time series that can be described using an additive model with constant level and no seasonality, you can use simple exponential smoothing to make short-term forecasts. The simple exponential smoothing method provides a way of estimating the level at the current time point. Smoothing is controlled by the parameter alpha for the estimate of the level at the current time point. The value of alpha lies between 0 and 1. Values of alpha that are close to 0 mean that little weight is placed on the most recent observations when making forecasts of future values. For example, the file robjhyndmantsdldatahurstprecip1.dat contains total annual rainfall in inches for London, from 1813-1912 (original data from Hipel and McLeod, 1994). We can read the data into R and plot it by typing: You can see from the plot that there is roughly constant level (the mean stays constant at about 25 inches). The random fluctuations in the time series seem to be roughly constant in size over time, so it is probably appropriate to describe the data using an additive model. Thus, we can make forecasts using simple exponential smoothing. To make forecasts using simple exponential smoothing in R, we can fit a simple exponential smoothing predictive model using the 8220HoltWinters()8221 function in R. To use HoltWinters() for simple exponential smoothing, we need to set the parameters betaFALSE and gammaFALSE in the HoltWinters() function (the beta and gamma parameters are used for Holt8217s exponential smoothing, or Holt-Winters exponential smoothing, as described below). The HoltWinters() function returns a list variable, that contains several named elements. For example, to use simple exponential smoothing to make forecasts for the time series of annual rainfall in London, we type: The output of HoltWinters() tells us that the estimated value of the alpha parameter is about 0.024. This is very close to zero, telling us that the forecasts are based on both recent and less recent observations (although somewhat more weight is placed on recent observations). By default, HoltWinters() just makes forecasts for the same time period covered by our original time series. In this case, our original time series included rainfall for London from 1813-1912, so the forecasts are also for 1813-1912. In the example above, we have stored the output of the HoltWinters() function in the list variable 8220rainseriesforecasts8221. The forecasts made by HoltWinters() are stored in a named element of this list variable called 8220fitted8221, so we can get their values by typing: We can plot the original time series against the forecasts by typing: The plot shows the original time series in black, and the forecasts as a red line. The time series of forecasts is much smoother than the time series of the original data here. As a measure of the accuracy of the forecasts, we can calculate the sum of squared errors for the in-sample forecast errors, that is, the forecast errors for the time period covered by our original time series. The sum-of-squared-errors is stored in a named element of the list variable 8220rainseriesforecasts8221 called 8220SSE8221, so we can get its value by typing: That is, here the sum-of-squared-errors is 1828.855. It is common in simple exponential smoothing to use the first value in the time series as the initial value for the level. For example, in the time series for rainfall in London, the first value is 23.56 (inches) for rainfall in 1813. You can specify the initial value for the level in the HoltWinters() function by using the 8220l. start8221 parameter. For example, to make forecasts with the initial value of the level set to 23.56, we type: As explained above, by default HoltWinters() just makes forecasts for the time period covered by the original data, which is 1813-1912 for the rainfall time series. We can make forecasts for further time points by using the 8220forecast. HoltWinters()8221 function in the R 8220forecast8221 package. To use the forecast. HoltWinters() function, we first need to install the 8220forecast8221 R package (for instructions on how to install an R package, see How to install an R package ). Once you have installed the 8220forecast8221 R package, you can load the 8220forecast8221 R package by typing: When using the forecast. HoltWinters() function, as its first argument (input), you pass it the predictive model that you have already fitted using the HoltWinters() function. For example, in the case of the rainfall time series, we stored the predictive model made using HoltWinters() in the variable 8220rainseriesforecasts8221. You specify how many further time points you want to make forecasts for by using the 8220h8221 parameter in forecast. HoltWinters(). For example, to make a forecast of rainfall for the years 1814-1820 (8 more years) using forecast. HoltWinters(), we type: The forecast. HoltWinters() function gives you the forecast for a year, a 80 prediction interval for the forecast, and a 95 prediction interval for the forecast. For example, the forecasted rainfall for 1920 is about 24.68 inches, with a 95 prediction interval of (16.24, 33.11). To plot the predictions made by forecast. HoltWinters(), we can use the 8220plot. forecast()8221 function: Here the forecasts for 1913-1920 are plotted as a blue line, the 80 prediction interval as an orange shaded area, and the 95 prediction interval as a yellow shaded area. The 8216forecast errors8217 are calculated as the observed values minus predicted values, for each time point. We can only calculate the forecast errors for the time period covered by our original time series, which is 1813-1912 for the rainfall data. As mentioned above, one measure of the accuracy of the predictive model is the sum-of-squared-errors (SSE) for the in-sample forecast errors. The in-sample forecast errors are stored in the named element 8220residuals8221 of the list variable returned by forecast. HoltWinters(). If the predictive model cannot be improved upon, there should be no correlations between forecast errors for successive predictions. In other words, if there are correlations between forecast errors for successive predictions, it is likely that the simple exponential smoothing forecasts could be improved upon by another forecasting technique. To figure out whether this is the case, we can obtain a correlogram of the in-sample forecast errors for lags 1-20. We can calculate a correlogram of the forecast errors using the 8220acf()8221 function in R. To specify the maximum lag that we want to look at, we use the 8220lag. max8221 parameter in acf(). For example, to calculate a correlogram of the in-sample forecast errors for the London rainfall data for lags 1-20, we type: You can see from the sample correlogram that the autocorrelation at lag 3 is just touching the significance bounds. To test whether there is significant evidence for non-zero correlations at lags 1-20, we can carry out a Ljung-Box test. This can be done in R using the 8220Box. test()8221, function. The maximum lag that we want to look at is specified using the 8220lag8221 parameter in the Box. test() function. For example, to test whether there are non-zero autocorrelations at lags 1-20, for the in-sample forecast errors for London rainfall data, we type: Here the Ljung-Box test statistic is 17.4, and the p-value is 0.6, so there is little evidence of non-zero autocorrelations in the in-sample forecast errors at lags 1-20. To be sure that the predictive model cannot be improved upon, it is also a good idea to check whether the forecast errors are normally distributed with mean zero and constant variance. To check whether the forecast errors have constant variance, we can make a time plot of the in-sample forecast errors: The plot shows that the in-sample forecast errors seem to have roughly constant variance over time, although the size of the fluctuations in the start of the time series (1820-1830) may be slightly less than that at later dates (eg. 1840-1850). To check whether the forecast errors are normally distributed with mean zero, we can plot a histogram of the forecast errors, with an overlaid normal curve that has mean zero and the same standard deviation as the distribution of forecast errors. To do this, we can define an R function 8220plotForecastErrors()8221, below: You will have to copy the function above into R in order to use it. You can then use plotForecastErrors() to plot a histogram (with overlaid normal curve) of the forecast errors for the rainfall predictions: The plot shows that the distribution of forecast errors is roughly centred on zero, and is more or less normally distributed, although it seems to be slightly skewed to the right compared to a normal curve. However, the right skew is relatively small, and so it is plausible that the forecast errors are normally distributed with mean zero. The Ljung-Box test showed that there is little evidence of non-zero autocorrelations in the in-sample forecast errors, and the distribution of forecast errors seems to be normally distributed with mean zero. This suggests that the simple exponential smoothing method provides an adequate predictive model for London rainfall, which probably cannot be improved upon. Furthermore, the assumptions that the 80 and 95 predictions intervals were based upon (that there are no autocorrelations in the forecast errors, and the forecast errors are normally distributed with mean zero and constant variance) are probably valid. Holt8217s Exponential Smoothing If you have a time series that can be described using an additive model with increasing or decreasing trend and no seasonality, you can use Holt8217s exponential smoothing to make short-term forecasts. Holt8217s exponential smoothing estimates the level and slope at the current time point. Smoothing is controlled by two parameters, alpha, for the estimate of the level at the current time point, and beta for the estimate of the slope b of the trend component at the current time point. As with simple exponential smoothing, the paramters alpha and beta have values between 0 and 1, and values that are close to 0 mean that little weight is placed on the most recent observations when making forecasts of future values. An example of a time series that can probably be described using an additive model with a trend and no seasonality is the time series of the annual diameter of women8217s skirts at the hem, from 1866 to 1911. The data is available in the file robjhyndmantsdldatarobertsskirts. dat (original data from Hipel and McLeod, 1994). We can read in and plot the data in R by typing: We can see from the plot that there was an increase in hem diameter from about 600 in 1866 to about 1050 in 1880, and that afterwards the hem diameter decreased to about 520 in 1911. To make forecasts, we can fit a predictive model using the HoltWinters() function in R. To use HoltWinters() for Holt8217s exponential smoothing, we need to set the parameter gammaFALSE (the gamma parameter is used for Holt-Winters exponential smoothing, as described below). For example, to use Holt8217s exponential smoothing to fit a predictive model for skirt hem diameter, we type: The estimated value of alpha is 0.84, and of beta is 1.00. These are both high, telling us that both the estimate of the current value of the level, and of the slope b of the trend component, are based mostly upon very recent observations in the time series. This makes good intuitive sense, since the level and the slope of the time series both change quite a lot over time. The value of the sum-of-squared-errors for the in-sample forecast errors is 16954. We can plot the original time series as a black line, with the forecasted values as a red line on top of that, by typing: We can see from the picture that the in-sample forecasts agree pretty well with the observed values, although they tend to lag behind the observed values a little bit. If you wish, you can specify the initial values of the level and the slope b of the trend component by using the 8220l. start8221 and 8220b. start8221 arguments for the HoltWinters() function. It is common to set the initial value of the level to the first value in the time series (608 for the skirts data), and the initial value of the slope to the second value minus the first value (9 for the skirts data). For example, to fit a predictive model to the skirt hem data using Holt8217s exponential smoothing, with initial values of 608 for the level and 9 for the slope b of the trend component, we type: As for simple exponential smoothing, we can make forecasts for future times not covered by the original time series by using the forecast. HoltWinters() function in the 8220forecast8221 package. For example, our time series data for skirt hems was for 1866 to 1911, so we can make predictions for 1912 to 1930 (19 more data points), and plot them, by typing: The forecasts are shown as a blue line, with the 80 prediction intervals as an orange shaded area, and the 95 prediction intervals as a yellow shaded area. As for simple exponential smoothing, we can check whether the predictive model could be improved upon by checking whether the in-sample forecast errors show non-zero autocorrelations at lags 1-20. For example, for the skirt hem data, we can make a correlogram, and carry out the Ljung-Box test, by typing: Here the correlogram shows that the sample autocorrelation for the in-sample forecast errors at lag 5 exceeds the significance bounds. However, we would expect one in 20 of the autocorrelations for the first twenty lags to exceed the 95 significance bounds by chance alone. Indeed, when we carry out the Ljung-Box test, the p-value is 0.47, indicating that there is little evidence of non-zero autocorrelations in the in-sample forecast errors at lags 1-20. As for simple exponential smoothing, we should also check that the forecast errors have constant variance over time, and are normally distributed with mean zero. We can do this by making a time plot of forecast errors, and a histogram of the distribution of forecast errors with an overlaid normal curve: The time plot of forecast errors shows that the forecast errors have roughly constant variance over time. The histogram of forecast errors show that it is plausible that the forecast errors are normally distributed with mean zero and constant variance. Thus, the Ljung-Box test shows that there is little evidence of autocorrelations in the forecast errors, while the time plot and histogram of forecast errors show that it is plausible that the forecast errors are normally distributed with mean zero and constant variance. Therefore, we can conclude that Holt8217s exponential smoothing provides an adequate predictive model for skirt hem diameters, which probably cannot be improved upon. In addition, it means that the assumptions that the 80 and 95 predictions intervals were based upon are probably valid. Holt-Winters Exponential Smoothing If you have a time series that can be described using an additive model with increasing or decreasing trend and seasonality, you can use Holt-Winters exponential smoothing to make short-term forecasts. Holt-Winters exponential smoothing estimates the level, slope and seasonal component at the current time point. Smoothing is controlled by three parameters: alpha, beta, and gamma, for the estimates of the level, slope b of the trend component, and the seasonal component, respectively, at the current time point. The parameters alpha, beta and gamma all have values between 0 and 1, and values that are close to 0 mean that relatively little weight is placed on the most recent observations when making forecasts of future values. An example of a time series that can probably be described using an additive model with a trend and seasonality is the time series of the log of monthly sales for the souvenir shop at a beach resort town in Queensland, Australia (discussed above): To make forecasts, we can fit a predictive model using the HoltWinters() function. For example, to fit a predictive model for the log of the monthly sales in the souvenir shop, we type: The estimated values of alpha, beta and gamma are 0.41, 0.00, and 0.96, respectively. The value of alpha (0.41) is relatively low, indicating that the estimate of the level at the current time point is based upon both recent observations and some observations in the more distant past. The value of beta is 0.00, indicating that the estimate of the slope b of the trend component is not updated over the time series, and instead is set equal to its initial value. This makes good intuitive sense, as the level changes quite a bit over the time series, but the slope b of the trend component remains roughly the same. In contrast, the value of gamma (0.96) is high, indicating that the estimate of the seasonal component at the current time point is just based upon very recent observations. As for simple exponential smoothing and Holt8217s exponential smoothing, we can plot the original time series as a black line, with the forecasted values as a red line on top of that: We see from the plot that the Holt-Winters exponential method is very successful in predicting the seasonal peaks, which occur roughly in November every year. To make forecasts for future times not included in the original time series, we use the 8220forecast. HoltWinters()8221 function in the 8220forecast8221 package. For example, the original data for the souvenir sales is from January 1987 to December 1993. If we wanted to make forecasts for January 1994 to December 1998 (48 more months), and plot the forecasts, we would type: The forecasts are shown as a blue line, and the orange and yellow shaded areas show 80 and 95 prediction intervals, respectively. We can investigate whether the predictive model can be improved upon by checking whether the in-sample forecast errors show non-zero autocorrelations at lags 1-20, by making a correlogram and carrying out the Ljung-Box test: The correlogram shows that the autocorrelations for the in-sample forecast errors do not exceed the significance bounds for lags 1-20. Furthermore, the p-value for Ljung-Box test is 0.6, indicating that there is little evidence of non-zero autocorrelations at lags 1-20. We can check whether the forecast errors have constant variance over time, and are normally distributed with mean zero, by making a time plot of the forecast errors and a histogram (with overlaid normal curve): From the time plot, it appears plausible that the forecast errors have constant variance over time. From the histogram of forecast errors, it seems plausible that the forecast errors are normally distributed with mean zero. Thus, there is little evidence of autocorrelation at lags 1-20 for the forecast errors, and the forecast errors appear to be normally distributed with mean zero and constant variance over time. This suggests that Holt-Winters exponential smoothing provides an adequate predictive model of the log of sales at the souvenir shop, which probably cannot be improved upon. Furthermore, the assumptions upon which the prediction intervals were based are probably valid. ARIMA Models Exponential smoothing methods are useful for making forecasts, and make no assumptions about the correlations between successive values of the time series. However, if you want to make prediction intervals for forecasts made using exponential smoothing methods, the prediction intervals require that the forecast errors are uncorrelated and are normally distributed with mean zero and constant variance. While exponential smoothing methods do not make any assumptions about correlations between successive values of the time series, in some cases you can make a better predictive model by taking correlations in the data into account. Autoregressive Integrated Moving Average (ARIMA) models include an explicit statistical model for the irregular component of a time series, that allows for non-zero autocorrelations in the irregular component. Differencing a Time Series ARIMA models are defined for stationary time series. Therefore, if you start off with a non-stationary time series, you will first need to 8216difference8217 the time series until you obtain a stationary time series. If you have to difference the time series d times to obtain a stationary series, then you have an ARIMA(p, d,q) model, where d is the order of differencing used. You can difference a time series using the 8220diff()8221 function in R. For example, the time series of the annual diameter of women8217s skirts at the hem, from 1866 to 1911 is not stationary in mean, as the level changes a lot over time: We can difference the time series (which we stored in 8220skirtsseries8221, see above) once, and plot the differenced series, by typing: The resulting time series of first differences (above) does not appear to be stationary in mean. Therefore, we can difference the time series twice, to see if that gives us a stationary time series: Formal tests for stationarity Formal tests for stationarity called 8220unit root tests8221 are available in the fUnitRoots package, available on CRAN, but will not be discussed here. The time series of second differences (above) does appear to be stationary in mean and variance, as the level of the series stays roughly constant over time, and the variance of the series appears roughly constant over time. Thus, it appears that we need to difference the time series of the diameter of skirts twice in order to achieve a stationary series. If you need to difference your original time series data d times in order to obtain a stationary time series, this means that you can use an ARIMA(p, d,q) model for your time series, where d is the order of differencing used. For example, for the time series of the diameter of women8217s skirts, we had to difference the time series twice, and so the order of differencing (d) is 2. This means that you can use an ARIMA(p,2,q) model for your time series. The next step is to figure out the values of p and q for the ARIMA model. Another example is the time series of the age of death of the successive kings of England (see above): From the time plot (above), we can see that the time series is not stationary in mean. To calculate the time series of first differences, and plot it, we type: The time series of first differences appears to be stationary in mean and variance, and so an ARIMA(p,1,q) model is probably appropriate for the time series of the age of death of the kings of England. By taking the time series of first differences, we have removed the trend component of the time series of the ages at death of the kings, and are left with an irregular component. We can now examine whether there are correlations between successive terms of this irregular component if so, this could help us to make a predictive model for the ages at death of the kings. Selecting a Candidate ARIMA Model If your time series is stationary, or if you have transformed it to a stationary time series by differencing d times, the next step is to select the appropriate ARIMA model, which means finding the values of most appropriate values of p and q for an ARIMA(p, d,q) model. To do this, you usually need to examine the correlogram and partial correlogram of the stationary time series. To plot a correlogram and partial correlogram, we can use the 8220acf()8221 and 8220pacf()8221 functions in R, respectively. To get the actual values of the autocorrelations and partial autocorrelations, we set 8220plotFALSE8221 in the 8220acf()8221 and 8220pacf()8221 functions. Example of the Ages at Death of the Kings of England For example, to plot the correlogram for lags 1-20 of the once differenced time series of the ages at death of the kings of England, and to get the values of the autocorrelations, we type: We see from the correlogram that the autocorrelation at lag 1 (-0.360) exceeds the significance bounds, but all other autocorrelations between lags 1-20 do not exceed the significance bounds. To plot the partial correlogram for lags 1-20 for the once differenced time series of the ages at death of the English kings, and get the values of the partial autocorrelations, we use the 8220pacf()8221 function, by typing: The partial correlogram shows that the partial autocorrelations at lags 1, 2 and 3 exceed the significance bounds, are negative, and are slowly decreasing in magnitude with increasing lag (lag 1: -0.360, lag 2: -0.335, lag 3:-0.321). The partial autocorrelations tail off to zero after lag 3. Since the correlogram is zero after lag 1, and the partial correlogram tails off to zero after lag 3, this means that the following ARMA (autoregressive moving average) models are possible for the time series of first differences: an ARMA(3,0) model, that is, an autoregressive model of order p3, since the partial autocorrelogram is zero after lag 3, and the autocorrelogram tails off to zero (although perhaps too abruptly for this model to be appropriate) an ARMA(0,1) model, that is, a moving average model of order q1, since the autocorrelogram is zero after lag 1 and the partial autocorrelogram tails off to zero an ARMA(p, q) model, that is, a mixed model with p and q greater than 0, since the autocorrelogram and partial correlogram tail off to zero (although the correlogram probably tails off to zero too abruptly for this model to be appropriate) We use the principle of parsimony to decide which model is best: that is, we assum e that the model with the fewest parameters is best. The ARMA(3,0) model has 3 parameters, the ARMA(0,1) model has 1 parameter, and the ARMA(p, q) model has at least 2 parameters. Therefore, the ARMA(0,1) model is taken as the best model. An ARMA(0,1) model is a moving average model of order 1, or MA(1) model. This model can be written as: Xt - mu Zt - (theta Zt-1), where Xt is the stationary time series we are studying (the first differenced series of ages at death of English kings), mu is the mean of time series Xt, Zt is white noise with mean zero and constant variance, and theta is a parameter that can be estimated. A MA (moving average) model is usually used to model a time series that shows short-term dependencies between successive observations. Intuitively, it makes good sense that a MA model can be used to describe the irregular component in the time series of ages at death of English kings, as we might expect the age at death of a particular English king to have some effect on the ages at death of the next king or two, but not much effect on the ages at death of kings that reign much longer after that. Shortcut: the auto. arima() function The auto. arima() function can be used to find the appropriate ARIMA model, eg. type 8220library(forecast)8221, then 8220auto. arima(kings)8221. The output says an appropriate model is ARIMA(0,1,1). Since an ARMA(0,1) model (with p0, q1) is taken to be the best candidate model for the time series of first differences of the ages at death of English kings, then the original time series of the ages of death can be modelled using an ARIMA(0,1,1) model (with p0, d1, q1, where d is the order of differencing required). Example of the Volcanic Dust Veil in the Northern Hemisphere Let8217s take another example of selecting an appropriate ARIMA model. The file file robjhyndmantsdldataannualdvi. dat contains data on the volcanic dust veil index in the northern hemisphere, from 1500-1969 (original data from Hipel and Mcleod, 1994). This is a measure of the impact of volcanic eruptions8217 release of dust and aerosols into the environment. We can read it into R and make a time plot by typing: From the time plot, it appears that the random fluctuations in the time series are roughly constant in size over time, so an additive model is probably appropriate for describing this time series. Furthermore, the time series appears to be stationary in mean and variance, as its level and variance appear to be roughly constant over time. Therefore, we do not need to difference this series in order to fit an ARIMA model, but can fit an ARIMA model to the original series (the order of differencing required, d, is zero here). We can now plot a correlogram and partial correlogram for lags 1-20 to investigate what ARIMA model to use: We see from the correlogram that the autocorrelations for lags 1, 2 and 3 exceed the significance bounds, and that the autocorrelations tail off to zero after lag 3. The autocorrelations for lags 1, 2, 3 are positive, and decrease in magnitude with increasing lag (lag 1: 0.666, lag 2: 0.374, lag 3: 0.162). The autocorrelation for lags 19 and 20 exceed the significance bounds too, but it is likely that this is due to chance, since they just exceed the significance bounds (especially for lag 19), the autocorrelations for lags 4-18 do not exceed the signifiance bounds, and we would expect 1 in 20 lags to exceed the 95 significance bounds by chance alone. From the partial autocorrelogram, we see that the partial autocorrelation at lag 1 is positive and exceeds the significance bounds (0.666), while the partial autocorrelation at lag 2 is negative and also exceeds the significance bounds (-0.126). The partial autocorrelations tail off to zero after lag 2. Since the correlogram tails off to zero after lag 3, and the partial correlogram is zero after lag 2, the following ARMA models are possible for the time series: an ARMA(2,0) model, since the partial autocorrelogram is zero after lag 2, and the correlogram tails off to zero after lag 3, and the partial correlogram is zero after lag 2 an ARMA(0,3) model, since the autocorrelogram is zero after lag 3, and the partial correlogram tails off to zero (although perhaps too abruptly for this model to be appropriate) an ARMA(p, q) mixed model, since the correlogram and partial correlogram tail off to zero (although the partial correlogram perhaps tails off too abruptly for this model to be appropriate) Shortcut: the auto. arima() function Again, we can use auto. arima() to find an appropriate model, by typing 8220auto. arima(volcanodust)8221, which gives us ARIMA(1,0,2), which has 3 parameters. However, different criteria can be used to select a model (see auto. arima() help page). If we use the 8220bic8221 criterion, which penalises the number of parameters, we get ARIMA(2,0,0), which is ARMA(2,0): 8220auto. arima(volcanodust, ic8221bic8221)8221. The ARMA(2,0) model has 2 parameters, the ARMA(0,3) model has 3 parameters, and the ARMA(p, q) model has at least 2 parameters. Therefore, using the principle of parsimony, the ARMA(2,0) model and ARMA(p, q) model are equally good candidate models. An ARMA(2,0) model is an autoregressive model of order 2, or AR(2) model. This model can be written as: Xt - mu (Beta1 (Xt-1 - mu)) (Beta2 (Xt-2 - mu)) Zt, where Xt is the stationary time series we are studying (the time series of volcanic dust veil index), mu is the mean of time series Xt, Beta1 and Beta2 are parameters to be estimated, and Zt is white noise with mean zero and constant variance. An AR (autoregressive) model is usually used to model a time series which shows longer term dependencies between successive observations. Intuitively, it makes sense that an AR model could be used to describe the time series of volcanic dust veil index, as we would expect volcanic dust and aerosol levels in one year to affect those in much later years, since the dust and aerosols are unlikely to disappear quickly. If an ARMA(2,0) model (with p2, q0) is used to model the time series of volcanic dust veil index, it would mean that an ARIMA(2,0,0) model can be used (with p2, d0, q0, where d is the order of differencing required). Similarly, if an ARMA(p, q) mixed model is used, where p and q are both greater than zero, than an ARIMA(p,0,q) model can be used. Forecasting Using an ARIMA Model Once you have selected the best candidate ARIMA(p, d,q) model for your time series data, you can estimate the parameters of that ARIMA model, and use that as a predictive model for making forecasts for future values of your time series. You can estimate the parameters of an ARIMA(p, d,q) model using the 8220arima()8221 function in R. Example of the Ages at Death of the Kings of England For example, we discussed above that an ARIMA(0,1,1) model seems a plausible model for the ages at deaths of the kings of England. You can specify the values of p, d and q in the ARIMA model by using the 8220order8221 argument of the 8220arima()8221 function in R. To fit an ARIMA(p, d,q) model to this time series (which we stored in the variable 8220kingstimeseries8221, see above), we type: As mentioned above, if we are fitting an ARIMA(0,1,1) model to our time series, it means we are fitting an an ARMA(0,1) model to the time series of first differences. An ARMA(0,1) model can be written Xt - mu Zt - (theta Zt-1), where theta is a parameter to be estimated. From the output of the 8220arima()8221 R function (above), the estimated value of theta (given as 8216ma18217 in the R output) is -0.7218 in the case of the ARIMA(0,1,1) model fitted to the time series of ages at death of kings. Specifying the confidence level for prediction intervals You can specify the confidence level for prediction intervals in forecast. Arima() by using the 8220level8221 argument. For example, to get a 99.5 prediction interval, we would type 8220forecast. Arima(kingstimeseriesarima, h5, levelc(99.5))8221. We can then use the ARIMA model to make forecasts for future values of the time series, using the 8220forecast. Arima()8221 function in the 8220forecast8221 R package. For example, to forecast the ages at death of the next five English kings, we type: The original time series for the English kings includes the ages at death of 42 English kings. The forecast. Arima() function gives us a forecast of the age of death of the next five English kings (kings 43-47), as well as 80 and 95 prediction intervals for those predictions. The age of death of the 42nd English king was 56 years (the last observed value in our time series), and the ARIMA model gives the forecasted age at death of the next five kings as 67.8 years. We can plot the observed ages of death for the first 42 kings, as well as the ages that would be predicted for these 42 kings and for the next 5 kings using our ARIMA(0,1,1) model, by typing: As in the case of exponential smoothing models, it is a good idea to investigate whether the forecast errors of an ARIMA model are normally distributed with mean zero and constant variance, and whether the are correlations between successive forecast errors. For example, we can make a correlogram of the forecast errors for our ARIMA(0,1,1) model for the ages at death of kings, and perform the Ljung-Box test for lags 1-20, by typing: Since the correlogram shows that none of the sample autocorrelations for lags 1-20 exceed the significance bounds, and the p-value for the Ljung-Box test is 0.9, we can conclude that there is very little evidence for non-zero autocorrelations in the forecast errors at lags 1-20. To investigate whether the forecast errors are normally distributed with mean zero and constant variance, we can make a time plot and histogram (with overlaid normal curve) of the forecast errors: The time plot of the in-sample forecast errors shows that the variance of the forecast errors seems to be roughly constant over time (though perhaps there is slightly higher variance for the second half of the time series). The histogram of the time series shows that the forecast errors are roughly normally distributed and the mean seems to be close to zero. Therefore, it is plausible that the forecast errors are normally distributed with mean zero and constant variance. Since successive forecast errors do not seem to be correlated, and the forecast errors seem to be normally distributed with mean zero and constant variance, the ARIMA(0,1,1) does seem to provide an adequate predictive model for the ages at death of English kings. Example of the Volcanic Dust Veil in the Northern Hemisphere We discussed above that an appropriate ARIMA model for the time series of volcanic dust veil index may be an ARIMA(2,0,0) model. To fit an ARIMA(2,0,0) model to this time series, we can type: As mentioned above, an ARIMA(2,0,0) model can be written as: written as: Xt - mu (Beta1 (Xt-1 - mu)) (Beta2 (Xt-2 - mu)) Zt, where Beta1 and Beta2 are parameters to be estimated. The output of the arima() function tells us that Beta1 and Beta2 are estimated as 0.7533 and -0.1268 here (given as ar1 and ar2 in the output of arima()). Now we have fitted the ARIMA(2,0,0) model, we can use the 8220forecast. ARIMA()8221 model to predict future values of the volcanic dust veil index. The original data includes the years 1500-1969. To make predictions for the years 1970-2000 (31 more years), we type: We can plot the original time series, and the forecasted values, by typing: One worrying thing is that the model has predicted negative values for the volcanic dust veil index, but this variable can only have positive values The reason is that the arima() and forecast. Arima() functions don8217t know that the variable can only take positive values. Clearly, this is not a very desirable feature of our current predictive model. Again, we should investigate whether the forecast errors seem to be correlated, and whether they are normally distributed with mean zero and constant variance. To check for correlations between successive forecast errors, we can make a correlogram and use the Ljung-Box test: The correlogram shows that the sample autocorrelation at lag 20 exceeds the significance bounds. However, this is probably due to chance, since we would expect one out of 20 sample autocorrelations to exceed the 95 significance bounds. Furthermore, the p-value for the Ljung-Box test is 0.2, indicating that there is little evidence for non-zero autocorrelations in the forecast errors for lags 1-20. To check whether the forecast errors are normally distributed with mean zero and constant variance, we make a time plot of the forecast errors, and a histogram: The time plot of forecast errors shows that the forecast errors seem to have roughly constant variance over time. However, the time series of forecast errors seems to have a negative mean, rather than a zero mean. We can confirm this by calculating the mean forecast error, which turns out to be about -0.22: The histogram of forecast errors (above) shows that although the mean value of the forecast errors is negative, the distribution of forecast errors is skewed to the right compared to a normal curve. Therefore, it seems that we cannot comfortably conclude that the forecast errors are normally distributed with mean zero and constant variance Thus, it is likely that our ARIMA(2,0,0) model for the time series of volcanic dust veil index is not the best model that we could make, and could almost definitely be improved upon Links and Further Reading Here are some links for further reading. For a more in-depth introduction to R, a good online tutorial is available on the 8220Kickstarting R8221 website, cran. r-project. orgdoccontribLemon-kickstart . There is another nice (slightly more in-depth) tutorial to R available on the 8220Introduction to R8221 website, cran. r-project. orgdocmanualsR-intro. html . You can find a list of R packages for analysing time series data on the CRAN Time Series Task View webpage . To learn about time series analysis, I would highly recommend the book 8220Time series8221 (product code M24902) by the Open University, available from the Open University Shop . There are two books available in the 8220Use R8221 series on using R for time series analyses, the first is Introductory Time Series with R by Cowpertwait and Metcalfe, and the second is Analysis of Integrated and Cointegrated Time Series with R by Pfaff. Acknowledgements I am grateful to Professor Rob Hyndman. for kindly allowing me to use the time series data sets from his Time Series Data Library (TSDL) in the examples in this booklet. Many of the examples in this booklet are inspired by examples in the excellent Open University book, 8220Time series8221 (product code M24902), available from the Open University Shop . Thank you to Ravi Aranke for bringing auto. arima() to my attention, and Maurice Omane-Adjepong for bringing unit root tests to my attention, and Christian Seubert for noticing a small bug in plotForecastErrors(). Thank you for other comments to Antoine Binard and Bill Johnston. I will be grateful if you will send me (Avril Coghlan) corrections or suggestions for improvements to my email address alc 64 sanger 46 ac 46 uk

No comments:

Post a Comment