C#,数值计算——指数分布(Expondist)的计算方法与源程序

using System;

namespace Legalsoft.Truffer

{

public class Expondist

{

private double bet { get; set; }

public Expondist(double bbet)

{

this.bet = bbet;

if (bet <= 0.0)

{

throw new Exception("bad bet in Expondist");

}

}

public double p(double x)

{

if (x < 0.0)

{

throw new Exception("bad x in Expondist");

}

return bet * Math.Exp(-bet * x);

}

public double cdf(double x)

{

if (x < 0.0)

{

throw new Exception("bad x in Expondist");

}

return 1.0 - Math.Exp(-bet * x);

}

public double invcdf(double p)

{

if (p < 0.0 || p >= 1.0)

{

throw new Exception("bad p in Expondist");

}

return -Math.Log(1.0 - p) / bet;

}

}

}

相关推荐
徐小黑ACG1 小时前
Golang 基础05 结构体struct
开发语言·算法·golang
Navigator_Z2 小时前
LeetCode //C - 1286. Iterator for Combination
c语言·算法·leetcode
北极有牛2 小时前
cpp学习笔记--常量指针
java·开发语言·算法
GPU实战笔记2 小时前
云端 GPU 训练的账户余额提醒:它能说明什么,不能说明什么?
深度学习·算法·成本管理·gpu云计算·云端训练
浮链序3 小时前
怎么证明"你这个模型是偷我的"——把蒸馏变成取证工具
算法·安全·llm
小O的算法实验室3 小时前
IEEE TMC,面向异构物联网的多目标量子行为拓扑优化算法
算法
liliangcsdn4 小时前
派息率指标的应用探索和分析
大数据·算法
垆边人似月.4 小时前
华为机试题 :两数之和
c++·算法·华为
默默开发4 小时前
物流行业可用算法方向
算法