Linear Algebra

Some algorithms such as SVD, EVD, or QR are implemented as a managed version in F# for a full list check the API reference Notebook

open FSharp.Stats
open FSharp.Stats.Algebra

let A = 
    matrix [ [ 1.0;  1.0; -1.0 ]
             [ 1.0; -2.0; -3.0 ]
             [ 2.0;  3.0;  1.0 ] ]

let B = 
    matrix [ [  4.0; ]
             [ -6.0; ]
             [  7.0; ] ]

let svdRes = LinearAlgebra.SVD A
(vector [|4.595512789; 3.104930081; 0.4905827078|],
 
          0     1     2
                       
 0 -> 0.084 -0.53 0.846
 1 -> -0.69 -0.65 -0.33
 2 -> 0.722 -0.55 -0.42

Matrix of 3 rows x 3 columns,
 
          0     1     2
                       
 0 -> 0.183 0.788 0.587
 1 -> -0.73 -0.29 0.615
 2 -> -0.65 0.543 -0.53

Matrix of 3 rows x 3 columns)

Using unmanaged optimized linear algebra functions

Additionally, we provide some bindings for LAPACK routines. This is currently only tested on windows.

Attention: These bindings are highly incomplete and will most likely be dropped for something like MKL.NET. See issue#

the native libraries are contained in the nuget package at the netlib_LAPACK path. Include that one instead of the /../../lib pth used here.

ServiceLocator.setEnvironmentPathVariable (__SOURCE_DIRECTORY__ + "/../../lib") //"D:/Source/FSharp.Stats/lib"

// initialize the native service provider. This will search on many system paths for the needed binaries.
LinearAlgebra.Service()

let svdResLapack = LinearAlgebra.SVD A
namespace Plotly
namespace Plotly.NET
module Defaults from Plotly.NET
<summary> Contains mutable global default values. Changing these values will apply the default values to all consecutive Chart generations. </summary>
val mutable DefaultDisplayOptions: Plotly.NET.DisplayOptions
Multiple items
type DisplayOptions = inherit DynamicObj new: unit -> DisplayOptions static member addAdditionalHeadTags: additionalHeadTags: XmlNode list -> (DisplayOptions -> DisplayOptions) static member addDescription: description: XmlNode list -> (DisplayOptions -> DisplayOptions) static member combine: first: DisplayOptions -> second: DisplayOptions -> DisplayOptions static member getAdditionalHeadTags: displayOpts: DisplayOptions -> XmlNode list static member getDescription: displayOpts: DisplayOptions -> XmlNode list static member getPlotlyReference: displayOpts: DisplayOptions -> PlotlyJSReference static member init: ?AdditionalHeadTags: XmlNode list * ?Description: XmlNode list * ?PlotlyJSReference: PlotlyJSReference -> DisplayOptions static member initCDNOnly: unit -> DisplayOptions ...

--------------------
new: unit -> Plotly.NET.DisplayOptions
static member Plotly.NET.DisplayOptions.init: ?AdditionalHeadTags: Giraffe.ViewEngine.HtmlElements.XmlNode list * ?Description: Giraffe.ViewEngine.HtmlElements.XmlNode list * ?PlotlyJSReference: Plotly.NET.PlotlyJSReference -> Plotly.NET.DisplayOptions
type PlotlyJSReference = | CDN of string | Full | Require of string | NoReference
<summary> Sets how plotly is referenced in the head of html docs. </summary>
union case Plotly.NET.PlotlyJSReference.NoReference: Plotly.NET.PlotlyJSReference
Multiple items
namespace FSharp

--------------------
namespace Microsoft.FSharp
namespace FSharp.Stats
namespace FSharp.Stats.Algebra
val A: Matrix<float>
Multiple items
val matrix: ll: seq<#seq<float>> -> Matrix<float>

--------------------
type matrix = Matrix<float>
val B: Matrix<float>
val svdRes: vector * Matrix<float> * Matrix<float>
Multiple items
module LinearAlgebra from FSharp.Stats.Algebra

--------------------
type LinearAlgebra = new: unit -> LinearAlgebra static member nullspace: ?Accuracy: float -> (Matrix<float> -> Matrix<float>)

--------------------
new: unit -> LinearAlgebra
val SVD: a: Matrix<float> -> vector * Matrix<float> * Matrix<float>
<summary> Returns the full Singular Value Decomposition of the input MxN matrix A : A = U * SIGMA * V**T in the tuple (S, U, V**T), where S is an array containing the diagonal elements of SIGMA. &lt;summary&gt;uses the LAPACK routine dgesdd with the argument JOBZ = 'A'&lt;/summary&gt; &lt;remarks&gt;&lt;/remarks&gt; &lt;param name="a"&gt;&lt;/param&gt; &lt;returns&gt;&lt;/returns&gt; &lt;example&gt; &lt;code&gt; &lt;/code&gt; &lt;/example&gt; </summary>
module ServiceLocator from FSharp.Stats
val setEnvironmentPathVariable: dllDirectory: string -> unit
val Service: unit -> ILinearAlgebra
val svdResLapack: vector * Matrix<float> * Matrix<float>