Computes basic financial time series statistics.
basicStats(x, ci = 0.95)
a data frame with one column for each column of x
and the
following rows:
number of observations,
number of NA
s
minimum,
maximum,
lower quartile,
upper quartile,
mean,
median,
sum of the values,
standard error of the mean,
lower limit of the CI for the mean,
upper limit of the CI for the mean,
variance,
standard deviation,
skewness coefficient,
excess kurtosis.
an object of class "timeSeries"
or any other object which can
be transformed by the function as.timeSeries
into an object
of class "timeSeries"
. The latter case, other than
"timeSeries"
objects, is more or less untested.
confidence interval, a numeric value, by default 0.95, i.e. 95%.
Computes a number of sample statistics for each column of
x
. The statistics should be clear from the row names of the
returned data frame.
"LCL"
and "UCL"
stand for lower/upper confidence limits,
computed under the null hypothesis of i.i.d.
"Kurtosis"
represents the excess kurtosis, so its
theoretical value for the normal distribution is zero, not 3.
These statistics are often computed as a first step in the study of returns on financial assets. In that case any inference on these statistics (including the confidence intervals for the mean) should be considered exploratory, since returns are virtually never i.i.d.
set.seed(1234)
## Simulated Monthly Return Data
tS <- timeSeries(matrix(rnorm(12)), timeDate::timeCalendar())
basicStats(tS)
Run the code above in your browser using DataLab