From 0894786556b516f5541662b5342d04b07253864c Mon Sep 17 00:00:00 2001 From: jvivian Date: Sat, 9 Mar 2024 14:36:32 -0800 Subject: [PATCH] Try and remove external links from header --- .../dr-dfm/index/execute-results/html.json | 4 +- docs/index.html | 2 +- docs/posts/kd-art/index.html | 90 +++++++++---------- docs/posts/kd-inked-into-creation/index.html | 2 +- docs/search.json | 2 +- docs/temp/kingdom-death/index.html | 66 +++++++------- posts/dr-dfm/index.qmd | 14 --- push.sh | 2 + 8 files changed, 85 insertions(+), 97 deletions(-) diff --git a/_freeze/posts/dr-dfm/index/execute-results/html.json b/_freeze/posts/dr-dfm/index/execute-results/html.json index 2071d71..fadaaaa 100644 --- a/_freeze/posts/dr-dfm/index/execute-results/html.json +++ b/_freeze/posts/dr-dfm/index/execute-results/html.json @@ -1,7 +1,7 @@ { - "hash": "bdc286181c487549e5aa96a42eb9b86d", + "hash": "8fff06ca22a3798a9d97566a8ba9073d", "result": { - "markdown": "---\ntitle: \"Covid-19 Data-Rich Dynamic Factor Model\"\nsubtitle: \"Overview, Python Package, and Interactive Analysis\"\nauthor: \"John Vivian, Aaron Cooke, Josh Fitzgerald\"\ndate: \"2024-03-09\"\ncategories: ['Math', 'Modeling', 'Python']\nimage: \"jv_dfm.jpg\"\nformat:\n html:\n toc: true\n# output-file: \"presentation-post.html\"\n # revealjs:\n # include-in-header:\n # text: |\n # \neditor:\n render-on-save: true\ncode:\n echo: false\n---\n\n## Understanding the Economic Impact of COVID-19 Through Data\n\n
\n\nAs the world grapples with the ongoing effects of the COVID-19 pandemic, it is necessary to leverage advanced analytical tools to understand its economic impacts. Our project leverages Dynamic Factor Models (DFMs) to uncover hidden patterns and relationships in large amounts of economic data generated during this period. This presentation will introduce you to the core concepts of DFMs, the specific challenges posed by COVID-19 data, and the Python package we designed to address these challenges.\n\n\n# Dynamic Factor Models\n\n## Dynamic Factor Models: A Primer\n\n
\n\nDynamic Factor Models are powerful statistical tools that help us make sense of complex, interconnected data. By identifying latent factors that influence observed variables over time, DFMs can reveal the underlying trends and dynamics of economic systems. This approach is particularly valuable in the context of COVID-19, where traditional models may struggle to account for rapidly changing conditions.\n\n## The Model at a Glance\n\nConsider the basic Dynamic Factor Model equation:\n\n$$y_t = \\Lambda f_t + \\epsilon_t$$\n\n
\n\nHere's what each symbol represents:\n\n- $y_t$: The observed variables at time $t$.\n- $\\Lambda$: The loading matrix, showing how each latent factor influences observed variables.\n- $f_t$: The latent factors, representing underlying trends.\n- $\\epsilon_t$: The error term, accounting for discrepancies between model predictions and observed data.\n\n\n## Visualizing the Model\n\n\n:::{.columns}\n::::{.column width=\"70%\"}\n
\n\nThe latent factors ($f_t$) influence the observed variables ($y_t$) through the loading matrix ($\\Lambda$), and the error term ($\\epsilon_t$) is associated with the observed variables.\n\n
\n\nThe loading matrix is a bridge that connects the latent factors, which are unobservable, to the observed variables, providing a mathematical representation of how the latent factors influence the observed data\n::::\n::::{.column width=\"30%\"}\n![](./model-viz.png)\n::::\n:::\n\n## Latent Factors and Observed Variables {.smaller}\n> Relationship between latent factors and observed variables via loading matrix\n\n::: {.cell execution_count=1}\n``` {.python .cell-code}\n# echo: false\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Set seed for reproducibility\nnp.random.seed(42)\n\n# Generate dummy data\nnum_observed_variables = 4\nnum_time_points = 100\nloading_matrix = np.array([[0.5, 0.3, 0.8, 0.2],\n [0.7, 0.2, 0.5, 0.1]])\n\nlatent_factors = np.random.randn(num_time_points, 2)\nobserved_variables = np.dot(latent_factors, loading_matrix) + np.random.randn(num_time_points, num_observed_variables)\n\n# Plotting\nplt.figure(figsize=(10, 6))\n\n# Plot latent factors\nplt.subplot(2, 1, 1)\nplt.plot(latent_factors[:, 0], label='Latent Factor 1', linestyle='--')\nplt.plot(latent_factors[:, 1], label='Latent Factor 2', linestyle='--')\nplt.title('Latent Factors Over Time')\nplt.legend()\n\n# Plot observed variables\nplt.subplot(2, 1, 2)\nfor i in range(num_observed_variables):\n plt.plot(observed_variables[:, i], label=f'Observed Variable {i+1}')\nplt.title('Observed Variables Over Time')\nplt.legend()\n\nplt.tight_layout()\nplt.show()\n```\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-2-output-1.png){width=950 height=565}\n:::\n:::\n\n\n## Extending the Model with Time Dynamics\n\nBy incorporating autoregressive components, we can capture the evolving nature of economic relationships during the pandemic. This advanced model formulation allows for a more accurate representation of the data, enabling better forecasts and insights.\n\n
\n\n$$\n\\begin{split}\\begin{align}\ny_t & = \\Lambda f_t + B x_t + u_t \\\\\nf_t & = A_1 f_{t-1} + \\dots + A_p f_{t-p} + \\eta_t \\qquad \\eta_t \\sim N(0, I)\\\\\nu_t & = C_1 u_{t-1} + \\dots + C_q u_{t-q} + \\varepsilon_t \\qquad \\varepsilon_t \\sim N(0, \\Sigma)\n\\end{align}\\end{split}\n$$\n\n## Extending the Model with Time Dynamics {.smaller}\n\n$$\n\\begin{split}\\begin{align}\ny_t & = \\Lambda f_t + B x_t + u_t \\\\\nf_t & = A_1 f_{t-1} + \\dots + A_p f_{t-p} + \\eta_t \\qquad \\eta_t \\sim N(0, I)\\\\\nu_t & = C_1 u_{t-1} + \\dots + C_q u_{t-q} + \\varepsilon_t \\qquad \\varepsilon_t \\sim N(0, \\Sigma)\n\\end{align}\\end{split}\n$$\n\n
\n\nWhere $y_t$ is observed, $f_t$ are unobserved latent factors, $x_t$ are optional (unused for our case) exogenous variables, and the dynamic evolution of latent factors is expressed using the transition matrix $A$ with $\\eta_t$ representing new information or random shocks. $u_t$ is the error or \"idiosyncratic\" process\n\n. . .\n\n
\n\nThis model is then cast into state space form and the unobserved factors estimated via the Kalman filter. The likelihood can be evaluated as a byproduct of the filtering recursions with maximum likelihood estimation used to estimate the parameters.\n\n\n## Extending the Model with Time Dynamics {.smaller}\n$$f_t = A f_{t-1} + \\eta_t$$\n\n$A$: Transition matrix
\n$\\eta_t$: Innovation term\n\n
\n\n:::{.incremental}\n- The transition matrix, often denoted as $A$, is a square matrix that governs the temporal evolution of the latent factors\n- Each element of the matrix represents the influence of one latent factor at the current time on the corresponding latent factor at the next time point\n- The elements of the transition matrix $A$ determine how each latent factor at the previous time point contributes to the latent factors at the current time point\n- Values in the diagonal of $A$ represent the persistence of each latent factor over time\n- Off-diagonal elements indicate the influence of one latent factor on another\n:::\n\n## Interpreting Transition Matrices {.smaller}\n\nExamining the first transition matrix\n\n::: {.cell execution_count=2}\n``` {.python .cell-code}\n# echo: false\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n# Set seed for reproducibility\nnp.random.seed(42)\n\n# Generate two different transition matrices\ntransition_matrix_1 = np.array([[0.8, 0.2],\n [0.3, 0.7]])\n\ntransition_matrix_2 = np.array([[0.5, 0.5],\n [0.6, 0.4]])\n\n# Create a figure with subplots\nfig, axs = plt.subplots(1, 2, figsize=(10, 4))\n\n# Plot heatmap for Transition Matrix 1\nsns.heatmap(transition_matrix_1, annot=True, cmap=\"Reds\", linewidths=.5, ax=axs[0])\naxs[0].set_title('Transition Matrix 1')\n\n# Plot heatmap for Transition Matrix 2\nsns.heatmap(transition_matrix_2, annot=True, cmap=\"Reds\", linewidths=.5, ax=axs[1])\naxs[1].set_title('Transition Matrix 2')\n\n# Adjust layout\nplt.tight_layout()\nplt.show()\n```\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-3-output-1.png){width=936 height=373}\n:::\n:::\n\n\n- The diagonal elements (0.8 and 0.7) are relatively high, indicating a strong persistence of each latent factor over time.\n- The off-diagonal elements (0.2 and 0.3) suggest moderate influence of one latent factor on the other, allowing for some interaction between the two factors.\n- Summary: latent factors have a tendency to persist, with some interdependence.\n\n## Interpreting Transition Matrices {.smaller}\n\nExamining the second transition matrix\n\n::: {.cell execution_count=3}\n``` {.python .cell-code}\n# echo: false\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n# Set seed for reproducibility\nnp.random.seed(42)\n\n# Generate two different transition matrices\ntransition_matrix_1 = np.array([[0.8, 0.2],\n [0.3, 0.7]])\n\ntransition_matrix_2 = np.array([[0.5, 0.5],\n [0.6, 0.4]])\n\n# Create a figure with subplots\nfig, axs = plt.subplots(1, 2, figsize=(10, 4))\n\n# Plot heatmap for Transition Matrix 1\nsns.heatmap(transition_matrix_1, annot=True, cmap=\"Reds\", linewidths=.5, ax=axs[0])\naxs[0].set_title('Transition Matrix 1')\n\n# Plot heatmap for Transition Matrix 2\nsns.heatmap(transition_matrix_2, annot=True, cmap=\"Reds\", linewidths=.5, ax=axs[1])\naxs[1].set_title('Transition Matrix 2')\n\n# Adjust layout\nplt.tight_layout()\nplt.show()\n```\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-4-output-1.png){width=936 height=373}\n:::\n:::\n\n\n- The diagonal elements (0.5 and 0.4) are lower compared to Transition Matrix 1, suggesting less persistence of each latent factor over time.\n- The off-diagonal elements (0.5 and 0.6) indicate a relatively stronger influence of one latent factor on the other compared to Transition Matrix 1.\n- Summary: latent factors are less likely to persist and may be influenced more by each other, allowing for a more dynamic and responsive behavior.\n\n## Factor Constraints: Enhancing Model Interpretability\n
\n\nBy applying constraints to the model parameters, we can improve interpretability and reduce complexity while incorporating prior domain knowledge about variable relationships.\n\n

\n\nFor example, setting certain elements of the loading matrix to zero might suggest that specific observed variables are not influenced by particular latent factors.\n\n## Factor Constraints {.smaller}\n> Factor loading constraint example\n\n| Dep. variable | Global.1 | Pandemic | Employment | Consumption | Inflation |\n|-----------------|----------|----------|------------|-------------|-----------|\n| Supply_1 | X | | | | |\n| Supply_7 | X | | | | |\n| Monetary_5 | X | | | | |\n| Monetary_9 | X | | | | |\n| Supply_2 | X | | X | | |\n| Supply_3 | X | | X | | |\n| Demand_7 | X | | X | | |\n| Demand_3 | X | | | X | |\n| Demand_5 | X | | | X | |\n| Monetary_2 | X | | | | X |\n| Monetary_1 | X | | | | X |\n| Pandemic_2 | X | X | | | |\n| Pandemic_9 | X | X | | | |\n\n\n# Our Python Package: Modeling and Analysis\n\n## Implementation {.smaller}\n
\n\nWe are developing a Python package that simplifies the process of applying DFMs to COVID-19 economic data. The package includes features such as:\n\n
\n\n- Poetry for dependency management\n- CI with GitHub Actions\n- Pre-commit hooks with pre-commit\n- Code quality with black & ruff\n- Testing and coverage with pytest and codecov\n- Documentation with MkDocs\n- Compatibility testing for multiple versions of Python with Tox\n- Containerization with Docker\n\n## Dashboard {.smaller}\n
\nOur package contains a simplified interface for running parameterized DFM models\n\n:::{.column-page}\n![](runner.png)\n:::\n\n## Dashboard - Data Explorer {.smaller .scrollable}\n
\nOur package includes a comprehensive dashboard with features for data exploration, factor analysis, and comparative model testing. Here's a sneak peek at what you can do:\n\n\n:::{.column-page}\n![](data_explorer.png)\n:::\n\n## Dashboard - Factor Analysis {.smaller}\n
\nDive deep into the relationships between latent factors and observed variables. Understand how economic trends evolve over time.\n\n:::{.column-page}\n![](factor_analysis.png)\n:::\n\n## Dashboard - Comparative Analysis {.smaller .scrollable}\nTest and compare different model configurations to identify the most accurate representations of the data.\n\n:::{.column-page}\n![](comparative_analysis.png)\n:::\n\n\n# Future Work\n\n
\n\nOur next steps involve incorporating the insights gained from DFMs into [Synthetic Control Model](https://github.com/OscarEngelbrektson/SyntheticControlMethods) to further refine our understanding of COVID-19's economic impact by exploring counter-factual statements. We are garnering feedback on our work and are hoping to submit for publication within the year!\n\n", + "markdown": "---\ntitle: \"Covid-19 Data-Rich Dynamic Factor Model\"\nsubtitle: \"Overview, Python Package, and Interactive Analysis\"\nauthor: \"John Vivian, Aaron Cooke, Josh Fitzgerald\"\ndate: \"2024-03-09\"\ncategories: ['Math', 'Modeling', 'Python']\nimage: \"jv_dfm.jpg\"\nformat:\n html:\n toc: true\neditor:\n render-on-save: true\ncode:\n echo: false\n---\n\n## Understanding the Economic Impact of COVID-19 Through Data\n\n
\n\nAs the world grapples with the ongoing effects of the COVID-19 pandemic, it is necessary to leverage advanced analytical tools to understand its economic impacts. Our project leverages Dynamic Factor Models (DFMs) to uncover hidden patterns and relationships in large amounts of economic data generated during this period. This presentation will introduce you to the core concepts of DFMs, the specific challenges posed by COVID-19 data, and the Python package we designed to address these challenges.\n\n\n# Dynamic Factor Models\n\n## Dynamic Factor Models: A Primer\n\n
\n\nDynamic Factor Models are powerful statistical tools that help us make sense of complex, interconnected data. By identifying latent factors that influence observed variables over time, DFMs can reveal the underlying trends and dynamics of economic systems. This approach is particularly valuable in the context of COVID-19, where traditional models may struggle to account for rapidly changing conditions.\n\n## The Model at a Glance\n\nConsider the basic Dynamic Factor Model equation:\n\n$$y_t = \\Lambda f_t + \\epsilon_t$$\n\n
\n\nHere's what each symbol represents:\n\n- $y_t$: The observed variables at time $t$.\n- $\\Lambda$: The loading matrix, showing how each latent factor influences observed variables.\n- $f_t$: The latent factors, representing underlying trends.\n- $\\epsilon_t$: The error term, accounting for discrepancies between model predictions and observed data.\n\n\n## Visualizing the Model\n\n\n:::{.columns}\n::::{.column width=\"70%\"}\n
\n\nThe latent factors ($f_t$) influence the observed variables ($y_t$) through the loading matrix ($\\Lambda$), and the error term ($\\epsilon_t$) is associated with the observed variables.\n\n
\n\nThe loading matrix is a bridge that connects the latent factors, which are unobservable, to the observed variables, providing a mathematical representation of how the latent factors influence the observed data\n::::\n::::{.column width=\"30%\"}\n![](./model-viz.png)\n::::\n:::\n\n## Latent Factors and Observed Variables {.smaller}\n> Relationship between latent factors and observed variables via loading matrix\n\n::: {.cell execution_count=1}\n``` {.python .cell-code}\n# echo: false\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Set seed for reproducibility\nnp.random.seed(42)\n\n# Generate dummy data\nnum_observed_variables = 4\nnum_time_points = 100\nloading_matrix = np.array([[0.5, 0.3, 0.8, 0.2],\n [0.7, 0.2, 0.5, 0.1]])\n\nlatent_factors = np.random.randn(num_time_points, 2)\nobserved_variables = np.dot(latent_factors, loading_matrix) + np.random.randn(num_time_points, num_observed_variables)\n\n# Plotting\nplt.figure(figsize=(10, 6))\n\n# Plot latent factors\nplt.subplot(2, 1, 1)\nplt.plot(latent_factors[:, 0], label='Latent Factor 1', linestyle='--')\nplt.plot(latent_factors[:, 1], label='Latent Factor 2', linestyle='--')\nplt.title('Latent Factors Over Time')\nplt.legend()\n\n# Plot observed variables\nplt.subplot(2, 1, 2)\nfor i in range(num_observed_variables):\n plt.plot(observed_variables[:, i], label=f'Observed Variable {i+1}')\nplt.title('Observed Variables Over Time')\nplt.legend()\n\nplt.tight_layout()\nplt.show()\n```\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-2-output-1.png){width=950 height=565}\n:::\n:::\n\n\n## Extending the Model with Time Dynamics\n\nBy incorporating autoregressive components, we can capture the evolving nature of economic relationships during the pandemic. This advanced model formulation allows for a more accurate representation of the data, enabling better forecasts and insights.\n\n
\n\n$$\n\\begin{split}\\begin{align}\ny_t & = \\Lambda f_t + B x_t + u_t \\\\\nf_t & = A_1 f_{t-1} + \\dots + A_p f_{t-p} + \\eta_t \\qquad \\eta_t \\sim N(0, I)\\\\\nu_t & = C_1 u_{t-1} + \\dots + C_q u_{t-q} + \\varepsilon_t \\qquad \\varepsilon_t \\sim N(0, \\Sigma)\n\\end{align}\\end{split}\n$$\n\n## Extending the Model with Time Dynamics {.smaller}\n\n$$\n\\begin{split}\\begin{align}\ny_t & = \\Lambda f_t + B x_t + u_t \\\\\nf_t & = A_1 f_{t-1} + \\dots + A_p f_{t-p} + \\eta_t \\qquad \\eta_t \\sim N(0, I)\\\\\nu_t & = C_1 u_{t-1} + \\dots + C_q u_{t-q} + \\varepsilon_t \\qquad \\varepsilon_t \\sim N(0, \\Sigma)\n\\end{align}\\end{split}\n$$\n\n
\n\nWhere $y_t$ is observed, $f_t$ are unobserved latent factors, $x_t$ are optional (unused for our case) exogenous variables, and the dynamic evolution of latent factors is expressed using the transition matrix $A$ with $\\eta_t$ representing new information or random shocks. $u_t$ is the error or \"idiosyncratic\" process\n\n. . .\n\n
\n\nThis model is then cast into state space form and the unobserved factors estimated via the Kalman filter. The likelihood can be evaluated as a byproduct of the filtering recursions with maximum likelihood estimation used to estimate the parameters.\n\n\n## Extending the Model with Time Dynamics {.smaller}\n$$f_t = A f_{t-1} + \\eta_t$$\n\n$A$: Transition matrix
\n$\\eta_t$: Innovation term\n\n
\n\n:::{.incremental}\n- The transition matrix, often denoted as $A$, is a square matrix that governs the temporal evolution of the latent factors\n- Each element of the matrix represents the influence of one latent factor at the current time on the corresponding latent factor at the next time point\n- The elements of the transition matrix $A$ determine how each latent factor at the previous time point contributes to the latent factors at the current time point\n- Values in the diagonal of $A$ represent the persistence of each latent factor over time\n- Off-diagonal elements indicate the influence of one latent factor on another\n:::\n\n## Interpreting Transition Matrices {.smaller}\n\nExamining the first transition matrix\n\n::: {.cell execution_count=2}\n``` {.python .cell-code}\n# echo: false\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n# Set seed for reproducibility\nnp.random.seed(42)\n\n# Generate two different transition matrices\ntransition_matrix_1 = np.array([[0.8, 0.2],\n [0.3, 0.7]])\n\ntransition_matrix_2 = np.array([[0.5, 0.5],\n [0.6, 0.4]])\n\n# Create a figure with subplots\nfig, axs = plt.subplots(1, 2, figsize=(10, 4))\n\n# Plot heatmap for Transition Matrix 1\nsns.heatmap(transition_matrix_1, annot=True, cmap=\"Reds\", linewidths=.5, ax=axs[0])\naxs[0].set_title('Transition Matrix 1')\n\n# Plot heatmap for Transition Matrix 2\nsns.heatmap(transition_matrix_2, annot=True, cmap=\"Reds\", linewidths=.5, ax=axs[1])\naxs[1].set_title('Transition Matrix 2')\n\n# Adjust layout\nplt.tight_layout()\nplt.show()\n```\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-3-output-1.png){width=936 height=373}\n:::\n:::\n\n\n- The diagonal elements (0.8 and 0.7) are relatively high, indicating a strong persistence of each latent factor over time.\n- The off-diagonal elements (0.2 and 0.3) suggest moderate influence of one latent factor on the other, allowing for some interaction between the two factors.\n- Summary: latent factors have a tendency to persist, with some interdependence.\n\n## Interpreting Transition Matrices {.smaller}\n\nExamining the second transition matrix\n\n::: {.cell execution_count=3}\n``` {.python .cell-code}\n# echo: false\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n# Set seed for reproducibility\nnp.random.seed(42)\n\n# Generate two different transition matrices\ntransition_matrix_1 = np.array([[0.8, 0.2],\n [0.3, 0.7]])\n\ntransition_matrix_2 = np.array([[0.5, 0.5],\n [0.6, 0.4]])\n\n# Create a figure with subplots\nfig, axs = plt.subplots(1, 2, figsize=(10, 4))\n\n# Plot heatmap for Transition Matrix 1\nsns.heatmap(transition_matrix_1, annot=True, cmap=\"Reds\", linewidths=.5, ax=axs[0])\naxs[0].set_title('Transition Matrix 1')\n\n# Plot heatmap for Transition Matrix 2\nsns.heatmap(transition_matrix_2, annot=True, cmap=\"Reds\", linewidths=.5, ax=axs[1])\naxs[1].set_title('Transition Matrix 2')\n\n# Adjust layout\nplt.tight_layout()\nplt.show()\n```\n\n::: {.cell-output .cell-output-display}\n![](index_files/figure-html/cell-4-output-1.png){width=936 height=373}\n:::\n:::\n\n\n- The diagonal elements (0.5 and 0.4) are lower compared to Transition Matrix 1, suggesting less persistence of each latent factor over time.\n- The off-diagonal elements (0.5 and 0.6) indicate a relatively stronger influence of one latent factor on the other compared to Transition Matrix 1.\n- Summary: latent factors are less likely to persist and may be influenced more by each other, allowing for a more dynamic and responsive behavior.\n\n## Factor Constraints: Enhancing Model Interpretability\n
\n\nBy applying constraints to the model parameters, we can improve interpretability and reduce complexity while incorporating prior domain knowledge about variable relationships.\n\n

\n\nFor example, setting certain elements of the loading matrix to zero might suggest that specific observed variables are not influenced by particular latent factors.\n\n## Factor Constraints {.smaller}\n> Factor loading constraint example\n\n| Dep. variable | Global.1 | Pandemic | Employment | Consumption | Inflation |\n|-----------------|----------|----------|------------|-------------|-----------|\n| Supply_1 | X | | | | |\n| Supply_7 | X | | | | |\n| Monetary_5 | X | | | | |\n| Monetary_9 | X | | | | |\n| Supply_2 | X | | X | | |\n| Supply_3 | X | | X | | |\n| Demand_7 | X | | X | | |\n| Demand_3 | X | | | X | |\n| Demand_5 | X | | | X | |\n| Monetary_2 | X | | | | X |\n| Monetary_1 | X | | | | X |\n| Pandemic_2 | X | X | | | |\n| Pandemic_9 | X | X | | | |\n\n\n# Our Python Package: Modeling and Analysis\n\n## Implementation {.smaller}\n
\n\nWe are developing a Python package that simplifies the process of applying DFMs to COVID-19 economic data. The package includes features such as:\n\n
\n\n- Poetry for dependency management\n- CI with GitHub Actions\n- Pre-commit hooks with pre-commit\n- Code quality with black & ruff\n- Testing and coverage with pytest and codecov\n- Documentation with MkDocs\n- Compatibility testing for multiple versions of Python with Tox\n- Containerization with Docker\n\n## Dashboard {.smaller}\n
\nOur package contains a simplified interface for running parameterized DFM models\n\n:::{.column-page}\n![](runner.png)\n:::\n\n## Dashboard - Data Explorer {.smaller .scrollable}\n
\nOur package includes a comprehensive dashboard with features for data exploration, factor analysis, and comparative model testing. Here's a sneak peek at what you can do:\n\n\n:::{.column-page}\n![](data_explorer.png)\n:::\n\n## Dashboard - Factor Analysis {.smaller}\n
\nDive deep into the relationships between latent factors and observed variables. Understand how economic trends evolve over time.\n\n:::{.column-page}\n![](factor_analysis.png)\n:::\n\n## Dashboard - Comparative Analysis {.smaller .scrollable}\nTest and compare different model configurations to identify the most accurate representations of the data.\n\n:::{.column-page}\n![](comparative_analysis.png)\n:::\n\n\n# Future Work\n\n
\n\nOur next steps involve incorporating the insights gained from DFMs into [Synthetic Control Model](https://github.com/OscarEngelbrektson/SyntheticControlMethods) to further refine our understanding of COVID-19's economic impact by exploring counter-factual statements. We are garnering feedback on our work and are hoping to submit for publication within the year!\n\n", "supporting": [ "index_files/figure-html" ], diff --git a/docs/index.html b/docs/index.html index 148fb2b..6f3433e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -183,7 +183,7 @@
Categories
-
+
diff --git a/docs/posts/kd-art/index.html b/docs/posts/kd-art/index.html index 4123919..1c20ba0 100644 --- a/docs/posts/kd-art/index.html +++ b/docs/posts/kd-art/index.html @@ -195,7 +195,7 @@

Kingdom Death Artwork

-

+

Figure 1: Lion Knight Miniature
@@ -203,7 +203,7 @@

Kingdom Death Artwork

-

+

Figure 2: Several hours later
@@ -219,7 +219,7 @@

Chapter Artwork

-

+

0: Awake
@@ -227,7 +227,7 @@

Chapter Artwork

-

+

1: Returning Survivors
@@ -237,7 +237,7 @@

Chapter Artwork

-

+

2: Endless Screams
@@ -245,7 +245,7 @@

Chapter Artwork

-

+

3: Lights in the Sky
@@ -255,7 +255,7 @@

Chapter Artwork

-

+

4: The Butcher
@@ -263,7 +263,7 @@

Chapter Artwork

-

+

5: Hands of Head & Murder
@@ -273,7 +273,7 @@

Chapter Artwork

-

+

6: Uninvited Guest
@@ -281,7 +281,7 @@

Chapter Artwork

-

+

8: Glowing Crater & Rumbling in the Dark
@@ -291,7 +291,7 @@

Chapter Artwork

-

+

9: Forgotten Fear
@@ -299,7 +299,7 @@

Chapter Artwork

-

+

10: Antelo(o)pes
@@ -309,7 +309,7 @@

Chapter Artwork

-

+

11: Regal Visit
@@ -317,7 +317,7 @@

Chapter Artwork

-

+

12: Hooded Knight & Lanterns in the Sky
@@ -327,7 +327,7 @@

Chapter Artwork

-

+

13: The Lion, The Hand, and the Silver City
@@ -335,7 +335,7 @@

Chapter Artwork

-

+

14: 10^9 Lion
@@ -345,7 +345,7 @@

Chapter Artwork

-

+

15: (B) The Decade of Statues
@@ -353,7 +353,7 @@

Chapter Artwork

-

+

16: The Butcher & The Hooded Knight Return
@@ -363,7 +363,7 @@

Chapter Artwork

-

+

17: Places, Everyone
@@ -371,7 +371,7 @@

Chapter Artwork

-

+

18: An Ocular Assessment, A Clearing of Passage
@@ -381,7 +381,7 @@

Chapter Artwork

-

+

19: Slenderman II: Electric Boogaloo & The Triatholon of Death
@@ -389,7 +389,7 @@

Chapter Artwork

-

+

20: Watched
@@ -399,7 +399,7 @@

Chapter Artwork

-

+

21: Foul Play
@@ -407,7 +407,7 @@

Chapter Artwork

-

+

22: Cat Scratch Fever
@@ -417,7 +417,7 @@

Chapter Artwork

-

+

23: The Butcher III: Hack City
@@ -425,7 +425,7 @@

Chapter Artwork

-

+

24: Hottest Hands & Darkest Nights
@@ -435,7 +435,7 @@

Chapter Artwork

-

+

25: The Secret Meeting
@@ -443,7 +443,7 @@

Chapter Artwork

-

+

26: Acid Rain
@@ -453,7 +453,7 @@

Chapter Artwork

-

+

27: Murder She Wrote
@@ -461,7 +461,7 @@

Chapter Artwork

-

+

28: Slenderman III: Catching the Boogeyman
@@ -471,7 +471,7 @@

Chapter Artwork

-

+

29: Secret Meeting II: Not-So-Secret
@@ -479,7 +479,7 @@

Chapter Artwork

-

+

30: Gold Smoke Knight
@@ -496,7 +496,7 @@

Miniature-based Gallery

-

+

The Butcher model
@@ -504,7 +504,7 @@

Miniature-based Gallery

-

+

The Butcher
@@ -514,7 +514,7 @@

Miniature-based Gallery

-

+

The Hand model
@@ -522,7 +522,7 @@

Miniature-based Gallery

-

+

The Hand
@@ -532,7 +532,7 @@

Miniature-based Gallery

-

+

Slenderman model
@@ -540,7 +540,7 @@

Miniature-based Gallery

-

+

Slenderman
@@ -550,7 +550,7 @@

Miniature-based Gallery

-

+

The Watcher model
@@ -558,7 +558,7 @@

Miniature-based Gallery

-

+

The Watcher
@@ -568,7 +568,7 @@

Miniature-based Gallery

-

+

Lion God model
@@ -576,7 +576,7 @@

Miniature-based Gallery

-

+

Lion God - ew
@@ -586,7 +586,7 @@

Miniature-based Gallery

-

+

Gold Smoke Knight model
@@ -594,7 +594,7 @@

Miniature-based Gallery

-

+

Gold Smoke Knight
@@ -997,7 +997,7 @@

Tools & Versioning

- + diff --git a/docs/posts/kd-inked-into-creation/index.html b/docs/posts/kd-inked-into-creation/index.html index 4b4ce8b..e2eafde 100644 --- a/docs/posts/kd-inked-into-creation/index.html +++ b/docs/posts/kd-inked-into-creation/index.html @@ -1095,7 +1095,7 @@

Addendum

});
- + diff --git a/docs/search.json b/docs/search.json index 37e2bb8..73a8e9c 100644 --- a/docs/search.json +++ b/docs/search.json @@ -571,7 +571,7 @@ "href": "temp/kingdom-death/index.html#summary-statistics", "title": "Kingdom Death", "section": "Summary Statistics", - "text": "Summary Statistics\n\nThere is a valid defence [sic] of using non-Bayesian methods, namely incompetence\n\n\n\n/tmp/ipykernel_31397/1245481724.py:9: DeprecationWarning:\n\n`apply` is deprecated. It has been renamed to `map_elements`.\n\n/tmp/ipykernel_31397/1245481724.py:10: DeprecationWarning:\n\n`cumsum` is deprecated. It has been renamed to `cum_sum`.\n\n\n\n\nCumulative Deaths Over Time\n\n\n\n \n\n\n\n\nMost Dangerous Foes\n\n\n/tmp/ipykernel_31397/510724665.py:2: DeprecationWarning:\n\n`groupby` is deprecated. It has been renamed to `group_by`.\n\n\n\n\n \n\n\n\n\nMost Hunted Quarries\n\n\n/tmp/ipykernel_31397/250231344.py:3: DeprecationWarning:\n\n`groupby` is deprecated. It has been renamed to `group_by`.\n\n/tmp/ipykernel_31397/250231344.py:4: DeprecationWarning:\n\n`count` is deprecated. It has been renamed to `len`.\n\n\n\n\n\n\n\n\n\n\ncount\n\n\nMonster\n\n\n\n\n\nWhite Lion\n10\n\n\nGigalion\n5\n\n\nAntelope\n4" + "text": "Summary Statistics\n\nThere is a valid defence [sic] of using non-Bayesian methods, namely incompetence\n\n\n\n/tmp/ipykernel_32509/1245481724.py:9: DeprecationWarning:\n\n`apply` is deprecated. It has been renamed to `map_elements`.\n\n/tmp/ipykernel_32509/1245481724.py:10: DeprecationWarning:\n\n`cumsum` is deprecated. It has been renamed to `cum_sum`.\n\n\n\n\nCumulative Deaths Over Time\n\n\n\n \n\n\n\n\nMost Dangerous Foes\n\n\n/tmp/ipykernel_32509/510724665.py:2: DeprecationWarning:\n\n`groupby` is deprecated. It has been renamed to `group_by`.\n\n\n\n\n \n\n\n\n\nMost Hunted Quarries\n\n\n/tmp/ipykernel_32509/250231344.py:3: DeprecationWarning:\n\n`groupby` is deprecated. It has been renamed to `group_by`.\n\n/tmp/ipykernel_32509/250231344.py:4: DeprecationWarning:\n\n`count` is deprecated. It has been renamed to `len`.\n\n\n\n\n\n\n\n\n\n\ncount\n\n\nMonster\n\n\n\n\n\nWhite Lion\n10\n\n\nGigalion\n5\n\n\nAntelope\n4" }, { "objectID": "temp/kingdom-death/index.html#acknowledgements", diff --git a/docs/temp/kingdom-death/index.html b/docs/temp/kingdom-death/index.html index 7df73fd..72c8677 100644 --- a/docs/temp/kingdom-death/index.html +++ b/docs/temp/kingdom-death/index.html @@ -317,7 +317,7 @@

Foreword

“Surely this must be the greatest game ever made! I must immediately find and play it!”

-

+

13 year old me: “What the fuck is this?”
@@ -327,7 +327,7 @@

Foreword

I ended up working on this, in some capacity, every day for almost three months. I got obsessed with new features in tools like Stable Diffusion, which offer much more control than commercial tools like Midjourney, and seemed to come out every day. As my friend joked, “Honey! New ControlNet just dropped!” I ended up spending hours each week making and learning about digital art. Hundreds of hours later I’m happy with the progress I’ve made and how much fun I’ve had doing things like mocking up one of my favorite guitarist’s Chaos Nurgle kitbash model: Section 1.2.4.

-

+

And now for something, completely different
@@ -566,7 +566,7 @@

Year 7: Phoe
-

+

BONK! Gotcha 😏
@@ -1873,7 +1873,7 @@

Artwork

-

+

Figure 1: Lion Knight Miniature
@@ -1881,7 +1881,7 @@

Artwork

-

+

Figure 2: Several hours later
@@ -1931,7 +1931,7 @@

Miniature-based Gallery

-

+

Gigalion model
@@ -1939,7 +1939,7 @@

Miniature-based Gallery

-

+

Gigalion
@@ -1949,7 +1949,7 @@

Miniature-based Gallery

-

+

The Butcher model
@@ -1957,7 +1957,7 @@

Miniature-based Gallery

-

+

The Butcher
@@ -1967,7 +1967,7 @@

Miniature-based Gallery

-

+

The Hand model
@@ -1975,7 +1975,7 @@

Miniature-based Gallery

-

+

The Hand
@@ -1985,7 +1985,7 @@

Miniature-based Gallery

-

+

Slenderman model
@@ -1993,7 +1993,7 @@

Miniature-based Gallery

-

+

Slenderman
@@ -2003,7 +2003,7 @@

Miniature-based Gallery

-

+

The Watcher model
@@ -2011,7 +2011,7 @@

Miniature-based Gallery

-

+

The Watcher
@@ -2021,7 +2021,7 @@

Miniature-based Gallery

-

+

Lion God model
@@ -2029,7 +2029,7 @@

Miniature-based Gallery

-

+

Lion God - ew
@@ -2039,7 +2039,7 @@

Miniature-based Gallery

-

+

Gold Smoke Knight model
@@ -2047,7 +2047,7 @@

Miniature-based Gallery

-

+

Gold Smoke Knight
@@ -2163,7 +2163,7 @@

40K Chaos Nurgle Kitbash Examp
-

+

Figure 3: Chaos Nurgle Kitbash by Malcolm Pugh
@@ -2186,11 +2186,11 @@

Summary Statistics

-
/tmp/ipykernel_31397/1245481724.py:9: DeprecationWarning:
+
/tmp/ipykernel_32509/1245481724.py:9: DeprecationWarning:
 
 `apply` is deprecated. It has been renamed to `map_elements`.
 
-/tmp/ipykernel_31397/1245481724.py:10: DeprecationWarning:
+/tmp/ipykernel_32509/1245481724.py:10: DeprecationWarning:
 
 `cumsum` is deprecated. It has been renamed to `cum_sum`.
 
@@ -2201,9 +2201,9 @@

Cumulative Dea
-
- + diff --git a/posts/dr-dfm/index.qmd b/posts/dr-dfm/index.qmd index ae8bdd9..47bda31 100644 --- a/posts/dr-dfm/index.qmd +++ b/posts/dr-dfm/index.qmd @@ -8,20 +8,6 @@ image: "jv_dfm.jpg" format: html: toc: true -# output-file: "presentation-post.html" - # revealjs: - # include-in-header: - # text: | - # editor: render-on-save: true code: diff --git a/push.sh b/push.sh index 9432270..00e887c 100755 --- a/push.sh +++ b/push.sh @@ -1,3 +1,5 @@ +rm -r _freeze +rm -r docs quarto render git add . git commit -m "$1"