Skip to content

Calculate correlation between two aggregates

Request

Calculate Pearson correlation coefficient between two aggregates over a date range (Testing).

Returns correlation coefficient between -1 (perfect negative) and 1 (perfect positive).

Security
HTTPBearer
Bodyapplication/jsonrequired
aggregate_id_1integer, > 0(Aggregate Id 1)required

First aggregate ID

aggregate_id_2integer, > 0(Aggregate Id 2)required

Second aggregate ID

intervalstring(IntervalEnum)

Time interval

Default:"1d"
Enum:"10min""30min""1h""1d""1w""1m""1y"
start_datestring, (date-time)(Start Date)required

Start date

end_datestring, (date-time)(End Date)required

End date

metricstring(Metric)

Metric to correlate

Default:"retail_net_turnover"
asset_classstring(AssetClassEnum)

Asset class

Default:"cash"
Enum:"all""cash""options"
curl -i -X POST \
  https://docs.vanda-analytics.com/_mock/apis/aggregates/vanda-msvc-aggregates/aggregates/analytics/correlation \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "aggregate_id_1": 1,
    "aggregate_id_2": 1,
    "interval": "10min",
    "start_date": "2019-08-24T14:15:22Z",
    "end_date": "2019-08-24T14:15:22Z",
    "metric": "retail_net_turnover",
    "asset_class": "all"
  }'

Responses

Successful Response

Bodyapplication/json
aggregate_id_1integer(Aggregate Id 1)required

First aggregate ID

aggregate_id_2integer(Aggregate Id 2)required

Second aggregate ID

correlationnumber, [ -1 .. 1 ](Correlation)required

Pearson correlation coefficient (-1 to 1)

data_pointsinteger, >= 0(Data Points)required

Number of overlapping data points

metricstring(Metric)required

Metric used for correlation

intervalstring(Interval)required

Time interval

date_rangeobject(Date Range)required

Date range analysed

Response
{ "aggregate_id_1": 0, "aggregate_id_2": 0, "correlation": -1, "data_points": 0, "metric": "string", "interval": "string", "date_range": {} }

Calculate correlation between two aggregates

Request

Calculate Pearson correlation coefficient between two aggregates over a date range (Testing).

Returns correlation coefficient between -1 (perfect negative) and 1 (perfect positive).

Security
HTTPBearer
Bodyapplication/jsonrequired
aggregate_id_1integer, > 0(Aggregate Id 1)required

First aggregate ID

aggregate_id_2integer, > 0(Aggregate Id 2)required

Second aggregate ID

intervalstring(IntervalEnum)

Time interval

Default:"1d"
Enum:"10min""30min""1h""1d""1w""1m""1y"
start_datestring, (date-time)(Start Date)required

Start date

end_datestring, (date-time)(End Date)required

End date

metricstring(Metric)

Metric to correlate

Default:"retail_net_turnover"
asset_classstring(AssetClassEnum)

Asset class

Default:"cash"
Enum:"all""cash""options"
curl -i -X POST \
  https://docs.vanda-analytics.com/_mock/apis/aggregates/vanda-msvc-aggregates/aggregates/analytics/correlation \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "aggregate_id_1": 1,
    "aggregate_id_2": 1,
    "interval": "10min",
    "start_date": "2019-08-24T14:15:22Z",
    "end_date": "2019-08-24T14:15:22Z",
    "metric": "retail_net_turnover",
    "asset_class": "all"
  }'

Responses

Successful Response

Bodyapplication/json
aggregate_id_1integer(Aggregate Id 1)required

First aggregate ID

aggregate_id_2integer(Aggregate Id 2)required

Second aggregate ID

correlationnumber, [ -1 .. 1 ](Correlation)required

Pearson correlation coefficient (-1 to 1)

data_pointsinteger, >= 0(Data Points)required

Number of overlapping data points

metricstring(Metric)required

Metric used for correlation

intervalstring(Interval)required

Time interval

date_rangeobject(Date Range)required

Date range analysed

Response
{ "aggregate_id_1": 0, "aggregate_id_2": 0, "correlation": -1, "data_points": 0, "metric": "string", "interval": "string", "date_range": {} }