WebCab Portfolio Demo
v4.2
(J2EE Edition)

com.webcab.ejb.finance.portfolio
Interface TwoAssetPortfolioLocal

All Superinterfaces:
EJBLocalObject

public interface TwoAssetPortfolioLocal
extends EJBLocalObject

Local interface of TwoAssetPortfolio. This interface provides the same functionality as the TwoAssetPortfolio remote interface.

See Also:
TwoAssetPortfolio

Method Summary
 double correlationCoef(double covariance, double standardDeviation1, double standardDeviation2)
          Method correlationCoef(double, double, double) as defined in the TwoAssetPortfolio remote interface.
 double covariance(double[] historicalReturns1, double[] historicalReturns2)
          Method covariance(double[], double[]) as defined in the TwoAssetPortfolio remote interface.
 double covariance(double[] probability, double[] rateOfReturn1, double[] rateOfReturn2)
          Method covariance(double[], double[], double[]) as defined in the TwoAssetPortfolio remote interface.
 double portfolio2Return(double alpha, double expectedReturn1, double expectedReturn2)
          Method portfolio2Return(double, double, double) as defined in the TwoAssetPortfolio remote interface.
 double portfolio2Risk(double alpha, double standardDeviation1, double standardDeviation2, double covariance)
          Method portfolio2Risk(double, double, double, double) as defined in the TwoAssetPortfolio remote interface.
 double portfolio2Variance(double alpha, double standardDeviation1, double standardDeviation2, double correlation)
          Method portfolio2Variance(double, double, double, double) as defined in the TwoAssetPortfolio remote interface.
 double standardDeviation(double[] historicalReturns)
          Method standardDeviation(double[]) as defined in the TwoAssetPortfolio remote interface.
 double standardDeviation(double[] probability, double[] rateOfReturn)
          Method standardDeviation(double[], double[]) as defined in the TwoAssetPortfolio remote interface.
 double weight2MinimizeRisk(double standardDeviation1, double standardDeviation2, double covariance)
          Method weight2MinimizeRisk(double, double, double) as defined in the TwoAssetPortfolio remote interface.
 
Methods inherited from interface javax.ejb.EJBLocalObject
getEJBLocalHome, getPrimaryKey, isIdentical, remove
 

Method Detail

correlationCoef

public double correlationCoef(double covariance,
                              double standardDeviation1,
                              double standardDeviation2)
                       throws TwoAssetPortfolioDemoException
Method correlationCoef(double, double, double) as defined in the TwoAssetPortfolio remote interface.

Description copied from the TwoAssetPortfolio interface:

Returns the correlation coefficient between two assets.

Parameters:
covariance - the covariance between the two assets of the portfolio
standardDeviation1 - standard deviation of the first asset
standardDeviation2 - standard deviation of the second asset
TwoAssetPortfolioDemoException
See Also:
TwoAssetPortfolio.correlationCoef(double, double, double)

covariance

public double covariance(double[] probability,
                         double[] rateOfReturn1,
                         double[] rateOfReturn2)
                  throws TwoAssetPortfolioDemoException
Method covariance(double[], double[], double[]) as defined in the TwoAssetPortfolio remote interface.

Description copied from the TwoAssetPortfolio interface:

Evaluates the covariance between the returns of two assets given the probability return distribution of each asset.

Parameters:
probability - probability[s] is an array of the probability of the state s occurring
rateOfReturn1 - rateOfReturn1[s] is the return (increase in market value) for the first asset in the state s
rateOfReturn2 - rateOfReturn2[s] is the return (increase in market value) for the second asset in the state s
TwoAssetPortfolioDemoException
See Also:
TwoAssetPortfolio.covariance(double[], double[], double[])

covariance

public double covariance(double[] historicalReturns1,
                         double[] historicalReturns2)
                  throws TwoAssetPortfolioDemoException
Method covariance(double[], double[]) as defined in the TwoAssetPortfolio remote interface.

Description copied from the TwoAssetPortfolio interface:

This method returns the covariance between the returns of the two assets. The historical returns for each asset on the `same' historical time periods must be known.

Parameters:
historicalReturns1 - historicalReturns1[t] is the return (increase in market value) of the first asset in the tth period
historicalReturns2 - historicalReturns2[t] is the return (increase in market value) of the second asset in the tth period
TwoAssetPortfolioDemoException
See Also:
TwoAssetPortfolio.covariance(double[], double[])

standardDeviation

public double standardDeviation(double[] probability,
                                double[] rateOfReturn)
                         throws TwoAssetPortfolioDemoException
Method standardDeviation(double[], double[]) as defined in the TwoAssetPortfolio remote interface.

Description copied from the TwoAssetPortfolio interface:

Evaluates the standard deviation of an asset given its probability distribution of its returns.

Parameters:
probability - probability[s] is an array of the probability of the state s occurring
rateOfReturn - rateOfReturn[s] is the return (increase in market value) for the first asset in the state s.
TwoAssetPortfolioDemoException
See Also:
TwoAssetPortfolio.standardDeviation(double[], double[])

standardDeviation

public double standardDeviation(double[] historicalReturns)
                         throws TwoAssetPortfolioDemoException
Method standardDeviation(double[]) as defined in the TwoAssetPortfolio remote interface.

Description copied from the TwoAssetPortfolio interface:

Evaluates the standard deviation of an asset from its historical returns.

Parameters:
historicalReturns - historicalReturns1[t] is the return (increase in market value) of the first asset in the tth period
TwoAssetPortfolioDemoException
See Also:
TwoAssetPortfolio.standardDeviation(double[])

portfolio2Variance

public double portfolio2Variance(double alpha,
                                 double standardDeviation1,
                                 double standardDeviation2,
                                 double correlation)
                          throws TwoAssetPortfolioDemoException
Method portfolio2Variance(double, double, double, double) as defined in the TwoAssetPortfolio remote interface.

Description copied from the TwoAssetPortfolio interface:

The variance for a portfolio with two assets.

Parameters:
alpha - the weight of the first asset. Note, that the weight of an asset lies in the interval [0,1], and the sum of the assets (in this case the two assets) is 1; hence the weight of the second asset is `1-alpha'
standardDeviation1 - the standard deviation of returns for the first asset expressed in decimal format (i.e. 1 percent = 0.01)
standardDeviation2 - the standard deviation of returns for the second asset expressed in decimal format (i.e. 1 percent = 0.01)
correlation - the correlation coefficient between the assets
TwoAssetPortfolioDemoException
See Also:
TwoAssetPortfolio.portfolio2Variance(double, double, double, double)

portfolio2Risk

public double portfolio2Risk(double alpha,
                             double standardDeviation1,
                             double standardDeviation2,
                             double covariance)
                      throws TwoAssetPortfolioDemoException
Method portfolio2Risk(double, double, double, double) as defined in the TwoAssetPortfolio remote interface.

Description copied from the TwoAssetPortfolio interface:

The risk (or standard deviation) for a portfolio with two assets.

Parameters:
alpha - the weight for the first asset
standardDeviation1 - the standard deviation of returns for the first asset
standardDeviation2 - the standard deviation of returns for the second asset
covariance - the covariance of returns for the two assets
TwoAssetPortfolioDemoException
See Also:
TwoAssetPortfolio.portfolio2Risk(double, double, double, double)

portfolio2Return

public double portfolio2Return(double alpha,
                               double expectedReturn1,
                               double expectedReturn2)
                        throws TwoAssetPortfolioDemoException
Method portfolio2Return(double, double, double) as defined in the TwoAssetPortfolio remote interface.

Description copied from the TwoAssetPortfolio interface:

The expected return for a portfolio with two assets

Parameters:
alpha - the weight for the first asset. Note that, the weights of both assets are positive and sum to one, hence the weight of the second asset is `1-alpha'
expectedReturn1 - the expected return for the first asset
expectedReturn2 - the expected return for the second asset
TwoAssetPortfolioDemoException
See Also:
TwoAssetPortfolio.portfolio2Return(double, double, double)

weight2MinimizeRisk

public double weight2MinimizeRisk(double standardDeviation1,
                                  double standardDeviation2,
                                  double covariance)
                           throws TwoAssetPortfolioDemoException
Method weight2MinimizeRisk(double, double, double) as defined in the TwoAssetPortfolio remote interface.

Description copied from the TwoAssetPortfolio interface:

Evaluates the weight of the first asset within a two asset portfolio which achieves the optimal diversification (i.e. minimizes the risk) of the portfolio.

Remarks of Effects of Diversification

The ability to gain from the effects of diversification will depend on the covariance between the two assets. In particular, the higher the absolute value of the covariance the greater the influence in proportion of the weight of the asset. If the covariance between the two assets is zero, then there will not be any diversification effects. Moreover, the larger the absolute size of the covariance the greater the effects diversification will be.

Parameters:
standardDeviation1 - the standard deviation of the returns of the first asset
standardDeviation2 - the standard deviation of the return of the second asset
covariance - the covariance between the two assets within the portfolio
TwoAssetPortfolioDemoException
See Also:
TwoAssetPortfolio.weight2MinimizeRisk(double, double, double)

WebCab Portfolio Demo
v4.2
(J2EE Edition)