Learn R Programming

generalCorr (version 1.2.6)

compPortfo: Compares two vectors (portfolios) using momentVote, DecileVote and exactSdMtx functions.

Description

Given two vectors of portfolio returns this function summarizes their ranks based on moments, deciles and exact measures of stochastic dominance. as explained in Vinod (2021). This algorithm has model selection applications.

Usage

compPortfo(xa, xb)

Value

Returns three numbers which represent signs based differences in ranks (rank=1 for most desirable) measured by [rank(xa)-rank(xb)] using momentVote, decileVote, and exactSdMtx which are weighted averages of four moments, nine deciles and exact measures of stochastic dominance (from ECDFs of four orders, SD1 to SD4) respectively.

Arguments

xa

Data on returns for portfolio A in the form of a T by 1 vector

xb

Data on returns for portfolio B in the form of a T by 1 vector

Author

Prof. H. D. Vinod, Economics Dept., Fordham University, NY

References

Vinod, H. D.", "Hands-On Intermediate Econometrics Using R" (2008) World Scientific Publishers: Hackensack, NJ. (Chapter 4) https://www.worldscientific.com/worldscibooks/10.1142/12831

Vinod, Hrishikesh D., R Package GeneralCorr Functions for Portfolio Choice (November 11, 2021). Available at SSRN: https://ssrn.com/abstract=3961683

See Also

exactSdMtx

momentVote

decileVote

Examples

Run this code

set.seed(30)
xa=sample(20:30)#generally lower returns
xb=sample(32:40)# higher returns in xb
gp = compPortfo(xa, xb)#all Av(sdi) positive means xb dominates
##output (1,1,1) means xb dominates xa. xb are larger by consruction

Run the code above in your browser using DataLab