|
WebCab Portfolio Demo v4.2 (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Local interface of Volatility. This interface provides the same functionality as the Volatility remote interface.
Volatility| Method Summary | |
double |
archVolatilityEstimate(double longTermVolatility,
double weightOfVolatility,
double[] observations,
double[] weights)
Method archVolatilityEstimate(double, double, double[], double[]) as defined in the Volatility remote interface. |
double |
daysYearRescaling(double volPerPeriod,
double daysInPeriod,
int convention)
Method daysYearRescaling(double, double, int) as defined in the Volatility remote interface. |
double |
ewmaVolatilityEstimate(double weightRatio,
double i_1thDayEstimateOfVolatility,
double endi_1thDay,
double starti_1thDay)
Method ewmaVolatilityEstimate(double, double, double, double) as defined in the Volatility remote interface. |
double |
ewmaVolatilityEstimateInduction(double weightRatio,
double firstDaysVolatilityEstimate,
double[] endOfDay,
double[] startOfDay)
Method ewmaVolatilityEstimateInduction(double, double, double[], double[]) as defined in the Volatility remote interface. |
double |
garchVolatilityEstimate(double longTermVariance,
double longTermVarianceWeight,
double ithDayVolatilityEstimate,
double ithDayVolatilityEstimateWeight,
double ithDayAssetPrice,
double i_1thDayAssetPrice,
double assetPriceWeight)
Method garchVolatilityEstimate(double, double, double, double, double, double, double) as defined in the Volatility remote interface. |
double |
historicalEstimate(double[] assetPrices)
Method historicalEstimate(double[]) as defined in the Volatility remote interface. |
double |
historicalEstimateStandardError(double numberOfDays,
double volatilityEstimate)
Method historicalEstimateStandardError(double, double) as defined in the Volatility remote interface. |
double |
historicalEstimateWithDividends(double[] assetPrices,
double[] dividendsPaid)
Method historicalEstimateWithDividends(double[], double[]) as defined in the Volatility remote interface. |
double |
returnDuringithDay(double ithDayAssetPrice,
double i_1thDayAssetPrice)
Method returnDuringithDay(double, double) as defined in the Volatility remote interface. |
double |
variance(double[] historicalReturns)
Method variance(double[]) as defined in the Volatility remote interface. |
double |
variance(double[] probability,
double[] returns)
Method variance(double[], double[]) as defined in the Volatility remote interface. |
double |
yearDaysRescaling(double volPerAnnum,
double daysRescaledTo,
int convention)
Method yearDaysRescaling(double, double, int) as defined in the Volatility remote interface. |
| Methods inherited from interface javax.ejb.EJBLocalObject |
getEJBLocalHome, getPrimaryKey, isIdentical, remove |
| Method Detail |
public double yearDaysRescaling(double volPerAnnum,
double daysRescaledTo,
int convention)
throws OptionsException,
VolatilityDemoException
Description copied from the Volatility interface:
Calculates the value of the volatility over a given number of days when the annual volatility is known. The annual volatility may be given with respect to either the 252, 360 or 365 days convention.
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
VolatilityDemoExceptionOptionsConstants.ANNUAL_DAY_COUNT_252,
OptionsConstants.ANNUAL_DAY_COUNT_360,
OptionsConstants.ANNUAL_DAY_COUNT_365,
Volatility.yearDaysRescaling(double, double, int)
public double daysYearRescaling(double volPerPeriod,
double daysInPeriod,
int convention)
throws OptionsException,
VolatilityDemoException
Description copied from the Volatility interface:
Evaluates the annual volatility when the volatility of a given number of days is known. The annual volatility may be evaluated with respec to either the 252, 360 or 365 days convention.
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
VolatilityDemoExceptionOptionsConstants.ANNUAL_DAY_COUNT_252,
OptionsConstants.ANNUAL_DAY_COUNT_360,
OptionsConstants.ANNUAL_DAY_COUNT_365,
Volatility.daysYearRescaling(double, double, int)
public double historicalEstimate(double[] assetPrices)
throws VolatilityDemoException
Description copied from the Volatility interface:
Evaluates the historical estimate of the present volatility. This procedure uses the price data at the end of equal time intervals of an investment asset which does not pay dividends or interest payments in order to estimate its present volatility per interval. The number returned is the estimated (present) volatility per interval expressed in decimal format (i.e. 1 percent = 0.01). Hence if daily values of the assets price where used then this method will return the historical estimate of the daily volatility.
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.
VolatilityDemoExceptionhistoricalEstimateWithDividends(double[], double[]),
Volatility.historicalEstimate(double[])
public double historicalEstimateWithDividends(double[] assetPrices,
double[] dividendsPaid)
throws OptionsException,
VolatilityDemoException
Description copied from the Volatility interface:
Calculates the historical estimate of the present volatility taking into account the dividends or interest payments of the underlying asset.
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
VolatilityDemoExceptionhistoricalEstimate(double[]),
Volatility.historicalEstimateWithDividends(double[], double[])
public double historicalEstimateStandardError(double numberOfDays,
double volatilityEstimate)
throws VolatilityDemoException
Description copied from the Volatility interface:
Returns the estimate of the standard error of the standard historical estimation given by the functions volatilityHistoricalEstimate and volatilityHistoricalEstimateWithDividends.
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
VolatilityDemoExceptionVolatility.historicalEstimateStandardError(double, double)
public double archVolatilityEstimate(double longTermVolatility,
double weightOfVolatility,
double[] observations,
double[] weights)
throws OptionsException,
VolatilityDemoException
Description copied from the Volatility interface:
Returns the estimate of the volatility according to the ARCH model. If the sum of
the weights is not within 0.1 of 1, or the number of weights does not correspond
to the number of observations them the method will throw an exception. Note that
for the input arrays the first value 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
VolatilityDemoExceptionVolatility.archVolatilityEstimate(double, double, double[], double[])
public double ewmaVolatilityEstimate(double weightRatio,
double i_1thDayEstimateOfVolatility,
double endi_1thDay,
double starti_1thDay)
throws VolatilityDemoException
Description copied from the Volatility interface:
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. The EWMA model is a special case of the ARCH model, where the weights assigned to the historical volatility measure decreases by a constant factor.
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
VolatilityDemoExceptionewmaVolatilityEstimateInduction(double, double, double[], double[]),
Volatility.ewmaVolatilityEstimate(double, double, double, double)
public double ewmaVolatilityEstimateInduction(double weightRatio,
double firstDaysVolatilityEstimate,
double[] endOfDay,
double[] startOfDay)
throws VolatilityDemoException
Description copied from the Volatility interface:
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. The EWMA model is a special case of the ARCH model, where the weights assigned to the historical volatility measure decreases by a constant factor.
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...
VolatilityDemoExceptionewmaVolatilityEstimate(double, double, double, double),
Volatility.ewmaVolatilityEstimateInduction(double, double, double[], double[])
public double returnDuringithDay(double ithDayAssetPrice,
double i_1thDayAssetPrice)
throws VolatilityDemoException
Description copied from the Volatility interface:
This function returns the continuously compounded return of an asset over one day which is required by the method garchVolatilityEstimate.
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
VolatilityDemoExceptionVolatility.returnDuringithDay(double, double)
public double variance(double[] probability,
double[] returns)
throws VolatilityDemoException
Description copied from the Volatility interface:
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.
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
VolatilityDemoExceptionVolatility.variance(double[], double[])
public double variance(double[] historicalReturns)
throws VolatilityDemoException
Description copied from the Volatility interface:
Evaluates the variance of the historical returns of an asset.
historicalReturns - historicalReturns[t] is the return of the asset in the tth period
VolatilityDemoExceptionVolatility.variance(double[])
public double garchVolatilityEstimate(double longTermVariance,
double longTermVarianceWeight,
double ithDayVolatilityEstimate,
double ithDayVolatilityEstimateWeight,
double ithDayAssetPrice,
double i_1thDayAssetPrice,
double assetPriceWeight)
throws OptionsException,
VolatilityDemoException
Description copied from the Volatility interface:
Estimates of the volatility according to the GARCH(1,1) model for the (i+1)th day. Note that the sum of the weights associated with the long term variance, previous estimate of the volatility and asset price should add up to one.
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.
VolatilityDemoExceptionVolatility.garchVolatilityEstimate(double, double, double, double, double, double, double)
|
WebCab Portfolio Demo v4.2 (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||