{% if sections.correlation is defined %}

🔗 Correlation Analysis

The correlation analysis section provides insights into the relationships between variables in your dataset. It includes both the correlation matrix and the lagged correlation matrix, along with visualizations to help you understand these relationships better.

{% set corr_matrix = sections.correlation.data.correlation_matrix %} {% if corr_matrix %}

Correlation Matrix

{% for col in corr_matrix.keys() %} {% endfor %} {% for row in corr_matrix.keys() %} {% for col in corr_matrix.keys() %} {% endfor %} {% endfor %}
{{ col }}
{{ row }}{{ "%.2f"|format(corr_matrix[row][col]) }}
{% endif %} {% set lagged_corr = sections.correlation.data.lagged_correlation_matrix %} {% if lagged_corr %}

Lagged Correlation Matrix

{% set lags = lagged_corr[lagged_corr|list|first].keys() %} {% for lag in lags %} {% endfor %} {% for col in lagged_corr.keys() %} {% for lag in lags %} {% endfor %} {% endfor %}
ColumnLag {{ lag }}
{{ col }}{{ "%.2f"|format(lagged_corr[col][lag]) }}
{% endif %}
{% if sections.correlation.chart and sections.correlation.chart.images %}
Visualizations Heatmap for Correlation Analysis
{% if sections.correlation.chart.images.correlation_matrix %}
Correlation Matrix Chart
{% endif %} {% if sections.correlation.chart.images.lagged_correlation_matrix %}
Lagged Correlation Matrix Chart
{% endif %}
{% endif %}
{% endif %}