Package com.opengamma.analytics.financial.greeks

Examples of com.opengamma.analytics.financial.greeks.BucketedGreekResultCollection


        db = INTERPOLATOR_1D.getDataBundle(moneyness, vols);
        final double vol = INTERPOLATOR_1D.interpolate(db, x);
        bucketedVega[i][j] = (vol - exampleVol) / shiftAmount;
      }
    }
    final BucketedGreekResultCollection result = new BucketedGreekResultCollection(expiries, strikes);
    result.put(BucketedGreekResultCollection.BUCKETED_VEGA, bucketedVega);
    return result;
  }
View Full Code Here


    @Override
    public BucketedGreekResultCollection buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final double[] expiries = deserializer.fieldValueToObject(double[].class, message.getByName(EXPIRIES_FIELD));
      final double[][] strikes = deserializer.fieldValueToObject(double[][].class, message.getByName(STRIKES_FIELD));
      final BucketedGreekResultCollection result = new BucketedGreekResultCollection(expiries, strikes);
      if (message.getByName(BUCKETED_VEGA_FIELD) != null) {
        final double[][] greek = deserializer.fieldValueToObject(double[][].class, message.getByName(BUCKETED_VEGA_FIELD));
        result.put(BucketedGreekResultCollection.BUCKETED_VEGA, greek);
      }
      return result;
    }
View Full Code Here

    assertArrayEquals(PDE_GREEKS.getGridGreeks(PDEResultCollection.GRID_VOMMA), pdeGreeks.getGridGreeks(PDEResultCollection.GRID_VOMMA), 1e-9);
  }

  @Test
  public void testBucketedGreeks() {
    final BucketedGreekResultCollection bucketedGreeks = cycleObject(BucketedGreekResultCollection.class, BUCKETED_GREEKS);
    assertArrayEquals(BUCKETED_GREEKS.getExpiries(), bucketedGreeks.getExpiries(), 1e-9);
    for (int i = 0; i < BUCKETED_VEGA.length; i++) {
      assertArrayEquals(bucketedGreeks.getStrikes()[i], bucketedGreeks.getStrikes()[i], 1e-9);
      assertArrayEquals(BUCKETED_VEGA[i], bucketedGreeks.getBucketedGreeks(BucketedGreekResultCollection.BUCKETED_VEGA)[i], 1e-9);
    }
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.greeks.BucketedGreekResultCollection

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.