JAVA - 指数分布 [英] JAVA - exponential distribution

查看:261
本文介绍了JAVA - 指数分布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到概率指数分布的公式,但我不知道如何找到它:(这个公式必须具有强大的统计属性(它不能丢弃任何随机的结果以保持不受限制的搜索随机实例)

I need to find formula for exponential distribution of probability, but i don´t know how to find it :( This formula have to have a powerful statistical properties(it can´t throw away any result from random to keep indistructed seek of random instance)

我正在尝试找到公式,它将在以下方法中起作用:

i am trying to find formula, which will work in method like this:

rand.getNextDuobleExpDistrib();

我现在有这个代码,但根据输入分析器,它无法正常工作

I have this code for now, but according to "input analyser" it doesn´t work correctly

public double getNext() {
        return -lampda * Math.log(rand.nextDouble());
 }


推荐答案

您可以看到以下答案:伪随机数生成器 - 指数分布

You can see this answer : Pseudorandom Number Generator - Exponential Distribution

这里是java代码

public double getNext() {
    return  Math.log(1-rand.nextDouble())/(-lambda);
}

祝你有愉快的一天

这篇关于JAVA - 指数分布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆