本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}