/** * Create a Chi-Squared distribution with the given degrees of freedom. * @param df degrees of freedom. */ public ChiSquaredDistributionImpl(double df) { this(df, new GammaDistributionImpl(df / 2.0, 2.0)); }
/** * Create a Chi-Squared distribution with the given degrees of freedom. * @param df degrees of freedom. */ public ChiSquaredDistributionImpl(double df) { this(df, new GammaDistributionImpl(df / 2.0, 2.0)); }
/** * Create a new gamma distribution the given shape and scale parameters. * * @param alpha the shape parameter * @param beta the scale parameter * @return a new gamma distribution */ public GammaDistribution createGammaDistribution( double alpha, double beta) { return new GammaDistributionImpl(alpha, beta); }
/** * Create a Chi-Squared distribution with the given degrees of freedom. * @param df degrees of freedom. */ public ChiSquaredDistributionImpl(double df) { this(df, new GammaDistributionImpl(df / 2.0, 2.0)); }
/** * Generates a random value from the {@link GammaDistributionImpl Gamma Distribution}. * This implementation uses {@link #nextInversionDeviate(ContinuousDistribution) inversion} * to generate random values. * * @param shape the median of the Gamma distribution * @param scale the scale parameter of the Gamma distribution * @return random value sampled from the Gamma(shape, scale) distribution * @throws MathException if an error occurs generating the random value * @since 2.2 */ public double nextGamma(double shape, double scale) throws MathException { return nextInversionDeviate(new GammaDistributionImpl(shape, scale)); }
/** * Create a Chi-Squared distribution with the given degrees of freedom and * inverse cumulative probability accuracy. * @param df degrees of freedom. * @param inverseCumAccuracy the maximum absolute error in inverse cumulative probability estimates * (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY}) * @since 2.1 */ public ChiSquaredDistributionImpl(double df, double inverseCumAccuracy) { super(); gamma = new GammaDistributionImpl(df / 2.0, 2.0); setDegreesOfFreedomInternal(df); solverAbsoluteAccuracy = inverseCumAccuracy; }
/** * Create a Chi-Squared distribution with the given degrees of freedom and * inverse cumulative probability accuracy. * @param df degrees of freedom. * @param inverseCumAccuracy the maximum absolute error in inverse cumulative probability estimates * (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY}) * @since 2.1 */ public ChiSquaredDistributionImpl(double df, double inverseCumAccuracy) { super(); gamma = new GammaDistributionImpl(df / 2.0, 2.0); setDegreesOfFreedomInternal(df); solverAbsoluteAccuracy = inverseCumAccuracy; }