Skip to main content
POST
/
quantlib
/
numerical
/
linalg
/
lstsq
Solve Least Squares Problem
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/numerical/linalg/lstsq \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "A": [
    [
      1,
      1
    ],
    [
      1,
      2
    ],
    [
      1,
      3
    ],
    [
      1,
      4
    ]
  ],
  "b": [
    2.1,
    2.9,
    4.2,
    4.9
  ]
}
'
{
  "success": true,
  "data": {
    "x": [
      1.02,
      0.94
    ]
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key at https://finceptbackend.share.zrok.io/auth/register

Body

application/json
A
number[][]
required

Coefficient matrix (m × n, typically m > n for overdetermined system)

Example:
[[1, 1], [1, 2], [1, 3], [1, 4]]
b
number[]
required

Observation vector (m × 1)

Example:
[2.1, 2.9, 4.2, 4.9]

Response

Successful Response

success
boolean
Example:

true

data
object