In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to create the least square method in the. Net math library NMath, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
NMath is a math library for all .NET languages, such as C #, Visual Basic, F# and .NET. It contains the basic classes for object-oriented digital computing on the .NET platform. The following describes how to use .NET / C#/VB/F# and so on to create a least square solution.
The least square solution of the linear equation Ax = y consists of the vector values of the rectangular matrices An and y. For example:
Example of C # least square method:
Var A = new DoubleMatrix ("4x2 [1.0 20.0 1.0 30.0 40.0 1.0 50.0 1.0]" >
Example of VB least square method:
Dim A = New DoubleMatrix ("4x2 [1.020.01.030.0 40.0 1.050.01.0]") Dim Y = New DoubleVector ("[.446.601.7886.928]") Dim LSQ = New DoubleLeastSquares (A, Y)
You can use the optional Boolean parameters of the constructor to add intercept parameters for the model. If true, a list of optional Boolean parameters is pre-added to the deep copy of matrix A before solving the least square solution. For example:
Example of C # least square method:
Var lsq = new FloatComplexLeastSquares (A, y, true)
Example of VB least square method:
Dim LSQ As New FloatComplexLeastSquares (A, Y, True)
For advanced users, you can specify a non-default tolerance valid level for calculation. The effective level of An is determined by treating singular values that are less than the tolerance multiplied by the maximum singular value as zero. Therefore:
Example of C # least square method:
Double tolerance = 1eMub 5scape var lsq = new DoubleComplexLeastSquares (A, y, false, tolerance)
Example of VB least square method:
Dim Tolerance As Double = "1e-5" Dim LQS As New DoubleComplexLeastSquares (A, Y, False, Tolerance) the above is how to create the least square method in the. Net math library NMath. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.