Package com.opengamma.analytics.financial.var

Examples of com.opengamma.analytics.financial.var.NormalVaRParameters


    final Set<String> scheduleCalculatorNames = constraints.getValues(ValuePropertyNames.SCHEDULE_CALCULATOR);
    final Set<String> meanCalculatorNames = constraints.getValues(ValuePropertyNames.MEAN_CALCULATOR);
    final Set<String> stdDevCalculatorNames = constraints.getValues(ValuePropertyNames.STD_DEV_CALCULATOR);
    final Set<String> confidenceLevelNames = constraints.getValues(ValuePropertyNames.CONFIDENCE_LEVEL);
    final Set<String> horizonNames = constraints.getValues(ValuePropertyNames.HORIZON);
    final NormalVaRParameters parameters = getParameters(scheduleCalculatorNames, horizonNames, confidenceLevelNames);
    final NormalLinearVaRCalculator<DoubleTimeSeries<?>> varCalculator = getVaRCalculator(meanCalculatorNames, stdDevCalculatorNames);
    final VaRCalculationResult calcResult = varCalculator.evaluate(parameters, pnlSeries);
    final double var = calcResult.getVaRValue();
    final double stddev = calcResult.getStdDev();
    final Set<ComputedValue> results = new HashSet<ComputedValue>();
View Full Code Here


      throw new OpenGammaRuntimeException("Missing or non-unique horizon name: " + horizonNames);
    }
    if (confidenceLevelNames == null || confidenceLevelNames.isEmpty() || confidenceLevelNames.size() != 1) {
      throw new OpenGammaRuntimeException("Missing or non-unique confidence level name: " + confidenceLevelNames);
    }
    return new NormalVaRParameters(Double.valueOf(horizonNames.iterator().next()),
        VaRFunctionUtils.getBusinessDaysPerPeriod(scheduleCalculatorNames.iterator().next()), Double.valueOf(confidenceLevelNames.iterator().next()));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.var.NormalVaRParameters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.