如何在 F# 中反转矩阵?
我需要使用 F# 执行一些基本的 OLS 回归。 为此,我需要一些线性代数函数,但我对那里有什么感到困惑。 我找不到任何方法来反转矩阵。 有一些名为 Microsoft.FSharp.Math.LinearAlgebra 的库的文档,但我不知道它是否存在。
I need to perform some basic OLS regression using F#. To do this I need some Linear Algebra functions, but I'm confused as to what's out there. I can't find any way to invert a matrix. There is some documentation for a library called Microsoft.FSharp.Math.LinearAlgebra
, but I don't know if that exists anymore.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果你将FSharp Powerpack添加到你的项目中(在.NET引用中),你可以使用矩阵库
编辑的各种功能:你还需要添加实验库Fsharp.Powerpack.MathProviders,然后你可以调用如下
If you add the FSharp Powerpack to your project (in .NET references), you can use various functionality of the matrix library
edit: you also need to add the experimental library Fsharp.Powerpack.MathProviders, then you can call as follows
FlyingFrog 做一个Numerics 库,其中包含矩阵求逆以及许多其他函数。
不确定哪个更可取,还是 PowerPack 中的(显然已弃用的)“实验”代码。 我想您始终可以将 PowerPack 版本的托管位的源代码保存在安全的地方,仍然可以在这里找到:
FlyingFrog do a Numerics library which contains Matrix inversion amongst many other functions.
Not sure which is preferable, that or the (apparently deprecated) 'experimental' code from the PowerPack. I guess you could always keep the source code for the managed bit of the PowerPack version in a safe place, still available here:
我不知道; 在 F# 1.9.6 版本中,我没有立即看到任何内容,文档在这里
http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/namespaces.html
并且 Microsoft 中有 Matrix 的东西。 FSharp.Powerpack.dll 中的 FSharp.Math 命名空间,但我没有立即看到“invert”,并且我不知道“LinearAlgebra”内容(已弃用?网络搜索表明它在几个版本前消失了)。
I don't know; in the 1.9.6 version of F# I don't see anything offhand, the docs are here
http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/namespaces.html
and there is Matrix stuff in the Microsoft.FSharp.Math namespace in the FSharp.Powerpack.dll, but I don't see 'invert' offhand, and I don't know about the 'LinearAlgebra' stuff (deprecated? web search suggests it disappeared a few releases back).
您查看过此吗? 这可能有帮助。
Have you checked out this. It might help.