我正在尝试将以下数学方程从正态累积分布表达式转换为 Unity 中的 C#。 NORMSDIST 是 Excel 中使用的表达式,我想通过它是否可以在 C# 中完成此操作。那么这个方程有没有简化的方法呢?
标准分布 (-0.48) = 0.31
最佳答案
感谢您的评论。我使用 using MathNet.Numerics;
实现了这一点。您可以通过安装 NuGet 下载此 Unity 包 - https://github.com/GlitchEnzo/NuGetForUnity .
因此,以下方法有效:
using System;
using System.Collections;
using System.Collections.Generic;
using MathNet.Numerics;
using UnityEngine;
public class CumulativeFunction : MonoBehaviour {
void Start () {
F (-0.48f);
}
static double F (double x) {
MathNet.Numerics.Distributions.Normal result = new MathNet.Numerics.Distributions.Normal ();
return result.CumulativeDistribution (x);
}
}
关于c# - C# 的正态累积分布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67163617/