Correlation App
The Correlation App analyzes correlations between asset attributes taking customizable time lags into account (Lag Intervals) and generates comprehensive reports with visualizations.
Main Features
Time-lag-based Correlation: Analyze relationships between attributes for defined time lags.
Report Generation: Create HTML and PDF reports with heatmaps, scatter plots, and lag charts.
Email Integration: Send reports directly to specified recipients.
Customizable Time Range: Define the start and end time of the analysis.
Configuration
Environment Variables
CONNECTION_STRING
Connection details to the Eliona database.
postgres://user:pass@host:port/dbname
API_ENDPOINT
API endpoint for accessing Eliona services.
http://api-v2:3000/v2
API_TOKEN
Authentication token for Eliona services.
your_api_token
API_SERVER_PORT
(Optional) Port for the API server. Default: 3000.
3000
SMTP_SERVER
Address of the SMTP server.
smtp.example.com
SMTP_PORT
SMTP server port.
587
SMTP_USER
Username for the SMTP server.
user@example.com
SMTP_PASSWORD
Password for the SMTP server.
password
API Endpoints
1. POST /v1/correlate
Description: Calculates the correlation between the specified attributes of multiple assets.
If only one asset ID is specified (without attribute names), all attributes of the asset are correlated with each other.
Request Body:
Response:
200 OK: Returns the following data:
Analyzed assets and time lags.
Analysis period.
Correlation results including
best_correlation,best_lagandlag_details.An HTML report (
report_html) with heatmap visualizations.If
to_emailis specified, the report is sent by email.
400 Bad Request: Invalid input parameters.
2. POST /v1/correlate-children
Description: Correlates all attributes of child assets of a specified asset.
Request Body: Same as /v1/correlate, but with specification of asset_id instead of a list of assets.
Response: Identical to /v1/correlate, including HTML report.
3. POST /v1/in-depth-correlation
Description: Performs a detailed correlation analysis for exactly two attributes.
Response:
Detailed correlation data including:
Best correlation and corresponding lag.
Correlation values for each tested lag.
HTML report (
report_html) with scatter and lag charts.
Request Parameters
The following parameters can be included in the request:
assets: List of asset-attribute pairs for the analysis. If no attribute is specified, all attributes of the asset are analyzed.
lags: Optional time lags, e.g.
{"hours": 10}.start_time, end_time: Analysis period.
to_email: (Optional) Email address for sending the report.
Example Request
Example response for the API request /v1/correlate
Explanation of response fields
assets:
Contains the analyzed assets and their attributes, e.g. temperature and humidity.
lags:
List of tested time lags: 15 minutes, 2 hours, and 1 day.
start_time, end_time:
The analysis period, here January 1 to 3, 2025.
correlation:
Detailed correlation data:
best_correlation: Highest correlation value (0.85).
best_lag: The time lag (2 hours) at which the highest correlation occurs.
lag_details: Correlation values for different lags (-2, 0, +2 hours).
report_html:
An HTML report with visualizations such as heatmaps and scatter plots, ready for direct viewing or saving.
Report Creation
Reports contain the following visualizations:
HTML report
Generated for the endpoints /v1/correlate and /v1/correlate-children:
Heatmaps: Best correlations between attributes.
Correlation numbers: Detailed statistics for each correlation.
Generated for the endpoint /v1/in-depth-correlation:
Scatter plots: Relationships between attributes.
Lag charts: Time-dependent trends.
Last updated
Was this helpful?