Documentation 
Compute sample lower partial moments of data
lpm(Data) lpm(Data, MAR) lpm(Data, MAR, Order) Moment = lpm(Data, MAR, Order)
Data  NUMSAMPLESbyNUMSERIES matrix with NUMSAMPLES observations of NUMSERIES asset returns. 
MAR  (Optional) Scalar minimum acceptable return (default MAR = 0). This is a cutoff level of return such that all returns above MAR contribute nothing to the lower partial moment. 
Order  (Optional) Either a scalar or a NUMORDERSvector of nonnegative integer moment orders. If no order specified, default Order = 0, which is the shortfall probability. Although this function will work for noninteger orders and, in some cases, for negative orders, this falls outside customary usage. 
Given NUMSERIES assets with NUMSAMPLES returns in a NUMSAMPLESbyNUMSERIES matrix Data, a scalar minimum acceptable return MAR, and one or more nonnegative moment orders in a NUMORDERS vector Order, lpm computes lower partial moments relative to MAR for each asset in a NUMORDERS x NUMSERIES matrix Moment.
The output Moment is a NUMORDERS x NUMSERIES matrix of lower partial moments with NUMORDERS Orders and NUMSERIES series, that is, each row contains lower partial moments for a given order.
Note: To compute upper partial moments, just reverse the signs of both Data and MAR (do not reverse the sign of the output). This function computes sample lower partial moments from data. To compute expected lower partial moments for multivariate normal asset returns with a specified mean and covariance, use elpm. With lpm, you can compute various investment ratios such as Omega ratio, Sortino ratio, and Upside Potential ratio, where:

Vijay S. Bawa, "SafetyFirst, Stochastic Dominance, and Optimal Portfolio Choice," Journal of Financial and Quantitative Analysis, Vol. 13, No. 2, June 1978, pp. 255271.
W. V. Harlow, "Asset Allocation in a DownsideRisk Framework," Financial Analysts Journal, Vol. 47, No. 5, September/October 1991, pp. 2840.
W. V. Harlow and K. S. Rao, "Asset Pricing in a Generalized MeanLower Partial Moment Framework: Theory and Evidence," Journal of Financial and Quantitative Analysis, Vol. 24, No. 3, September 1989, pp. 285311.
Frank A. Sortino and Robert van der Meer, "Downside Risk," Journal of Portfolio Management, Vol. 17, No. 5, Spring 1991, pp. 2731.