getreturns | R Documentation |
Calculate returns or log-returns for multivariate time series
getreturns(x, type = c("basic", "log"))
x |
Multivariate time series |
type |
Type of return: basic return ("basic") or log-return ("log") |
The returns
returns <- getreturns(EuStockMarkets)
log_returns <- getreturns(EuStockMarkets,
type = "log")
par(mfrow=c(1, 3))
matplot(EuStockMarkets, type = 'l', main = "Closing Prices of \n European stocks (1991-1998)",
xlab = "time")
matplot(returns, type = 'l', main = "Returns", xlab = "time")
matplot(log_returns, type = 'l', main = "Log-returns", xlab = "time")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.