|
WebCab Portfolio Demo v4.2 (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This Enterprise JavaBean consists of a collection of methods for estimating and rescaling the volatility. Recall, that the volatility of an asset is merely the standard deviation of the price function and is used to measure the degree of uncertainty which the price function displays.
The methods provided for estimating the volatility include:
An important issue in the estimation of the volatility is whether all days or only trading days should be taken into account. That is, is the volatility a phenomenon generated from trading activity or is volatility created from external factors. Where appropriate we will allow the user of this Enterprise JavaBean to select which point of view to adopt.
| Method Summary | |
double |
archVolatilityEstimate(double longTermVolatility,
double weightOfVolatility,
double[] observations,
double[] weights)
Returns the estimate of the volatility according to the ARCH model. |
double |
daysYearRescaling(double volPerPeriod,
double daysInPeriod,
int convention)
Evaluates the annual volatility when the volatility of a given number of days is known. |
double |
ewmaVolatilityEstimate(double weightRatio,
double i_1thDayEstimateOfVolatility,
double endi_1thDay,
double starti_1thDay)
This method returns the estimate of the volatility for the ith day made at the end of the previous (i-1)th day, using an estimate of the volatility on the (i-1)th day according to the EWMA model with respect to changes in the market variable. |
double |
ewmaVolatilityEstimateInduction(double weightRatio,
double firstDaysVolatilityEstimate,
double[] endOfDay,
double[] startOfDay)
Estimates of the volatility for the ith day made at the end of the previous (i-1)th day, using an estimate of the volatility on the 0th day, according to the EWMA model with respect to changes in the market variable. |
double |
garchVolatilityEstimate(double longTermVariance,
double longTermVarianceWeight,
double ithDayVolatilityEstimate,
double ithDayVolatilityEstimateWeight,
double ithDayAssetPrice,
double i_1thDayAssetPrice,
double assetPriceWeight)
Estimates of the volatility according to the GARCH(1,1) model for the (i+1)th day. |
double |
historicalEstimate(double[] assetPrices)
Evaluates the historical estimate of the present volatility. |
double |
historicalEstimateStandardError(double numberOfDays,
double volatilityEstimate)
Returns the estimate of the standard error of the standard historical estimation given by the functions volatilityHistoricalEstimate and volatilityHistoricalEstimateWithDividends. |
double |
historicalEstimateWithDividends(double[] assetPrices,
double[] dividendsPaid)
Calculates the historical estimate of the present volatility taking into account the dividends or interest payments of the underlying asset. |
double |
returnDuringithDay(double ithDayAssetPrice,
double i_1thDayAssetPrice)
This function returns the continuously compounded return of an asset over one day which is required by the method garchVolatilityEstimate. |
double |
variance(double[] historicalReturns)
Evaluates the variance of the historical returns of an asset. |
double |
variance(double[] probability,
double[] returns)
Calculates the variance of the expected returns of an asset given the assets returns in given market states and the probability of those market states occurring. |
double |
yearDaysRescaling(double volPerAnnum,
double daysRescaledTo,
int convention)
Calculates the value of the volatility over a given number of days when the annual volatility is known. |
| Methods inherited from interface javax.ejb.EJBObject |
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove |
| Method Detail |
public double yearDaysRescaling(double volPerAnnum,
double daysRescaledTo,
int convention)
throws OptionsException,
VolatilityDemoException,
RemoteException
volPerAnnum - is the volatility per annumdaysRescaledTo - is the number of days which the volatility is rescaled to. In particular, the doubled returned with represent volatility per d days.convention - One of the day count conventions listed inside the OptionsConstants class: ANNUAL_DAY_COUNT_252, ANNUAL_DAY_COUNT_360, or ANNUAL_DAY_COUNT_365.
OptionsException - thrown when the day count convention is not correctly specified
VolatilityDemoException
RemoteExceptionOptionsConstants.ANNUAL_DAY_COUNT_252,
OptionsConstants.ANNUAL_DAY_COUNT_360,
OptionsConstants.ANNUAL_DAY_COUNT_365
public double daysYearRescaling(double volPerPeriod,
double daysInPeriod,
int convention)
throws OptionsException,
VolatilityDemoException,
RemoteException
volPerPeriod - the volatility over the given number days considered.daysInPeriod - the number of days in period over which volatility is known. In the case that the daily volatility is given this parameter will be 1.convention - One of the day count conventions listed inside the OptionsConstants class: ANNUAL_DAY_COUNT_252, ANNUAL_DAY_COUNT_360, or ANNUAL_DAY_COUNT_365.
OptionsException - thrown when the day count convention is not correctly specified
VolatilityDemoException
RemoteExceptionOptionsConstants.ANNUAL_DAY_COUNT_252,
OptionsConstants.ANNUAL_DAY_COUNT_360,
OptionsConstants.ANNUAL_DAY_COUNT_365
public double historicalEstimate(double[] assetPrices)
throws VolatilityDemoException,
RemoteException
Choosing the number of historical points used
The historical estimate is evaluated using a given number of historical values of the assets market price. Care should be taken when deciding on the number of historical values to use within the historical estimate of the present volatility. A balance needs to be made between using a large sample (resulting in the small standard error) and a smaller sample which does not take too distant historical values which may not fully reflect the present market dynamics. As a rule of thumb the number of days used in order to historical estimate the present daily volatility should (in generally) be between 90 and 180 days.
assetPrices - an array of the assets price at the end of each interval. Note that if we use daily values of the asset price then this methods will return an estimate of the daily volatility.
VolatilityDemoException
RemoteExceptionhistoricalEstimateWithDividends(double[], double[])
public double historicalEstimateWithDividends(double[] assetPrices,
double[] dividendsPaid)
throws OptionsException,
VolatilityDemoException,
RemoteException
Choosing the number of historical points used
The historical estimate is evaluated using a given number of historical values of the assets market price. Care should be taken when deciding on the number of historical values to use within the historical estimate of the present volatility. A balance needs to be made between using a large sample (resulting in the small standard error) and a smaller sample which does not take too distant historical values which may not fully reflect the present market dynamics. As a rule of thumb the number of days used in order to historical estimate the present daily volatility should (in generally) be between 90 and 180 days.
assetPrices - an array of the assets market value at the end of each interval. Note that if we use daily values of the asset price then this method will return an estimate of the daily volatility.dividendsPaid - an array of the dividends (or interest payments) from the asset within each period. If we are estimating the daily volatility then the periods considered will correspond to days. The length of the array corresponding to the dividends (or interest payments) must have the same length as the array of asset prices used. If no payment is made within the i-th interval then the i-th element of the array in zero.
OptionException - thrown when the number of asset prices is not equal to
the number of dividends
OptionsException
VolatilityDemoException
RemoteExceptionhistoricalEstimate(double[])
public double historicalEstimateStandardError(double numberOfDays,
double volatilityEstimate)
throws VolatilityDemoException,
RemoteException
Recall that the standard error is the standard deviation of the sampling distribution of that statistic. Standard errors are important because they reflect how much sampling fluctuations effect the reliability of the statistic, in this case the estimate of the volatility. The standard error of a statistic will depend on the sample size where generally the larger the sample size the smaller the standard error will be.
numberOfDays - the number of days over which the historical data is takenvolatilityEstimate - estimate of the volatility per annum
VolatilityDemoException
RemoteException
public double archVolatilityEstimate(double longTermVolatility,
double weightOfVolatility,
double[] observations,
double[] weights)
throws OptionsException,
VolatilityDemoException,
RemoteException
observations[0] is the latest
observation and observation[1] is the previous observation and so on.
observations - an array of historical observationsweights - an array of weights associated to the historical observationslongTermVolatility - this is the long term volatilityweightOfVolatility - this is the weight assigned to the volatility
OptionsException - thrown when the number of observations is not equal to the
number of weights
VolatilityDemoException
RemoteException
public double ewmaVolatilityEstimate(double weightRatio,
double i_1thDayEstimateOfVolatility,
double endi_1thDay,
double starti_1thDay)
throws VolatilityDemoException,
RemoteException
Remarks:
ewmaVolatilityEstimateInduction is an implementation
of this.
weightRatio - this constant between one and zero, is the ratio between the ith weight and the (i-1)th weight. The smaller the value used the more sensitive the model is to resent changes in the volatility.i_1thDayEstimateOfVolatility - this is the previous reading or estimate of the volatility on the (i-1)th dayendi_1thDay - the market variable (for example, asset price) at the close of the (i-1)th daystarti_1thDay - the market variable (for example, asset price) at the start of the (i-1)th day
VolatilityDemoException
RemoteExceptionewmaVolatilityEstimateInduction(double, double, double[], double[])
public double ewmaVolatilityEstimateInduction(double weightRatio,
double firstDaysVolatilityEstimate,
double[] endOfDay,
double[] startOfDay)
throws VolatilityDemoException,
RemoteException
Remarks:
weightRatio - this constant between one and zero, is the ratio between the kth weight and the (k-1)th weight, for all k. The smaller the value used the more sensitive the model is to resent changes in the volatility.firstDaysVolatilityEstimate - this is the estimate of the volatility on the 0th dayendOfDay - this is an array of length i+1, where the first term is the closing value of the market variable (for example, the asset price) on the 0th day, the second element is the closing value of the market variable on the 1st day and so on...startOfDay - this is an array of length i+1, where the first term is the opening value of the market variable (for example, the asset price) on the 0th day, the second element is the opening value of the market variable on the 1st day and so on...
VolatilityDemoException
RemoteExceptionewmaVolatilityEstimate(double, double, double, double)
public double returnDuringithDay(double ithDayAssetPrice,
double i_1thDayAssetPrice)
throws VolatilityDemoException,
RemoteException
ithDayAssetPrice - this in the asset price at the close of business on the ith dayi_1thDayAssetPrice - this is the asset price at the close of business on the i-1th day excelFunction return
VolatilityDemoException
RemoteException
public double variance(double[] probability,
double[] returns)
throws VolatilityDemoException,
RemoteException
probability - probability[s] is the probability of the state s occurringreturns - returns[s] is the return (increase in market value) for the asset in the state s
VolatilityDemoException
RemoteException
public double variance(double[] historicalReturns)
throws VolatilityDemoException,
RemoteException
historicalReturns - historicalReturns[t] is the return of the asset in the tth period
VolatilityDemoException
RemoteException
public double garchVolatilityEstimate(double longTermVariance,
double longTermVarianceWeight,
double ithDayVolatilityEstimate,
double ithDayVolatilityEstimateWeight,
double ithDayAssetPrice,
double i_1thDayAssetPrice,
double assetPriceWeight)
throws OptionsException,
VolatilityDemoException,
RemoteException
longTermVariance - long term average variancelongTermVarianceWeight - the weight given to the long term varianceithDayVolatilityEstimate - the estimate of the volatility for the ith dayithDayVolatilityEstimateWeight - the weight given to the estimate of the volatility from the ith dayithDayAssetPrice - the market price of the asset at the close on the ith dayi_1thDayAssetPrice - the market price of the underlying asset at the open of the previous business dayassetPriceWeight - the weight associated within the model to the influence of the return on the asset over the last day.
OptionsException - thrown when the sun of the weights associated with the long
term variance, previous estimate of the volatility and the asset price are not equal to 1.
VolatilityDemoException
RemoteException
|
WebCab Portfolio Demo v4.2 (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||