API Docs

Manual, tutorials and complete function reference

expected_downside_return

Computes cumulative expected return below a certain threshold


Usage
expected_downside_return(asset, thresholdReturn)
asset
Portfolio or position object created using or function function
thresholdReturn
Return value to be used as a cut-off point

Return Value
Numeric vector of expected downside returns.
Examples
# load data
data(goog.data)
data(aapl.data)
data(spy.data)

# create portfolio
portfolio=portfolio_create(priceDataIx=spy.data)
portfolio_settings(portfolio, windowLength = '1h')
portfolio_addPosition(portfolio,'GOOG',goog.data,100)
portfolio_addPosition(portfolio,'AAPL',aapl.data,300)

# plot metric
util_plot2d(portfolio_expectedDownsideReturn(portfolio, 0.05))
% load data
goog.data=importdata('data_goog.mat'); 
aapl.data=importdata('data_aapl.mat');  
spy.data=importdata('data_spy.mat'); 

% create portfolio
portfolio=portfolio_create(spy.data,1); 
portfolio_settings(portfolio, 'windowLength', '1h');
portfolio_addPosition(portfolio,'GOOG',goog.data,100);
portfolio_addPosition(portfolio,'AAPL',aapl.data,300);

% plot metric
util_plot2d(portfolio_expectedDownsideReturn(portfolio, 0.05));