y <-scan("//ad.uni-hamburg.de/basis/mit/bm01/BAB5975/Documents/Lehre/ZRA/Anwendungen/Luchse/Luchs.dat") #Daten einlesen (Schlittgen 2015, S. 15) y_aus <- ts(y, start=1821, frequency = 1) #Erstellen einer Zeitreihe auf der Grundlage der Ausgangsdaten y ts.plot(y_aus, xlab="Jahr", ylab="Anzahl Luchs-Pelze") #Die Varianz steigt mit dem Niveau an. #Durch die logarithmische Transformation wird die Varianz stabilisiert. y <- ts(log10(y), start=1821, frequency = 1) par(mfrow = c(2,1)) ts.plot(y_aus, xlab="Jahr", ylab="Anzahl Luchs-Pelze", type = "o") ts.plot(y, xlab="Jahr", ylab="Anzahl Luchs-Pelze (log. transf.)", type = "o") tsp(y) #time series properties #Verschiedene Zeitreihendarstellungen: par(mfrow = c(1,1)) ts.plot(y, xlab="Jahr", ylab="Anzahl Luchs-Pelze (log. transf.)", type="p") ts.plot(y, xlab="Jahr", ylab="Anzahl Luchs-Pelze (log. transf.)", type="o") ts.plot(y, xlab="Jahr", ylab="Anzahl Luchs-Pelze (log. transf.)") source("//ad.uni-hamburg.de/basis/mit/bm01/BAB5975/Documents/Lehre/ZRA/Anwendungen/tsutil.r")# Einlesen der Datei tsutil.r #Diese Datei enthält die Funktion statcheck statcheck(y,3) #Stationaritätscheck acf(y, lag.max=25, ci=0) # Korrelogramm