Ripasso su xts e la funzione plot()

Visualizzare le serie temporali in R

Arnaud Amsellem

Quantitative Trader and creator of the R Trader blog

Ripasso su xts

  • Classe speciale per gestire serie temporali
  • eXtensible Time Series
  • xts = Indice temporale + Matrice
  • L’indice è un oggetto tempo: Date, POSIX Time, timeDate, chron

ch1_vid1_slides.003.png

Visualizzare le serie temporali in R

plot() e plot.xts()

  • plot()
  • plot.xts()
  • plot() può sostituire plot.xts() quando l’oggetto da tracciare è un xts
Visualizzare le serie temporali in R

Uso della funzione plot()

ch1_vid1_slides.010.png

plot(my_ts)
Visualizzare le serie temporali in R

Uso della funzione plot()

ch1_vid1_slides.013.png

plot(my_ts, main = "my first time series")
lines(my_ts, col = "red", lwd = 2)
Visualizzare le serie temporali in R

Uso della funzione plot()

ch1_vid1_slides.022.png

plot(my_ts, main = "my first time series", 
            sub = "from Sep. 2008 to Dec. 2016")
lines(my_ts, col = "red", lwd = 2)
Visualizzare le serie temporali in R

Passiamo alla pratica!

Visualizzare le serie temporali in R

Preparing Video For Download...