## SOURCE("fBasics.14A-StylizedFacts")
## logpdfPlot -
xmpBasics("Start: log PDF Plot > ")
# Plot the log-returns of the NYSE Composite Index
# and compare with the Gaussian Distribution:
par(mfrow = c(2, 2))
data(nyseres)
# Extract from data.frame:
x = nyseres[, 1]
logpdfPlot(x, main = "log PDF Plot")
# loglogpdfPlot -
# Plot the log-returns of the NYSE Composite Index
# and compare with the Gaussian Distribution:
logpdfPlot(x, type = "log-log", main = "log-log PDF Plot")
## qqgaussPlot -
xmpBasics("Next: QQ Normal Plot > ")
# Create a Gaussian Quantile-Quantile plot
# for the NYSE Composite Index log-returns:
qqgaussPlot(x)
## scalinglawPlot -
xmpBasics("Next: Scaling Law Plot > ")
# Investigate and Plot the Scaling Law
# for the NYSE Composite Index log-returns:
scalinglawPlot(x)
## acfPlot -
xmpBasics("Next: Auto-Correlation Function Plot > ")
data(EuStockMarkets)
par(mfrow = c(2, 1))
returns.ftse = diff(log(EuStockMarkets[,"FTSE"]))
returns.dax = diff(log(EuStockMarkets[,"DAX"]))
acfPlot(x = returns.ftse, main = "FTSE Autocorrelation")
## ccfPlot -
xmpBasics("Next: Cross-Correlation Function Plot > ")
ccfPlot(x = returns.ftse, y = returns.dax,
main="FTSE - DAX Crosscorrelation")
## lmacfPlot -
xmpBasics("Next: Long-Memory ACF Plot > ")
# Estimate and plot the Long Memory ACF of the DAX volatilities
# and evaluate the Hurst exponent of a time series:
par(mfrow = c(2, 1))
lmacfPlot(abs(returns.dax), main = "DAX")
## teffectPlot -
xmpBasics("Next: Taylor Effect Plot > ")
# Estimate and plot the Taylor Effect for the
# log returns of the NYSE Compositie Index.
teffectPlot(returns.dax)
teffectPlot(returns.ftse)
Run the code above in your browser using DataLab