当前位置: 首页>>代码示例>>Java>>正文


Java ExponentialDistribution.inverseCumulativeProbability方法代码示例

本文整理汇总了Java中org.apache.commons.math3.distribution.ExponentialDistribution.inverseCumulativeProbability方法的典型用法代码示例。如果您正苦于以下问题:Java ExponentialDistribution.inverseCumulativeProbability方法的具体用法?Java ExponentialDistribution.inverseCumulativeProbability怎么用?Java ExponentialDistribution.inverseCumulativeProbability使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math3.distribution.ExponentialDistribution的用法示例。


在下文中一共展示了ExponentialDistribution.inverseCumulativeProbability方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFactory

import org.apache.commons.math3.distribution.ExponentialDistribution; //导入方法依赖的package包/类
@Override
public DistributionFactory getFactory(List<String> params)
{
    if (params.size() != 1)
        throw new IllegalArgumentException("Invalid parameter list for gaussian distribution: " + params);
    try
    {
        String[] bounds = params.get(0).split("\\.\\.+");
        final long min = parseLong(bounds[0]);
        final long max = parseLong(bounds[1]);
        if (min == max)
            return new FixedFactory(min);
        ExponentialDistribution findBounds = new ExponentialDistribution(1d);
        // max probability should be roughly equal to accuracy of (max-min) to ensure all values are visitable,
        // over entire range, but this results in overly skewed distribution, so take sqrt
        final double mean = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min)));
        return new ExpFactory(min, max, mean);
    } catch (Exception ignore)
    {
        throw new IllegalArgumentException("Invalid parameter list for uniform distribution: " + params);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:23,代码来源:OptionDistribution.java

示例2: getFactory

import org.apache.commons.math3.distribution.ExponentialDistribution; //导入方法依赖的package包/类
@Override
public DistributionFactory getFactory(List<String> params)
{
    if (params.size() != 1)
        throw new IllegalArgumentException("Invalid parameter list for gaussian distribution: " + params);
    try
    {
        String[] bounds = params.get(0).split("\\.\\.+");
        final long min = parseLong(bounds[0]);
        final long max = parseLong(bounds[1]);
        ExponentialDistribution findBounds = new ExponentialDistribution(1d);
        // max probability should be roughly equal to accuracy of (max-min) to ensure all values are visitable,
        // over entire range, but this results in overly skewed distribution, so take sqrt
        final double mean = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min)));
        return new ExpFactory(min, max, mean);
    } catch (Exception e)
    {
        throw new IllegalArgumentException("Invalid parameter list for uniform distribution: " + params);
    }
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:21,代码来源:OptionDistribution.java

示例3: getFactory

import org.apache.commons.math3.distribution.ExponentialDistribution; //导入方法依赖的package包/类
@Override
public DistributionFactory getFactory(List<String> params)
{
    if (params.size() != 1)
        throw new IllegalArgumentException("Invalid parameter list for gaussian distribution: " + params);
    try
    {
        String[] bounds = params.get(0).split("\\.\\.+");
        final long min = Long.parseLong(bounds[0]);
        final long max = Long.parseLong(bounds[1]);
        ExponentialDistribution findBounds = new ExponentialDistribution(1d);
        // max probability should be roughly equal to accuracy of (max-min) to ensure all values are visitable,
        // over entire range, but this results in overly skewed distribution, so take sqrt
        final double mean = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min)));
        return new ExpFactory(min, max, mean);
    } catch (Exception _)
    {
        throw new IllegalArgumentException("Invalid parameter list for uniform distribution: " + params);
    }
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:21,代码来源:OptionDistribution.java


注:本文中的org.apache.commons.math3.distribution.ExponentialDistribution.inverseCumulativeProbability方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。