Matriz Móvil de Momentos Estadísticos

En el siguiente renglón se accede al código en GitHub que es utilizado para descargar los precios históricos de los activos y se calculan los rendimientos. En los objetos Rendimientos


In [3]:
RawGitHub <- "https://raw.githubusercontent.com/ITESOIF/OPIIF-P16/"
OPIIF_Datos <- paste(RawGitHub,"master/OPIIF_Datos/OPIIF_Datos.r",sep = "")
downloader::source_url(OPIIF_Datos,prompt=FALSE,quiet=TRUE)



Loading required package: timeDate
Loading required package: timeSeries


Rmetrics Package fBasics
Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
Loading required package: xts
Loading required package: zoo

Attaching package: ‘zoo’

The following object is masked from ‘package:timeSeries’:

    time<-

The following objects are masked from ‘package:base’:

    as.Date, as.Date.numeric


Attaching package: ‘PerformanceAnalytics’

The following objects are masked from ‘package:timeDate’:

    kurtosis, skewness

The following object is masked from ‘package:graphics’:

    legend

Loading required package: TTR

Attaching package: ‘TTR’

The following object is masked from ‘package:fBasics’:

    volatility

Version 0.4-0 included new data defaults. See ?getSymbols.
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols
pausing 1 second between requests for more than 5 symbols

In [5]:
DfRends <- Rendimientos
NumActivos <- length(DfRends[1,])-1
Years   <- unique(year(DfRends$Index))
Months  <- unique(month(DfRends$Index))
EstadMens  <- data.frame(matrix(ncol = NumActivos+1, nrow = 5))
row.names(EstadMens) <- c("Media","Varianza","DesvEst","Sesgo","Kurtosis")


Error in as.POSIXlt.default(x, tz = tz(x)): do not know how to convert 'x' to class “POSIXlt”
Error in as.POSIXlt.default(x, tz = tz(x)): do not know how to convert 'x' to class “POSIXlt”

In [ ]: