Package com.opengamma.analytics.math.statistics.distribution

Examples of com.opengamma.analytics.math.statistics.distribution.StudentTDistribution


        }
        return -sum;
      }

    };
    return new StudentTDistribution(_minimizer.minimize(f, 0.0, 3., 10.));
  }
View Full Code Here


    Validate.isTrue(dof > 0, "degrees of freedom");
    _horizon = horizon;
    _periods = periods;
    _quantile = quantile;
    _dof = dof;
    _studentT = new StudentTDistribution(dof);
    _mult = Math.sqrt((_dof - 2) * horizon / dof / periods) * _studentT.getInverseCDF(quantile);
    _scale = horizon / periods;
  }
View Full Code Here

  @Test(groups = TestGroup.UNIT_SLOW)
  public void test() {
    final int n = 500000;
    final double eps = 5e-2;
    final double nu = 5.4;
    final ProbabilityDistribution<Double> p1 = new StudentTDistribution(nu, new MersenneTwister64(MersenneTwister.DEFAULT_SEED));
    final double[] x = new double[n];
    for (int i = 0; i < n; i++) {
      x[i] = p1.nextRandom();
    }
    final StudentTDistribution p2 = (StudentTDistribution) ESTIMATOR.evaluate(x);
    assertEquals(p2.getDegreesOfFreedom(), nu, eps);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.math.statistics.distribution.StudentTDistribution

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.