Skip to main content
POST
/
quantlib
/
numerical
/
integration
/
monte-carlo
Monte Carlo Integration
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/numerical/integration/monte-carlo \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "func_name": "sphere",
  "bounds": [
    [
      -1,
      1
    ],
    [
      -1,
      1
    ]
  ],
  "n_samples": 10000,
  "seed": 42
}
'
{
  "success": true,
  "data": {
    "estimate": 2.6667,
    "std_error": 0.0235,
    "n_samples": 10000
  }
}

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
func_name
enum<string>
required

Built-in function (multi-variable for multi-d, scalar for 1-d)

Available options:
rosenbrock,
sphere,
rastrigin,
quadratic,
exp,
sin,
cos
Example:

"sphere"

bounds
number[][]
required

Integration bounds for each dimension [[a1,b1], [a2,b2], ...]

Required array length: 2 elements
Example:
[[-1, 1], [-1, 1]]
n_samples
integer
default:10000

Number of Monte Carlo samples (more samples = more accurate)

Example:

10000

seed
integer
default:42

Random seed for reproducibility

Example:

42

Response

Successful Response

success
boolean
Example:

true

data
object