Skip to contents

A collection of functions to compute column statistical properties of financial and economic time series data.

Usage

colStats(x, FUN, ...) 

colSds(x, ...)
colVars(x, ...)
colSkewness(x, ...)
colKurtosis(x, ...)
colMaxs(x, ...)
colMins(x, ...)
colProds(x, ...)
colQuantiles(x, prob = 0.05, ...)

Arguments

x

a rectangular object which can be transformed into a matrix by the function as.matrix.

FUN

a function name, the statistical function to be applied.

prob

a numeric value in [0,1].

...

arguments to be passed.

Details

colStatscalculates column statistics,
colSumscalculates column sums,
colMeanscalculates column means,
colSdscalculates column standard deviations,
colVarscalculates column variances,
colSkewnesscalculates column skewness,
colKurtosiscalculates column kurtosis,
colMaxscalculates maximum values in each column,
colMinscalculates minimum values in each column,
colProdscomputes product of all values in each column,
colQuantilescomputes quantiles of each column.

Value

each function returns a numeric vector of the statistics, one for each column

See also

Examples

## Simulated Return Data in Matrix Form -
   x = matrix(rnorm(252), ncol = 2)
     
## Mean Columnwise Statistics -
   colStats(x, FUN = mean)
#> [1] -0.08011812 -0.06498521
   
## Quantiles Column by Column -
   colQuantiles(x, prob = 0.10, type = 1)  
#> [1] -1.342956 -1.275966