Skip to contents

Functions to compute row statistical properties of financial and economic time series data.

The functions are:

rowStatscalculates row statistics,
rowSdscalculates row standard deviations,
rowVarscalculates row variances,
rowSkewnesscalculates row skewness,
rowKurtosiscalculates row kurtosis,
rowMaxscalculates maximum values in each row,
rowMinscalculates minimum values in each row,
rowProdscomputes product of all values in each row,
rowQuantilescomputes quantiles of each row.

Usage

rowStats(x, FUN, ...) 

<!-- % rowSums(x, \dots) -->
<!-- % rowMeans(x, \dots) -->

rowSds(x, ...)
rowVars(x, ...)
rowSkewness(x, ...)
rowKurtosis(x, ...)
rowMaxs(x, ...)
rowMins(x, ...)
rowProds(x, ...)
rowQuantiles(x, prob = 0.05, ...)

rowStdevs(x, ...)
rowAvgs(x, ...)

Arguments

FUN

a function name, the statistical function to be applied.

prob

a numeric value, the probability with value in [0,1].

x

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

...

arguments to be passed.

Value

each function returns a numeric vector of the statistics

See also

colStats

Examples

## Simulated Return Data in Matrix Form:
   x = matrix(rnorm(10*10), nrow = 10)
     
## rowStats -
   rowStats(x, FUN = mean)
#>  [1]  0.18422758 -0.07130207  0.41613040  0.01773426  0.33939605  0.18244729
#>  [7]  0.19210571 -0.22218828  0.23648095 -0.14000824
   
## rowMaxs -
   rowMaxs(x)  
#>  [1] 1.8815871 0.6135046 1.4881833 1.6704000 2.9194556 2.4254361 1.7637915
#>  [8] 1.0885857 2.1724900 0.9874172