Modeling a Dynamic Trade War using Julia: Assumptions, Simulation, and Impacts on the US Economy

Modeling a Dynamic Trade War using Julia: Assumptions, Simulation, and Impacts on the US Economy

Building a simple dynamic simulation in Julia


This article explains a simplified simulation using game theory (the prisoner's dilemma) to analyze the impacts of imposing tariffs between the US and its major trading partners, highlighting potential short-term economic benefits such as increased revenues and domestic protection. The examples are coded in Julia and the files are available on github. https://github.com/etorkia/SharedDecisionModels/tree/main/PrisonnerGame
Author: Eric Torkia
0 Comments
Article rating: No rating
Is Oracle Crystal Ball still relevant?

Is Oracle Crystal Ball still relevant?

Are Excel Simulation Add-Ins like Oracle Crystal Ball the right tools for decision making? This short blog deliberates on the pros and cons of Oracle Crystal Ball.
Author: Eric Torkia
0 Comments
Article rating: No rating
Decision Science Developper Stack

Decision Science Developper Stack

What tools should modern analysts master 3 tier design after Excel?

When it comes to having a full fledged developper stack to take your analysis to the next level, its not about tools only, but which tools are the most impactful when automating and sharing analysis for decision making or analyzing risk on projects and business operations. 

Author: Eric Torkia
0 Comments
Article rating: No rating
The Need For Speed 2019

The Need For Speed 2019

Comparing Simulation Performance for Crystal Ball, R, Julia and @RISK

The Need for Speed 2019 study compares Excel Add-in based modeling using @RISK and Crystal Ball to programming environments such as R and Julia. All 3 aspects of speed are covered [time-to-solution, time-to-answer and processing speed] in addition to accuracy and precision.
Author: Eric Torkia
0 Comments
Article rating: 3.8
Bayesian Reasoning using R (Part 2) : Discrete Inference with Sequential Data

Bayesian Reasoning using R (Part 2) : Discrete Inference with Sequential Data

How I Learned to Think of Business as a Scientific Experiment

Imagine playing a game in which someone asks you to infer the number of sides of a polyhedron die based on the face numbers that show up in repeated throws of the die. The only information you are given beforehand is that the actual die will be selected from a set of seven die having these number of faces: (4, 6, 8, 10, 12, 15, 18). Assuming you can trust the person who reports the outcome on each throw, after how many rolls of the die wil you be willing to specify which die was chosen?
Author: Robert Brown
0 Comments
Article rating: 2.5
RSS

Correlation of Duke Basketball Scores, in Crystal Ball (6/8)

Feb 03 2011

In our quest to simulate future Duke Basketball scores, we have taken past historical data of individual games during the '09/'10 season and fitted probability distributions to that data. Two PDFs are generated; one for Duke's scores (offense) and one for their opponents' scores (defense). We have used both Crystal Ball and ModelRisk to perform this task. Is there something missing in our PDF formulations?

There is. Examine the data carefully. Does there appear to be a rough pattern or correlation between the offense scores and scores allowed by Duke's defense? For many of the games, even if the Duke score is lower than the average for all Duke offense scores, the opponent seems to score less as well compared to the average of all Duke's opponents. In other words, there is a positive correlation between the sets of paired data samples. Calculated values for Pearson's, Spearman's and Kendall's Tau coefficient appear to be in agreement. (These values are in Cells C42:E42.) If this behavior was not modeled properly, then any future simulation of Duke Basketball outcomes would predict more Duke losses than the data really indicates. Last year's Duke squad did a good job of defense when their offense was not chugging on all cylinders!

To implement correlation behavior in CB between two CB Assumptions, the user must define the Spearman's coefficient within a set of CB windows. We will do this between the first best-fitting PDF for Duke scores and the first best-fitting PDF for opponent scores. After opening the Duke 09_10 Scores spreadsheet with Crystal Ball loaded within MS Excel, perform the following steps:

  • Click on Cell I5.
  • Select "Define Assumption" in the CB ribbon bar. (This will open the CB Assumption in a separate window; this first best-fitting PDF was previously defined by fitting to the Duke offense score data in Column C.)
  • Select "Correlate…" in the lower left-hand corner.
  • Select "Choose..." in upper right-hand corner. (A list of CB Assumptions will come up with check boxes for all other CB Assumptions in your spreadsheet.)
  • Check the box for first best-fitting CB Assumption associated with opponent score (a Negative Binomial).

The user has the option, at this time, to define a Spearman's coefficient by either

  1. typing values in manually (done just below "Choose…" button),
  2. cell-referencing to a cell which has a coefficient value pre-defined (perhaps via Excel formula), or
  3. having CB calculate a Spearman's coefficient directly from data in the worksheet.

We will use the third approach as follows:

  • Select "Calc…" button.
  • Using cell-reference-picker, identify first cell range as C4:C37 and second cell range as D4:D37.
  • Select "OK."

As visualized in the data scatter chart, there is a positive correlation between Duke's offensive outputs and that of their opponents (see Fig. 6-1). The Spearman's coefficient value is approximately 0.35. Most analysts would term this a weak-to-intermediate correlation at best. Perhaps it won't have as much impact on our simulation results? But it is strong enough for consideration. (Crystal Ball does have a functionality to turn off all defined correlations in the CB Assumptions. Using this CB feature allows comparative MCA runs (with and without correlations) to determine magnitude of variance impact, which I highly recommend for all MCA models, regardless of code.)

  • Select "OK."
  • Select "OK" once more to return to normal Excel mode.

During the above process, the user was required to enter the correlations by first selecting the cell with the CB Assumption and then accessing that CB entity by selecting "Define Assumption." Users may consider the CB entity accessed this way as the comparative equivalent of an MR object. From their perspective, this can type of "click-through" access can be a good or bad thing. Good in that it error-proofs (to a certain extent) casual users from accidentally modifying or destroying the CB entities. Bad in that it does not allow direct access to the advanced spreadsheet user, like MR Objects do. User preferences should be considered here before committing to particular software.

Another point: In the above process, the user is provided a list of CB Assumptions to choose from, as shown in Fig. 6-2. Beautiful organization abounds. The user can see all CB Assumptions in all worksheets with all open workbooks. Worksheets and workbooks are represented by folders, much like folders represent directories in Windows Explorer. (If all are not visible, use the 'plus' and 'minus' signs preceding the folder symbols to open and close folders.) Naming conventions for your CB Assumptions become important here. Otherwise, the user is presented with a set of names based on cell reference locations only

Karl Luce is a Solutions Specialist who has a deep passion for using Monte Carlo analysis as a Six Sigma tool and quantifying uncertainty in the universe. His past roles included training Crystal Ball and quality concepts as a Design for Six Sigma (DFSS) Master Black Belt and a Six Sigma Transactional Black Belt.  He received his BS in Aeronautical/Astronautical Engineering from M.I.T. in 1985. Prior to joining Oracle in 2005, Karl held analytical and managerial positions within Fortune 500 corporations in the defense aerospace and automotive industries.  

RESEARCH ARTICLES | RISK + CRYSTAL BALL + ANALYTICS