{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "96f83e4a",
   "metadata": {},
   "source": [
    "\n",
    "File: 01-beyond_rationality.py\n",
    "\n",
    "\n",
    "Michel Bierlaire\n",
    "\n",
    "Thu Aug 07 2025, 15:18:54\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4365ec9d",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "import pandas as pd\n",
    "from IPython.core.display_functions import display\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0998ef1c",
   "metadata": {},
   "source": [
    "The objective of this laboratory is to investigate how to model apparent irrationality."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "de72cc13",
   "metadata": {},
   "source": [
    "We consider the example introduced by Ariely (2008), summarized in the following table:\n",
    "\n",
    "|     | experiment 1            | experiment 2           |     |\n",
    "| --- | ---                     | ---                    | --- |\n",
    "|16   | Web only @ \\$59         | Web only @ \\$59        | 68  |\n",
    "|0    | Print only @ \\$125      |                        |     |\n",
    "|84   | Print and web @ \\$125   | Print and web @ \\$125  | 32  |"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b37d3e22",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.DataFrame(\n",
    "    {'experiment': [1, 2], 'web_only': [16, 68], 'print_and_web': [84, 32]}\n",
    ")\n",
    "display(data)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "54c40de6",
   "metadata": {},
   "source": [
    "In the first experiment, three alternatives have been proposed to the\n",
    "respondents. In the second experiment, the dominated alternative\n",
    "(``Print only'') has\n",
    "been removed, and only two alternatives have been proposed. It shows\n",
    "that the presence or absence of an alternative that is never chosen\n",
    "(because dominated) may affect the probability to choose the other\n",
    "options. Such an alternative is called a *decoy*."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ed24eee4",
   "metadata": {},
   "source": [
    "The objective of this lab is to specify and estimate the parameters\n",
    "of a choice model using this data.\n",
    "\n",
    "1. Specify and estimate the parameters of a logit model that ignores the decoy effect.\n",
    "2. Specify and estimate the parameters of a logit model that accounts for the decoy effect.\n",
    "\n",
    "Compare and comment the results."
   ]
  }
 ],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 5
}
