Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Resit and Supplementary Coursework.
You should create and submit two Jupyter Notebooks – one for each part - clearly
labelled as PartA and Part B. You should also use a *different* local copy of BSE.py file
for each part: clearly named, e.g., BSE-A.py and BSE-B.py. You should submit both BSE files along with your Jupyter Notebooks and any other code files you write.
Your Jupyter Notebook for Part A should contain no more than 1000 words of markdown. Your Jupyter Notebook for Part B should contain no more than 1000 words of markdown.
Part A: Exploration of Smith’s Test 3 using automated trading agents in BSE.
In Part A you will configure, run, visualise, and analyse market experiments based on Smith’s “Test 3”, in his seminal 1962 paper.
Source: Vernon Smith (1962), An experimental study of competitive market behavior, Journal of Political Economy, 70(2), pp. 111-137. Available online:PDF
Smith Section II describes his experimental procedure. Each experiment, human participants are divided into buyers and sellers. Buyers and sellers are allocated a card with a reservation price (maximum price to buy; or minimum price to sell) and then asked to trade. When no more trades take place,a new “period” begins. At the start of the new period, buyers and sellers are re-allocated a new reservation card and asked to trade again. The experiment repeats for P periods.
Smith performs multiple experiments with different configurations. Here, we will focus on Test 3. Smith’s visualisation of Test 3 is shown in Chart 3, copied below:
In Part A, you are required to configure a BSE experiment to closely replicate Vernon Smith’s Test 3. Rather than using human participants, you will use trading agents as participants.
You will be awarded marks for following Smith’s method closely, and marks will be lost if you deviate in method. You will also be awarded marks for quality visualisation (e.g., graphs with appropriate labelling) and for presenting graphs in a similar form to Smith’s Chart 3. Marks will be lost the more you deviate from the general form of Smith’svisualisation.
Please note: Smith uses decimal prices, ranging from $0.00 to $10.00. BSE uses integer price values, such that $1.00 in Smith’s experiment is equivalent to price 100 in BSE. BSE.py has a maximum price parameter, bse_sys_maxprice which is set to 500 (i.e., $5.00) by default:
bse_sys_maxprice = 500
To configure Smith’s experiments, it is necessary to allow price values up to $9.99.
Therefore, you must begin by editing your local copy of BSE.py to set max price 999, i.e.:
bse_sys_maxprice = 999
A.1: Configure and run a homogeneous market containing only SHVR trading agents.
Provide a graph of demand and supply, and a chart showing transaction prices for one example run. Compare your result with Smith’s result,and using your knowledge of SHVR agent logic, explain why/how results differ.
Marking scheme:
? 5 marks are available for experimental configuration code. You will make re-use of this code throughout part A.
? 5 marks are available for code that generates output figure. You will make re-use of this code throughout part A.
? 5 marks are available for results, discussion, and interpretation.
[15 marks]
A.2: Using the same experimental configuration as part A.1, run a homogeneous market containing only ZIC trading agents.
Using the same figure formatas part A.1, show a graph of demand and supply, and a chart
of transaction prices for one example run. Compare your result with Smith’s result, and using your knowledge of ZIC agent logic, explain why/how results differ.
[5 marks]
A.3: Using the same experimental configuration as part A.1, run a homogeneous market containing only ZIP trading agents.
Using the same figure formatas part A.1, show a graph of demand and supply, and a chart of transaction prices for one example run. Compare your result with Smith’s result, and using your knowledge of ZIP agent logic, explain why/how results differ.
[5 marks]
A.4: Using the same experimental configuration as part A.1, run a “balanced” market containing half ZIC traders and half SHVR traders. Using the same figure formatas part A.1, show a graph of demand and supply, and a chart of transaction prices for one example run. Compare your result with Smith’s result and your previous results, explaining why/how results differ.
[5 marks]
A.5: Using the same SHVR-ZIC “balanced test” market configuration as part A.4, run multiple experimental trials N, and analyse results to compare the average profits generated by each trader type. Marks will be awarded for selecting an appropriate number of trials N, for performing appropriate statistical test(s), for quality visualisations, and for accurately interpreting results. You may present a maximum of four graphs/figures. Marks will be lost for each additional graph/figure plotted.
[10 marks]
Part B
NOTE: To do well in Part B you will need to edit BSE.py and execute relatively
large numbers of market-session simulations using your edited code, which
collectively can use up quite a lot of CPU time. Once you understand what to do, making the necessary edits to the code might not take you very long but to
generate enough data you may then need to set simulation experiments to run on your laptop/desktop PC for several hours or more of continuous processing (e.g. overnight), during which you can be working on other things, or sleeping.
Because of this, it is important to plan ahead, and to not leave until the last
minute before starting work on this part ofthe coursework. What is required to do well here is readily achievable on a current mid-range personal computer: you do not require access to high-performance supercomputers like the University’s
BlueCrystal/BluePebble facilities, but you should expect to have to wait quite a while for enough data to be generated.
BSE edits: If you make edits to your local version of BSE.py you will need to
include a copy of your edited BSE.py in the zip file that you submit. You must also clearly comment your local BSE.py to indicate where and how you have made edits (so that we can see the changes you have made) and you should also refer to these edits in your Jupyter Notebook (include a brief description of the
changes you have made and why, and state the lines of code and function name where edits have been made so that we can easily find your changes).
A recent paper by Cliff (2023) describes the long-term co-evolutionary dynamics of markets populated by ZIP traders that are continually trying to improve their
hyperparameter values, to trade more profitably, by using a simple stochastic
hillclimber (SH) method to search for better hyperparameter values, thereby giving a
variant of the ZIP adaptive trading strategy known as ZIPSH. As described in more depth in (Cliff, 2023) the SH mechanism in a single ZIPSH trader maintains a private local
population of kdifferent candidate strategies, tests the profitability of each of them in
sequence, and then identifies the most profitable of the k as the ‘elite” strategy; it then creates k-1 new “child” strategies, each child being a mutation of the elite strategy, and replaces the non-elite members of the old population with these new children; and then it evaluates the profitability of each member of the new population to identify its elite
individual, which is then mutated to create k-1 children; and so on, repeating this process forever.