Site icon R-bloggers

A Shiny app to visualize the Edgeworth box

[This article was first published on https://pacha.dev/blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
< !DOCTYPE html> < charset="utf-8"> < http-equiv="X-UA-Compatible" content="IE=edge"> < name="viewport" content="width=device-width, initial-scale=1.0"> pacha.dev/blog < !-- MathJax Configuration --> < !-- Smart header: libraries detected based on content --> < !-- File: /tmp/tmp.RWdx9dP1PI/index.html -->
  • < !-- DEBUG: Found sourceCode --> < !-- Load custom CSS after any library CSS to ensure proper precedence -->
  • < header class="site-top">

    Mauricio “Pachá” Vargas Sepúlveda

    Blog with notes about R, Shiny, SQL, Python, Linux and C++. This blog is listed on R-Bloggers.

    HOME 🏠
    < !-- categories are printed below this--> < nav class="sidebar-nav">

    Categories

    < header id="title-block-header" class="quarto-title-block default">

    A Shiny app to visualize the Edgeworth box

    Edgeworth box with contract curve for the 2×2 exchange model using Cobb-Douglas utility functions.
    Author

    Mauricio “Pachá” Vargas S.

    Published

    August 22, 2025

    Because of delays with my scholarship payment, if this post is useful to you I kindly ask a minimal donation on Buy Me a Coffee. It shall be used to continue my Open Source efforts. The full explanation is here: A Personal Message from an Open Source Contributor. If you play the electric guitar, the same scholarship chaos led me to turn my guitar pedals and DIY kits hobby into a business, and you can check those here.

    Update (2025-08-24): I uploaded the app to Shiny Apps for a live demo.

    I made a small Shiny app to visualize an Edgeworth box with contract curve for the 2×2 exchange model using Cobb-Douglas utility functions.

    The idea is that the user can alter the parameters for the Cobb-Douglas functions to see how the contract curve changes and how much the market equilibrium (or Walras’ equilibrium) shifts from the initial allocation.

    The initial endownments for good 1 and 2 and the normalized price can be changed as well.

    Here is a preview:

    To run the app locally, clone the repository https://github.com/pachadotdev/cobbdouglasge and then from RStudio/VSCode run the following in the R console:

    devtools::load_all()
    run_app()

    The base for this demonstration was exercise 15.B.2 from MWG.

    I hope this is useful!

    < footer>

    Loading…

  • < !-- Load shared sidebar -->
    To leave a comment for the author, please follow the link and comment on their blog: https://pacha.dev/blog.

    R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
    Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
    Exit mobile version