Description Usage Arguments Value Author(s) Examples
Computes probability density of portfolio returns for a given interval (pValueLeft, pValueRight) at nPoints of approximation. Probability density is computed based on a "densityModel" specified in portfolio_settings( ) method.
1 | dist_density(asset,pValueLeft,pValueRight,nPoints,addNormalDensity)
|
asset |
Portfolio or Position object created using portfolio_create( ) or position_add( ) function |
pValueLeft |
Left limit of probability density value in decimals. |
pValueRight |
Right limit of probability density value in decimals. |
nPoints |
Number of approximation points for the PDF function. |
addNormalDensity |
Flag used to add normal density to the final result. Defaults to FALSE. |
List of probability density values
Kostin Andrey <andrey.kostin@portfolioeffect.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
data(aapl.data)
data(goog.data)
data(spy.data)
portfolio=portfolio_create(priceDataIx=spy.data)
portfolio_settings(portfolio,windowLength = '3600s',resultsSamplingInterval='60s')
positionGOOG=position_add(portfolio,'GOOG',100,priceData=goog.data)
positionAAPL=position_add(portfolio,'AAPL',300,priceData=aapl.data)
util_plotDensity(dist_density(portfolio,pValueLeft=0.2,pValueRight=0.8,nPoints=100,
addNormalDensity=TRUE))
dateStart = "2014-11-17 09:30:00"
dateEnd = "2014-11-17 16:00:00"
portfolio=portfolio_create(dateStart,dateEnd)
portfolio_settings(portfolio,portfolioMetricsMode="price",windowLength = '3600s',
resultsSamplingInterval='60s')
positionAAPL=position_add(portfolio,'AAPL',100)
positionC=position_add(portfolio,'C',300)
positionGOOG=position_add(portfolio,'GOOG',150)
util_plotDensity(dist_density(portfolio,pValueLeft=0,pValueRight=1,nPoints=100,
addNormalDensity=TRUE))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.