Skip to main content
POST
/
quantlib
/
numerical
/
integration
/
stratified
Stratified Sampling Integration
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/numerical/integration/stratified \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "func_name": "x2",
  "a": 0,
  "b": 2,
  "n_strata": 10,
  "samples_per_stratum": 100,
  "seed": 42
}
'
{
  "success": true,
  "data": {
    "estimate": 2.6671,
    "std_error": 0.0089
  }
}

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 scalar function to integrate

Available options:
exp,
log,
sin,
cos,
sqrt,
x2,
x3
Example:

"x2"

a
number
required

Lower integration bound

Example:

0

b
number
required

Upper integration bound

Example:

2

n_strata
integer
default:10

Number of strata to divide the interval into

Example:

10

samples_per_stratum
integer
default:100

Number of samples per stratum

Example:

100

seed
integer
default:42

Random seed for reproducibility

Example:

42

Response

Successful Response

success
boolean
Example:

true

data
object