给定均数向量和协方差矩阵的多元正态分布(multivariate normal distribution given mean vector and covariance matrix)

我承认我在这里很懒,但有人知道一个免费的数学.net库,它给出了给定平均向量和协方差矩阵的正态分布的输出吗? 谢谢。


I admit I am being lazy here but is anyone aware of a free math .net library which gives me the output of a normal distribution given a mean vector and a covariance matrix? Thanks.

2023-02-06 19:02

满意答案

Math.NET可能适合您。

http://www.mathdotnet.com/

http://numerics.mathdotnet.com/probability-distributions/

多变量分布

Dirichlet
Inverse Wishart
Matrix Normal
Multinomial
NormalGamma
Wishart

功能参考:

http://api.mathdotnet.com/Numerics/MathNet.Numerics.Distributions/MatrixNormal.htm

编辑:请注意,您必须从这里下载

http://mathnetnumerics.codeplex.com/releases/view/56448

mathdotnet.com上的其他链接已过时。


Math.NET might work for you.

http://www.mathdotnet.com/

http://numerics.mathdotnet.com/probability-distributions/

Multivariate Distributions

Dirichlet
Inverse Wishart
Matrix Normal
Multinomial
NormalGamma
Wishart

Function Reference:

http://api.mathdotnet.com/Numerics/MathNet.Numerics.Distributions/MatrixNormal.htm

EDIT : Note that you have to download from here

http://mathnetnumerics.codeplex.com/releases/view/56448

other links on mathdotnet.com are out of date.

相关问答

更多

包含向量和协方差矩阵的负积(Negative product containing vector and covariance matrix)

您的协方差矩阵有两个几乎为零的特征值(10 ^ -10和10 ^ -18)。 因此,矩阵不容易倒置,甚至可能被认为是不可逆的。 这两个小特征值的原因是您的数据点不能填充整个4D空间,而只能填充2D子空间(嵌入4D的平面)。 要计算合理的距离,您需要将点投影到二维空间(或实际数据所具有的任何维度)。 你可以用PCA做到这一点。 在此之后,您可以用2D计算距离。 Your covariance matrix has two eigenvalues that are almost zero (10^-1...

numpy中随机正态分布矩阵(A random normally distributed matrix in numpy)

做你想做的事情的目的是 A = np.random.normal(0, 1, (3, 3)) 这是可选的size参数,它告诉numpy你想要返回什么形状(在这种情况下为3乘3)。 你的第二种方式也有效,因为文档说明了 如果size为None(默认值),则如果loc和scale都是标量,则返回单个值。 否则,绘制np.broadcast(loc,scale).size样本。 因此,没有多变量分布,也没有相关性。 The intended way to do what you want is A =...

R - 估计向量的函数及其协方差矩阵(R - functions of an estimated vector and its covariance matrix)

您可以使用numDeriv包来数值估计渐变,如果想要精确值,可以使用numDeriv 。 library(numDeriv) f <- function(x) c( x, x[1] + x[2], ( x[1] + x[2] ) / x[3] ) x0 <- c(1,1,1) V <- diag(1:3) J <- jacobian(f, x0) J # [,1] [,2] [,3] # [1,] 1 0 0 # [2,] 0 1 0 # [3,] ...

如何使用pandas创建多元正态分布的相关矩阵?(how to use pandas to create correlation matrix of multivariate normal distribution?)

看起来你可以做到 def makecov(rho, n): out = numpy.eye(n) + rho numpy.fill_diagonal(out, 1) return out It looks like you could do def makecov(rho, n): out = numpy.eye(n) + rho numpy.fill_diagonal(out, 1) return out

高斯混合模型在MATLAB中的应用 - 计算经验方差协方差矩阵(Gaussian Mixture Model in MATLAB - Calculation of the Empirical Variance Covariance Matrix)

当你计算协方差时要注意你的数据没有居中。 而且,你的0.25因子是错误的。 这不是变量的缩放,而是选择。 应使用总协方差法 / 总协方差法进行计算 。 “给定事件”是混合索引。 计算的例子由高斯混合物的协方差的计算给出。 When you calculate the Covariance pay attention that your data isn't centered. Moreover, your 0.25 factor is wrong. This is not a scaling of...

给定均数向量和协方差矩阵的多元正态分布(multivariate normal distribution given mean vector and covariance matrix)

Math.NET可能适合您。 http://www.mathdotnet.com/ http://numerics.mathdotnet.com/probability-distributions/ 多变量分布 Dirichlet Inverse Wishart Matrix Normal Multinomial NormalGamma Wishart 功能参考: http://api.mathdotnet.com/Numerics/MathNet.Numerics.Distributions/...

1D情况下方差的等效协方差矩阵是什么?(What is the equivalent covariance matrix to the variance in the 1D case?)

您将方差与标准偏差混淆。 scale=参数到np.random.normal指定标准偏差 (即方差的平方根),而传递给np.random.multivariate_normal的协方差矩阵的对角线对应于每个维度的方差 。 尝试将协方差矩阵的对角线设置为16**2 == 256 。 You are confusing the variance with the standard deviation. The scale= parameter to np.random.normal specifies...

随机多元正态分布(Random multivariate normal distribution)

1)使用Dima建议的库实现。 或者,如果你真的觉得需要自己做这件事: 2)假设您想要生成具有平均向量M和方差/协方差矩阵V的法线,在V上执行Cholesky分解以得到下三角矩阵L,使得V = LL t (其中上标t表示转置)。 生成三个独立标准法线的向量Z(使用Random.nextGaussian()来获取各个元素)。 然后LZ + M将具有期望的多元正态分布。 1) Use a library implementation, as suggested by Dima. Or, if you ...

PyMC - 用于协方差估计的Wishart分布(PyMC - wishart distribution for covariance estimate)

这里有一些我可以改进代码+推理的建议: 我将pm.Wishart("cov_matrix_inv",n_obs,np.linalg.inv(cov_matrix))改为pm.Wishart("cov_matrix_inv",n_obs,np.eye(3) )因为它更客观(并且有10000个数据点)不管怎样,你的事先并不重要 mcmc = pm.MCMC()应为mcmc = pm.MCMC(model) mcmc.sample( 5000, 2000, 3 )这里有很少的样本。 当有大量样本时,MC...

布朗运动和协方差矩阵(Brownian Motion and covariance matrix)

这是一种方法。 t <- 11:15 m <- vapply(seq_along(t), function(i) c(t[seq_len(i)], rep(t[i], length(t)-i)), numeric(length(t))) m # [,1] [,2] [,3] [,4] [,5] #[1,] 11 11 11 11 11 #[2,] 11 12 12 12 12 #[3,] 11 12 13 13 13 #[4,] ...

相关文章

更多

Pick定理的几个出人意料的应用(转载自Matrix67)

Pick定理的几个出人意料的应用 Brain Storm| 2009-08-10 1:34| ...

[转载]惊人的答案:平均要取多少个(0,1)中的随机数才能让和超过1

惊人的答案:平均要取多少个(0,1)中的随机数才能让和超过1 Brain Storm| ...

点燃绳子究竟还能测出哪些时间?

Matrix67发表于 2010年12月18日 01:03 | Hits: 25 Tag: 算法 ...

Java 数据结构

Java 数据结构 Java工具包提供了强大的数据结构。在Java中的数据结构主要包括以下几种接 ...

Mangos模拟器综合资源贴

[ post] Mangos服务器配置文件中文说明 #Mangosd.conf, 适用于芒果服务器 2 ...

物理专业英语词汇(H-N)

物理专业英语词汇(H-N) H h maser 氢微波激射器氢脉泽 h parameter h参数 ...

[转载]Buffon投针实验:究竟为什么是pi?

Buffon投针实验:究竟为什么是pi? Brain Storm| 2009-11-06 2 ...

[转载]两道题(简化的搜索提示系统+随机数发生器)

两道题(简化的搜索提示系统+随机数发生器) 一、实现一个简化的搜索提示系统。给定一个包含了用户 ...

最新问答

更多

Python / IPython奇怪的不可重现列表索引超出范围错误(Python/IPython strange non reproducible list index out of range error)

你得到IndexError的原因是你的输入文件显然不是完全用制表符分隔的。 这就是为什么当您尝试访问它时, splits[1]没有任何内容。 您的代码可以使用一些重构。 首先,你正在重复使用if -checks,这是不必要的。 这只是将cds0到7个字符,这可能不是你想要的。 我将以下内容放在一起,以演示如何重构您的代码,使其变得更加pythonic和干燥。 我无法保证它能够与您的数据集一起使用,但我希望它可以帮助您了解如何以不同的方式执行操作。 to_sort = [] # W

故事板从表格单元中延伸出来并显示其详细信息披露按钮(storyboard segue from a tablecell an its Detail Disclosure Button)

我不认为你可以链接一个特定的细节披露按钮瓦特/赛格。 我的故事板是非常程序化的B / C我使用了很多定制CGRect等。 所以我倾向于使用这样的东西: -(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { [self performSegueWithIdentifier:@"ViewControllerIdentifer"

我们可以将Gherkin功能文件与testcomplete集成(Can we integrate Gherkin feature files with testcomplete)

TestComplete不支持Gherkin功能文件。 但是,TestComplete具有SDK,因此可以自己为此创建扩展。 TestComplete does not support Gherkin feature files. However, TestComplete has SDK so it is possible to create an extension for this by yourself.

TrustAllCertificatesCallback被忽略(TrustAllCertificatesCallback is ignored)

我没有做过这样的事情,但看看我认为可以看出错误的例子。 试试这个代码: static class Program { static void Main() { var tcpclient = new TcpClient("remote.example.com", 443); var tcpstream = tcpclient.GetStream(); var sslstream = new SslStream(tcpstream,

返回嵌套元素的索引(Return index of nested element)

您需要获取父li元素的索引。 否则,您将获得列表项内锚点的索引,该索引始终为零。 $(this.parentNode).index(); You need to get the index of the parent li element. Otherwise you are getting the index of the anchor inside the list item, which will always be zero. $(this.parentNode).index();

在数组中重新编号元素的有效方法(Efficient way of re-numbering elements in an array)

您需要多次迭代列表,我认为没有办法解决这个问题。 毕竟,在开始更改元素(第二遍)之前,首先必须确定不同元素的数量(第一遍)。 但是请注意,由于对index的重复调用而not in列表中具有O(n),因此可能具有最多O(n ^ 2)的不同元素的数量。 或者,您可以使用dict而不是value_map的list 。 字典比列表具有更快的查找速度,因此,复杂性应该确实在O(n)的数量级上。 您可以使用(1)字典理解来确定旧值到新值的映射,以及(2)用于创建更新子项的列表理解。 value_map =

Express app定义的`static`文件夹无法正常工作(Express app defined `static` folder not working properly)

选项1 你可以改变这一行: app.use( express.static(__dirname + '/puplic')); //my public folder. 至 app.use('/oneTime', express.static(__dirname + '/puplic')); //my public folder 选项2 我假设你在公共文件夹中有一个js文件夹,然后你需要更改你的HTML代码:

使用node.js和socket.io每秒广播一次(Using node.js and socket.io to broadcast every second)

对于计时器值,请在服务器端本身每秒更新本地计时器。 每当有任何用户进来时,给他这个值以及计时器的总值。 然后客户端将根据dandavis评论在本地启动自己的计时器,但在服务器端保留一些间隔,如15或10秒,服务器将广播当前计时器值,以便客户端相应地进行同步。 简而言之,服务器将每隔10(n:你决定)秒后广播,但它将在本地每秒更新定时器变量。 每当客户端进入时,它将获得总计时器值和当前计时器值。 广播当前出价的休息功能可以以正常方式完成。 For timer value, keep updatin

如何让XMLSerializer将命名空间添加到嵌套对象中的属性?(How do I get the XMLSerializer to add namespaces to attributes in nested objects?)

IXmlSerializable也许? 注意我还添加了(对A ): [XmlElement("A", Namespace = "http://www.example.com/namespace")] public TestSoapHeaderTypeValuePair A {...} 代码如下: public class TestSoapHeaderTypeValuePair : IXmlSerializable { private string _type; private