;;;;;;;;;;;; ;;; HEAD ;;; ;;;;;;;;;;;; globals [ lambda ;; tracks the performance of the economic sector thermometer ;; temporary variable used to calculate lambda dead-firms ;; tracks the number of firms that exit the market dead-people ;; same as before for people dead-investors ;; idem for investors hhi-history ;; history of HHI values lambda-history ;; accumulated lambda values sectors-record ;; records the values assumed by the endogenous part of lambda locations ;; list with address of all firms prob-ruin ;; percentage of firms leaving the market p-ruin-history ;; tracks the values of the previous variable num+obs ;; percentage of positive values observed for lambda num-obs ;; percebtage of negative values observed for lambda sector-size ;; sum of resources of all firms sector-size-history ;; trackes the values of the previous variable demand ;; the value of one demand segment ] breed [ firms firm ] breed [ people person ] breed [ investors investor ] undirected-link-breed [ securities security ] links-own [ value kind ] turtles-own [ age resources ] people-own [ longevity ;; expected average active lifetime of people load ;; accumulated surplus of evidence towards one alternative threshold ;; how much information one needs to gather before making a choice bias ;; personal inclination of people towards some alternative ] firms-own [ costs ;; the ammount of resources spent each period to keep the company running profits? ;; returns true if the company made a profit this period, false otherwise profit-history ;; tracks the number of periods that the company made profits performance ;; returns how much profit the company made market-share ;; the share of the market captured by the company reliability ;; number of periods a firm made profit over its age revenue ;; the total demand captured by a firm clockD ;; clockwise demand of a firm counterD ;; counterclockwise demand of a firm Mclock ;; clockwise market-share of a firm Mcounter ;; counterclockwise marke-share of a firm debt ;; sum of bonds issued by a firm risk-measure ;; measure depending on the type of securities issued risk-type ;; if a firm is issuing bonds or shares ] investors-own [ ;; investors are the people who chose the "portfolio prospect" longevity ;; ... all attribute values are inherited from when they were load ;; ... classified as people threshold bias ] ;;;;;;;;;;;;;;;;;;;;;;;; ;;; SETUP PROCEDURES ;;; ;;;;;;;;;;;;;;;;;;;;;;;; to setup clear-all setup-circle set lambda 0.1 ;; economic environment starts at a neutral state set demand 500 set-default-shape firms "factory" set-default-shape people "person business" set-default-shape investors "circle" set dead-people 0 set dead-firms 0 set dead-investors 0 create-firms incumbents ;; takes the input from the incumbent slide button on the interface ask firms [ fd 12 set age 1 set resources 1000 ;; 1000 is just an example quantity set size 1.5 set color brown set profit-history 0 set costs (total-cost * resources) ;; total-cost is an input from slide button that gives the % of the cost ;; ... in relation to the firm's resources set reliability (profit-history / age) ;; a proxy to measure how much trust on a future profit one might have ;; ... based on the past and relative to the age of the firm set risk-type "share" set market-share 0.000000001 ] create-people newcomers ;; takes the input from the newcomers slide button on the interface ask people [ fd 15 set age 1 set resources 1000 set size 1.5 set color gray set longevity life-expectancy ;; life-expectancy is an input from slide button set threshold random 10 + 1 ;; ... threshold floats on a scale of 1 to 10, as an example ifelse no-bias? = false ;; this button makes the bias attribute have no effect on the outcome [ set bias ((random 7) - 3) ] ;; ... if on, bias is a float from -3 to 3, as an example [ set bias 0 ] set load bias ;; initial value of load is the subjective bias ] set locations sort-on [ heading ] firms set prob-ruin 0.000000001 set sector-size sum [ resources ] of firms let hhi-now hhi set hhi-history (list (hhi-now)) set lambda-history (list -0.05 0.1) set p-ruin-history (list (prob-ruin)) set sector-size-history (list (sector-size)) set sectors-record (list 0) reset-ticks end to setup-circle create-ordered-turtles 360 [ set hidden? true set shape "dot" set size 0.2 set color 49 fd 12 stamp die ] end ;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; RUNNING PROCEDURES ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;; to go if not any? turtles [ stop ] create-people newcomers [ fd 15 set age 1 set resources 1000 set size 1.5 set color gray set longevity life-expectancy set threshold random 10 + 1 ifelse no-bias? = false [ set bias ((random 7) - 3) ] [ set bias 0 ] set load bias ] let death int(exogenous-death * (count people)) ;; exougenous-death is a slide in the interface ask n-of death people [ die ] ;; ... an exogenous source of (chance of) death to people set dead-people dead-people + death people-go investors-go set locations sort-on [ heading ] firms firms-go ifelse any? firms [ set prob-ruin (dead-firms / count firms) ] [ set prob-ruin 0.000000001 ] set dead-firms 0 set sector-size sum [ resources ] of firms solve-lambda let hhi-now hhi set hhi-history lput hhi-now hhi-history set lambda-history lput lambda lambda-history set p-ruin-history lput prob-ruin p-ruin-history set sector-size-history lput sector-size sector-size-history let positive-lambda filter [? > 0] lambda-history set num+obs length positive-lambda / length lambda-history let negative-lambda filter [? < 0] lambda-history set num-obs length negative-lambda / length lambda-history tick ;; adds 1 period to the discrete time counter end ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; COMPANIES PROCEDURES ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; to firms-go ask firms [ set age age + 1 if resources <= 0 [ ;; if a firm lose all its resources, it exits the market set dead-firms dead-firms + 1 die ] set size 1.5 + (0.00005 * resources) let exit random-float 1 ;; exougenous-exit is a slide in the interface if exit <= exogenous-exit [ ;; ... an exogenous source of (chance of) death to the firms set dead-firms dead-firms + 1 die ] set locations sort-on [ heading ] firms calculate-revenues firms-results if profit? [ set profit-history profit-history + 1 ] set reliability (profit-history / age) ] end to calculate-revenues ask firms [ set locations sort-on [ heading ] firms let clockwise sort-by < [heading] of firms let counterclock sort-by > [heading] of firms let clockWHO locations let counterWHO reverse locations let clockA-WHO locations let counterA-WHO reverse locations let clockASSETS sort-by < [resources] of firms let counterASSETS sort-by > [resources] of firms let n (length locations) - 1 ask last clockWHO [ set clockD (360 + ((item 0 clockwise) - (item n clockwise))) / count firms-here ] repeat n [ if (length clockWHO) = 1 [ stop ] ask first clockWHO [ set clockD ((item 1 clockwise) - (item 0 clockwise)) / count firms-here set clockwise but-first clockwise set clockWHO but-first clockWHO ] ] ask last counterWHO [ set counterD 360 - ((item 0 counterclock) - (item n counterclock)) / count firms-here ] repeat n [ if (length counterWHO) = 1 [ stop ] ask first counterWHO [ set counterD abs((item 1 counterclock) - (item 0 counterclock)) / count firms-here set counterclock but-first counterclock set counterWHO but-first counterWHO ] ] ask last clockA-WHO [ set Mclock ( (item n clockASSETS) / ((item 0 clockASSETS) + (item n clockASSETS)) ) / count firms-here ] repeat n [ if length clockASSETS = 1 [ stop ] ask first clockA-WHO [ set Mclock ( (item 0 clockASSETS) / ((item 1 clockASSETS) + (item 0 clockASSETS)) ) / count firms-here set clockASSETS but-first clockASSETS set clockA-WHO but-first clockA-WHO ] ] ask last counterA-WHO [ set Mcounter ( (item n counterASSETS) / ((item 0 counterASSETS) + (item n counterASSETS)) ) / count firms-here ] repeat n [ if length counterASSETS = 1 [ stop ] ask first counterA-WHO [ set Mcounter ( (item 0 counterASSETS) / ((item 1 counterASSETS) + (item 0 counterASSETS)) ) / count firms-here set counterASSETS but-first counterASSETS set counterA-WHO but-first counterA-WHO ] ] set revenue (demand * Mcounter * counterD) + (demand * Mclock * clockD) ] end to firms-results ask firms [ set debt sum [ value ] of my-links ifelse debt > 1000 [ set debt debt - 1000 set risk-type "bond" ] [ set debt 0 set risk-type "share" ] set costs (total-cost * resources) + (total-cost * revenue) set performance (revenue - costs - (interest * debt)) set resources (resources + performance) if resources <= 0 [ set dead-firms dead-firms + 1 die ] set market-share ( (((Mclock * clockD) + (Mcounter * counterD)) / 360) * 100) ] end ;;;;;;;;;;;;;;;;;;;;;;;;; ;;; PEOPLE PROCEDURES ;;; ;;;;;;;;;;;;;;;;;;;;;;;;; to people-go ask people [ set age age + 1 if age = life-expectancy [ set dead-people dead-people + 1 die ] best-utility foreach sort people [ if without-market? = false [ if load > threshold and any? firms [ hatch-investors 1 [ bk 7 set color red set size 0.6 let n int(((threshold + bias) / 20)*(count firms)) ;; proxy to how much of a risk-seeker a person is if n < 1 [ set n 1 ] create-links-with max-n-of n firms [market-share] ;; another possible rule is to substitute here market-share for reliability or performance ;; ... if you do this, check the other parts of this code with the same comment to do ask my-links [ ;; ... the substitution there too set color white set value (1000 / n) ask other-end [ set resources resources + (1000 / n) ] ;; assumes that the investor divides his resources equally within his portfolio ] ] die ] ] if load > threshold and not any? firms [ set color yellow ] ;; if a person wants to invest but there are no firms, she becomes yellow if load < (- threshold) [ ;; if the ammount of information is less than the (negative) threshold level, hatch-firms 1 [ bk 3 ;; ... the person turns into a firm (start-up) set age 1 set color green set resources 1000 set profit-history 0 set costs (total-cost * resources) set reliability (profit-history / age) set market-share 0.00000001 set risk-type "share" ] die ] ] ] end to best-utility ;; procedure that compares utlities of two prospects and records the result in the load attribute let U-startup (first w(1) * first v(1)) + (last w(1) * last v(1)) let whatever first w(0) let whatever2 (map [ ? * first v(0)] whatever) let invest+ reduce + whatever2 let whatever3 last w(0) let whatever4 (map [ ? * last v(0)] whatever3) let invest- reduce + whatever4 let U-invest (invest+ + invest-) ifelse U-startup <= U-invest [ set load load + 1] [ set load load - 1] end ;;; INVESTORS ;;; to investors-go ask investors with [ not any? my-links ] ;; hides from the view the investors who lost their portfolios [ set resources 0 set hidden? true ] ask investors [ set age age + 1 set resources sum [ value ] of my-links if age = life-expectancy [ set dead-investors dead-investors + 1 die ] ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ENVIRONMENT PROCEDURES ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to solve-lambda let rec-sector 0 ifelse count firms = 0 [ set thermometer 0 ] [ set thermometer ((count firms with [(performance > 0)]) / (count firms)) ] ifelse thermometer < 0.5 [ set rec-sector rec-sector - 1 set lambda lambda - 1 ask patches [ set pcolor 12 ] ] ;; in a trough the environment becomes red, otherwise becomes blue [ set rec-sector rec-sector + 1 set lambda lambda + 1 ask patches [ set pcolor 102 ] ] if not any? firms and thermometer = 0 [ set rec-sector rec-sector set lambda lambda ask patches [ set pcolor black ] ] let temp-lambda one-of [-1 1] ifelse temp-lambda = 1 [ set lambda lambda + 1 ] [ set lambda lambda - 1 ] if rec-sector > 0 [ set demand 600 ] if rec-sector = 0 [ set demand 500 ] if rec-sector < 0 [ set demand 400 ] set sectors-record lput rec-sector sectors-record end ;;;;;;;;;;;;;;; ;;; REPORTS ;;; ;;;;;;;;;;;;;;; to-report profit? report ifelse-value (performance > 0) [ true ] [ false ] end to-report hhi ;; Herfindahl-Hirschman Index measures the market concentration and ;; ... it's the sum of the squared market-shares of each firm in the market let rank sort-by < [market-share] of firms ;; ... ranges from near 0 (perfect competition) to 10000 (monopoly) ifelse empty? rank [ report 0.000000000001 ] [ let rank2 map [? ^ 2] rank report (reduce + rank2) ] end to-report w [ p ] ;;; KAHNEMAN & TVERSKY (1992) WEIGHTING FUNCTION ;;; ifelse p = 0 [ ;;; SETS WEIGHTING FUNCTION TO INVESTMENT MODE ;;; ifelse not any? firms [ report list [0] [0] ] [ let n int(((threshold + bias) / 20)*(count firms)) if n < 1 [ set n 1 ] let likely-portfolio-list sort max-n-of n firms [ market-share ] ;; vide previous comment on this option, another possible rule is let likely-portfolio-agentset max-n-of n firms [ market-share ] ;; ... to substitute here market-share for reliability or performance foreach likely-portfolio-list [ ask ? [ ;; putting a risk measure in each item of the likely-portfolio ifelse [ debt ] of ? > 0 [ set risk-type "bond" set risk-measure prob-ruin ] [ set risk-type "share" set risk-measure mean [(1 - reliability)] of likely-portfolio-agentset ] ] ] let p-success [(1 - risk-measure)] of max-n-of n firms [ reliability ] let p-fail [ risk-measure ] of max-n-of n firms [ reliability ] let w+ map [(? ^ 0.61) / (((? ^ 0.61) + ((1 - ?) ^ 0.61)) ^ (1 / 0.61))] p-success ;; CPT parameters for positive prospects let w- map [(? ^ 0.69) / (((? ^ 0.69) + ((1 - ?) ^ 0.69)) ^ (1 / 0.69))] p-fail report list (w+) (w-) ;; two lists of portfolio probabilities! ] ] [ ;;; SETS WEIGHTING FUNCTION TO STARTUP MODE ;;; let p-success num+obs if prob-ruin > num+obs [ set p-success 0 ] let p-fail num-obs if prob-ruin > num-obs [ set p-fail prob-ruin ] let w+ (p-success ^ 0.61) / (((p-success ^ 0.61) + ((1 - p-success) ^ 0.61)) ^ (1 / 0.61)) let w- (p-fail ^ 0.69) / (((p-fail ^ 0.69) + ((1 - p-fail) ^ 0.69)) ^ (1 / 0.69)) ;; CPT parameters for positive prospects report list (w+) (w-) ;; two probabilities ] end to-report v [ x ] ;;; KAHNEMAN & TVERSKY (1992) VALUE FUNCTION ;;; ifelse x = 0 [ ifelse not any? firms [ report list (0) (0) ] [ let n int(((threshold + bias) / 20)*(count firms)) if n < 1 [ set n 1 ] let likely-portfolio sort max-n-of n firms [ market-share ] ;; vide previous comment, another possible rule is to substitue here market-share ;; ... for reliability or performance ;;; SETS VALUE FUNCTION TO INVESTMENT MODE ;;; let per-bond-gain 0 let per-share-gain 0 let loss resources let num-bonds length (filter [[ risk-type ] of ? = "bond"] likely-portfolio) let num-shares length (filter [[ risk-type ] of ? = "share"] likely-portfolio) foreach likely-portfolio [ ifelse [ risk-type ] of ? = "bond" [ let b ((1000 / n) * ((1 + interest) ^ (life-expectancy - age))) set per-bond-gain per-bond-gain + b ] [ let s (1000 / n) * (sector-size / (count firms * 1000)) set per-share-gain per-share-gain + s ] ] let v- (-2.25 * ((loss) ^ 0.88)) ;; parameters from CPT paper let v+ (((num-bonds * per-bond-gain) + (num-shares * per-share-gain)) ^ 0.88) report list (v+) (v-) ;; list with a positive and a negative value ] ] [ ;;; SETS VALUE FUNCTION TO STARTUP MODE ;;; let m count firms let addresses (turtle-set self max-n-of m firms [heading]) ;; creates an agentset with all firms + one person let if-im-in sort-on [heading] addresses ;; sorts the agentset above in ascending order of heading let ind position self if-im-in let possible-rivals sort-by < [heading] of addresses let k (length if-im-in) - 1 let ab 1 ;;temporary values let ba 1 let my-power-ab 0.5 let my-power-ba 0.5 if k = 0 [ set ab 180 set ba 180 set my-power-ab 1 set my-power-ba 1 ] if k = 1 and ind = 0 [ set ab ((item 1 possible-rivals) - (item 0 possible-rivals)) set ba 360 + ((item 0 possible-rivals) - (item 1 possible-rivals)) set my-power-ab (resources / (resources + [ resources ] of (item 1 if-im-in)) ) set my-power-ba (resources / (resources + [ resources ] of (item 1 if-im-in)) ) ] if k = 1 and ind = 1 [ set ab 360 + ((item 0 possible-rivals) - (item 1 possible-rivals)) set ba ((item 1 possible-rivals) - (item 0 possible-rivals)) set my-power-ab (resources / (resources + [ resources ] of (item 0 if-im-in)) ) set my-power-ba (resources / (resources + [ resources ] of (item 0 if-im-in)) ) ] if k = 2 and ind = 0 [ set ab ((item 1 possible-rivals) - (item 0 possible-rivals)) set ba 360 + ((item 0 possible-rivals) - (item 2 possible-rivals)) set my-power-ab (resources / (resources + [ resources ] of (item 1 if-im-in)) ) set my-power-ba (resources / (resources + [ resources ] of (item 2 if-im-in)) ) ] if k = 2 and ind = 1 [ set ab ((item 2 possible-rivals) - (item 1 possible-rivals)) set ba 360 + ((item 0 possible-rivals) - (item 1 possible-rivals)) set my-power-ab (resources / (resources + [ resources ] of (item 2 if-im-in)) ) set my-power-ba (resources / (resources + [ resources ] of (item 0 if-im-in)) ) ] if k = 2 and ind = 2 [ set ab 360 + ((item 0 possible-rivals) - (item 2 possible-rivals)) set ba ((item 2 possible-rivals) - (item 1 possible-rivals)) set my-power-ab (resources / (resources + [ resources ] of (item 0 if-im-in)) ) set my-power-ba (resources / (resources + [ resources ] of (item 1 if-im-in)) ) ] if k > 2 and ind = 0 [ set ab ((item 1 possible-rivals) - (item 0 possible-rivals)) set ba 360 + ((item 0 possible-rivals) - (item k possible-rivals)) set my-power-ab (resources / (resources + [ resources ] of (item 1 if-im-in)) ) set my-power-ba (resources / (resources + [ resources ] of (item k if-im-in)) ) ] if k > 2 and ind = k [ set ab 360 + ((item 0 possible-rivals) - (item k possible-rivals)) set ba ((item k possible-rivals) - (item (k - 1) possible-rivals)) set my-power-ab (resources / (resources + [ resources ] of (item 0 if-im-in)) ) set my-power-ba (resources / (resources + [ resources ] of (item (k - 1) if-im-in)) ) ] if k > 2 and ind > 0 and ind != k [ set ab ((item (ind + 1) possible-rivals) - (item ind possible-rivals)) set ba 360 + ((item (ind - 1) possible-rivals) - (item ind possible-rivals)) set my-power-ab (resources / (resources + [ resources ] of (item (ind + 1) if-im-in)) ) set my-power-ba (resources / (resources + [ resources ] of (item (ind - 1) if-im-in)) ) ] let loss resources let gain abs(demand * ab * my-power-ab) + abs(demand * ba * my-power-ba) let v- (-2.25 * (loss ^ 0.88)) ;; parameters from CPT paper let v+ (gain ^ 0.88) report list (v+) (v-) ;; list with a positive and a negative value ] end to-report lambda-over-time report lambda end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:;; ;;; Developed by Ulisses Lacerda de Morais as part of ;;; ;;; a Master's Thesis work at the Faculty of Economics ;;; ;;; of the University of Coimbra, 2015. ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @#$#@#$#@ GRAPHICS-WINDOW 210 10 649 470 16 16 13.0 1 10 1 1 1 0 0 0 1 -16 16 -16 16 1 1 1 ticks 30.0 BUTTON 13 36 77 69 Setup setup NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 81 36 136 69 Run go T 1 T OBSERVER NIL NIL NIL NIL 0 SLIDER 13 73 185 106 incumbents incumbents 2 25 2 1 1 NIL HORIZONTAL SLIDER 13 109 185 142 newcomers newcomers 2 50 3 1 1 NIL HORIZONTAL SWITCH 14 266 160 299 without-market? without-market? 1 1 -1000 PLOT 663 10 1068 130 (A) Totals time number 0.0 10.0 0.0 10.0 true true "" "" PENS "Firms" 1.0 0 -15040220 true "" "plot count firms" "People" 1.0 0 -14730904 true "" "plot count people" "Investors" 1.0 0 -8053223 true "" "plot count investors" SLIDER 13 181 185 214 total-cost total-cost 0 0.99 0.5 0.01 1 NIL HORIZONTAL SWITCH 14 304 117 337 no-bias? no-bias? 1 1 -1000 BUTTON 140 36 203 69 Step go NIL 1 T OBSERVER NIL NIL NIL NIL 0 SLIDER 13 145 185 178 life-expectancy life-expectancy 12 180 36 6 1 NIL HORIZONTAL PLOT 664 134 824 254 (D) people's biases startup vs. invest people -3.0 4.0 0.0 10.0 true false "" "" PENS "people" 1.0 1 -13791810 true "" "histogram [bias] of people" PLOT 663 257 988 377 (G) economic environment and its mean time state 0.0 100.0 -3.0 3.0 true false "" "" PENS "lambda" 1.0 0 -12186836 true "" "plot lambda" "mean" 1.0 0 -3508570 true "" "plot mean lambda-history" PLOT 1074 10 1314 130 (B) HHI and its mean time index 0.0 10.0 0.0 10000.0 true false "" "" PENS "default" 1.0 0 -13360827 true "" "plot hhi" "pen-1" 1.0 0 -5204280 true "" "plot mean hhi-history" SLIDER 15 389 187 422 exogenous-exit exogenous-exit 0 0.01 0.0010 0.0005 1 NIL HORIZONTAL PLOT 829 134 989 254 (E) people's thresholds thresholds people 1.0 11.0 0.0 10.0 true false "" "" PENS "default" 1.0 1 -14070903 true "" "histogram [threshold] of people" SLIDER 15 350 187 383 exogenous-death exogenous-death 0 0.4 0.01 0.01 1 NIL HORIZONTAL SLIDER 13 220 185 253 interest interest 0.01 0.25 0.05 0.01 1 NIL HORIZONTAL PLOT 993 379 1153 499 (J) econ. % of +/- obs time obs % 10.0 20.0 0.0 1.0 true false "" "" PENS "+obs" 1.0 0 -13345367 true "ifelse ticks < 2 \n[ plot-pen-up ]\n[ plot-pen-down ]" "plot num+obs\nifelse ticks < 2 \n[ plot-pen-up ]\n[ plot-pen-down ]" "-obs" 1.0 0 -8053223 true "ifelse ticks < 2 \n[ plot-pen-up ]\n[ plot-pen-down ]" "plot num-obs\nifelse ticks < 2 \n[ plot-pen-up ]\n[ plot-pen-down ]" PLOT 663 380 987 500 (I) environmental parameter distribution values number -10.0 10.0 0.0 10.0 true false "set-histogram-num-bars length lambda-history" "if ticks > 2 [ set-plot-x-range min lambda-history max lambda-history ]\nset-histogram-num-bars length lambda-history" PENS "lambda" 1.0 1 -10022847 true "" "histogram lambda-history" PLOT 1157 379 1317 499 (K) firms' exit-rate time rate 0.0 10.0 0.0 0.1 true false "" "" PENS "exit-rate" 1.0 0 -10873583 true "" "plot prob-ruin" MONITOR 1008 84 1088 125 (C) mean (hhi) mean hhi-history 3 1 10 PLOT 993 134 1315 254 (F) v(gains) asked at random time ammount 0.0 10.0 0.0 10.0 true true "" "" PENS "Portfolio" 1.0 0 -5298144 true "" "if any? firms [ ask one-of people [ plot first v(0) / 1000] ]" "Startup" 1.0 0 -15040220 true "" "if any? firms [ ask one-of people [ plot first v(1) / 1000] ]" PLOT 993 256 1316 376 (H) w(success) asked at random time p 0.0 10.0 0.0 1.0 true true "" "" PENS "Portfolio" 1.0 0 -5298144 true "" "if any? firms [\nask one-of people [ \n let n int(((threshold + bias) / 20)*(count firms)) \n if n < 1 [ set n 1 ]\n let likely-portfolio-list sort max-n-of n firms [ market-share ]\n let likely-portfolio-agentset max-n-of n firms [ market-share ]\n \n foreach likely-portfolio-list [ ask ? [ ;; putting a risk measure in each item of the likely-portfolio\n ifelse [ debt ] of ? > 0 \n [ set risk-type \"bond\"\n set risk-measure prob-ruin ] \n [ set risk-type \"share\"\n set risk-measure mean [ reliability ] of likely-portfolio-agentset ] ] \n ] \n \n let p-success [(1 - risk-measure)] of max-n-of n firms [ reliability ] \n \n \n let w+ \n map [(? ^ 0.61) / (((? ^ 0.61) + ((1 - ?) ^ 0.61)) ^ (1 / 0.61))] p-success \n \n plot mean w+ ] ]" "Startup" 1.0 0 -15040220 true "" "if any? firms [ ask one-of people [ \n let p-success abs(num+obs - prob-ruin)\n if prob-ruin > num+obs [ set p-success 0 ] \n \n plot (p-success ^ 0.61) / (((p-success ^ 0.61) + ((1 - p-success) ^ 0.61)) ^ (1 / 0.61))]\n ]" @#$#@#$#@ ## WHAT IS IT? The Utility Load Model was designed to study the relationship amongst entrepreneurship and market structure of an economic sector. The model allows direct interaction between firms and people via New-Issues Market (NIM) and indirect interaction through an environmental parameter. The goal is to explain under what circumstances are the decisions of entrepreneurs conditioned by the existence of the NIM as an opportunity cost for starting a new firm and the consequences for the sector’s concentration. ## HOW IT WORKS People, firms and investors are organized around three concentric circumferences with radius 15, 12 and 8, respectively. The firms’ circumference is visible and coincides with their product space, where each firm's position corresponds to a variety of the product, a variation of Salop’s circular model (1979). The innermost circumference is the NIM, populated by the investors. On each period, entrepreneurs (people) in the outermost circumference must choose between entering the market by creating a new firm (a.k.a. start-up prospect), investing on firms by acquiring stocks and/or bonds (a.k.a. portfolio prospect), or doing neither and delaying their decision to the forthcoming period. The decision-making process of people in the Utility Load Model is based on a rather harmonious hybrid model of Prospect Theory (Kahneman & Tversky, 1979; 1992) and Random Walk model of perceptual decision-making (Smith & Ratcliff, 2004; Bogacz, 2007), where every person has an attribute named load, which the current value reflects how close from deciding one is. It’s assumed that people’s decision threshold is the amount of surplus evidence (or information) in favour of one alternative that one must gather (i.e. load variable must surpass) before deciding. People also own an attribute called bias which represents their personal inclination towards one of the prospects and it is simply defined as the initial value of load. At each time step (tick), every person in the model compares the subjective utility of the start-up prospect against the portfolio prospect and aggregates the result on the load attribute. If, at any point, load is greater than threshold or lower than its additive inverse, a decision is made to become an investor (red circle) or a firm (green factory), respectively. ## HOW TO USE IT Press SETUP to create agents and a visualization of their starting positions. Press RUN to make the model run continuously. Press STEP to have the model make one iteration. * SETUP button will create a number of firms (brown factories) equal the value in the «incumbents» slider, the analogous is true for people (businessmen) and the «newcomers» slider. * The «life-expectancy» slider defines people's longevity and by subtracting their respective age we get people's investment horizon. * The «total-cost» is the proportion of firm's resources and revenues that will be spent as cost on each period. * The «interest» slider defines the interest periodically paid for bonds. * The «without-market?» switch turns off the option of portfolio investment. * The «no-bias?» switch turns off the bias attribute setting it equal to zero for all people. * The «exogenous-death» slider will add a death rate for the population of people * The «exogenous-exit» slider assigns a probability per period of firms exiting the market. The interface contains ten plots whose initial values are determined at setup procedure and updated on every tick. Plots A, G and B display the progress over time of the quantity of agents from each breed, the environmental parameter and its mean, and the Herfindahl-Hirschman Index (HHI) and its mean, respectively. Additionally, C is a monitor that shows the current value of the HHI mean. Plot J displays the number of positive (and negative) observations of the environmental parameter, over time, as a percentage of the total number of observations. Plot K indicates the firms’ mortality rate for each period. Plots F and H display the subjective value of gains and the subjective probability of gain for each prospect, these values are requested from a random person at each time step and, as such, the value of the series in a particular period has little meaning, only the long-term trend of these charts are informative. Finally, Plots D, E and I present the histograms for the current distributions of people’s biases and thresholds attributes, and the environmental parameter values, respectively. ## THINGS TO TRY The following combinations of parameters’ values: no-bias? {on, off} vs. life-expectancy {36, 180} Another interesting test is to combine the above with variations of the without-market? switch. ## THINGS TO NOTICE When a firm gets to be the only one in the market and continuously supplies bonds for the entire industry’s NIM, it can be brought to bankruptcy due to financial debt. When three or more firms occupy the same address in the product space, if two of them start to grow concurrently, the other(s) is(are) pushed out of the market due to the shortage of local demand. Even in recessionary periods there is a rather constant rate of start-ups entering the market, and this rate grows with the length of the recession. A lengthier investment horizon attracts the vast majority of entrepreneurs to the NIM. The prior has a nefarious effect on the sector’s structure which is pushed towards a concentrated structure, reflected by higher HHI values. The relative impact on the HHI is even greater in scenarios with more incumbents and newcomers. ## ALTERNATIVE INTERPRETATION An alternative reading to the present model is a multi-brand duopoly, where the incumbent (brown firm) faces the threat of a potential rival (green firm) in the same product space. In this interpretation, the two firms not only compete for market-share through multiple varieties of a product, but also for equity and security investors (people). ## EXTENDING THE MODEL I anticipate several ways in which the Utility Load Model could be improved, to mention a few: turning life-expectancy into a dimension of heterogeneity; refining the heuristic used to compute the prospective gain with a start-up; allowing for fluctuations in the price of stocks and bonds; refining firms’ behaviour regarding the issuing of securities; including non-linear cost function; adding government to the mix; and so on. ## CREDITS AND REFERENCES * Bogacz, R. (2007). Optimal decision-making theories: linking neurobiology with behaviour. Trends in Cognitive Sciences, 11 (3), pp. 118-125. * Kahneman, D., & Tversky, A. (1979, March). Prospect Theory: An Analysis of Decision under Risk. Econometrica, 47 (2), pp. 263-291. * Kahneman, D., & Tversky, A. (1992). Advances in Prospect Theory: Cumulative Representation of Uncertainty. Journal of Risk and Uncertainty, 5, pp. 297-323. * Salop, S. C. (1979). Monopolistic Competition with Outside Goods. The Bell Journal of Economics, 10 (1), pp. 141-156. * Smith, P. L., & Ratcliff, R. (2004). Psychology and neurobiology of simple decisions. Trends in neurosciences, 27 (3), pp. 161-168. ## HOW TO CITE Morais, U. L. (2015) New-Issues Markets as Behavioural Barriers to Entry: An Agent-Based Model of Choices and Market Structure. Master’s Thesis in Economics. University of Coimbra. ## COPYRIGHT AND LICENSE Copyright 2015 Ulisses Lacerda de Morais ![CC BY-NC-SA 4.0](http://ccl.northwestern.edu/images/creativecommons/byncsa.png) This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/. Developed as part of Master's thesis in Economics, in the specialty of Industrial Economics, presented to the Faculty of Economics of the University of Coimbra for the obtainment of the degree of Master. For further information on this work, please contact the Faculty: http://www.uc.pt/feuc @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 airplane true 0 Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box false 0 Polygon -7500403 true true 150 285 285 225 285 75 150 135 Polygon -7500403 true true 150 135 15 75 150 15 285 75 Polygon -7500403 true true 15 75 15 225 150 285 150 135 Line -16777216 false 150 285 150 135 Line -16777216 false 150 135 15 75 Line -16777216 false 150 135 285 75 bug true 0 Circle -7500403 true true 96 182 108 Circle -7500403 true true 110 127 80 Circle -7500403 true true 110 75 80 Line -7500403 true 150 100 80 30 Line -7500403 true 150 100 220 30 butterfly true 0 Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 Circle -16777216 true false 135 90 30 Line -16777216 false 150 105 195 60 Line -16777216 false 150 105 105 60 car false 0 Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 Circle -16777216 true false 180 180 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 Circle -7500403 true true 47 195 58 Circle -7500403 true true 195 195 58 circle false 0 Circle -7500403 true true 0 0 300 circle 2 false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 cow false 0 Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 Polygon -7500403 true true 73 210 86 251 62 249 48 208 Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 cylinder false 0 Circle -7500403 true true 0 0 300 dot false 0 Circle -7500403 true true 90 90 120 face happy false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 face neutral false 0 Circle -7500403 true true 8 7 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Rectangle -16777216 true false 60 195 240 225 face sad false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 factory false 0 Rectangle -7500403 true true 76 194 285 270 Rectangle -7500403 true true 36 95 59 231 Rectangle -16777216 true false 90 210 270 240 Line -7500403 true 90 195 90 255 Line -7500403 true 120 195 120 255 Line -7500403 true 150 195 150 240 Line -7500403 true 180 195 180 255 Line -7500403 true 210 210 210 240 Line -7500403 true 240 210 240 240 Line -7500403 true 90 225 270 225 Circle -1 true false 37 73 32 Circle -1 true false 55 38 54 Circle -1 true false 96 21 42 Circle -1 true false 105 40 32 Circle -1 true false 129 19 42 Rectangle -7500403 true true 14 228 78 270 fish false 0 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 Circle -16777216 true false 215 106 30 flag false 0 Rectangle -7500403 true true 60 15 75 300 Polygon -7500403 true true 90 150 270 90 90 30 Line -7500403 true 75 135 90 135 Line -7500403 true 75 45 90 45 flower false 0 Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 Circle -7500403 true true 85 132 38 Circle -7500403 true true 130 147 38 Circle -7500403 true true 192 85 38 Circle -7500403 true true 85 40 38 Circle -7500403 true true 177 40 38 Circle -7500403 true true 177 132 38 Circle -7500403 true true 70 85 38 Circle -7500403 true true 130 25 38 Circle -7500403 true true 96 51 108 Circle -16777216 true false 113 68 74 Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 house false 0 Rectangle -7500403 true true 45 120 255 285 Rectangle -16777216 true false 120 210 180 285 Polygon -7500403 true true 15 120 150 15 285 120 Line -16777216 false 30 120 270 120 leaf false 0 Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 line true 0 Line -7500403 true 150 0 150 300 line half true 0 Line -7500403 true 150 0 150 150 pentagon false 0 Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 person false 0 Circle -7500403 true true 110 5 80 Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 Rectangle -7500403 true true 127 79 172 94 Polygon -7500403 true true 195 90 240 150 225 180 165 105 Polygon -7500403 true true 105 90 60 150 75 180 135 105 person business false 0 Rectangle -1 true false 120 90 180 180 Polygon -13345367 true false 135 90 150 105 135 180 150 195 165 180 150 105 165 90 Polygon -7500403 true true 120 90 105 90 60 195 90 210 116 154 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 183 153 210 210 240 195 195 90 180 90 150 165 Circle -7500403 true true 110 5 80 Rectangle -7500403 true true 127 76 172 91 Line -16777216 false 172 90 161 94 Line -16777216 false 128 90 139 94 Polygon -13345367 true false 195 225 195 300 270 270 270 195 Rectangle -13791810 true false 180 225 195 300 Polygon -14835848 true false 180 226 195 226 270 196 255 196 Polygon -13345367 true false 209 202 209 216 244 202 243 188 Line -16777216 false 180 90 150 165 Line -16777216 false 120 90 150 165 plant false 0 Rectangle -7500403 true true 135 90 165 300 Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 sheep false 15 Circle -1 true true 203 65 88 Circle -1 true true 70 65 162 Circle -1 true true 150 105 120 Polygon -7500403 true false 218 120 240 165 255 165 278 120 Circle -7500403 true false 214 72 67 Rectangle -1 true true 164 223 179 298 Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 Circle -1 true true 3 83 150 Rectangle -1 true true 65 221 80 296 Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 Polygon -7500403 true false 276 85 285 105 302 99 294 83 Polygon -7500403 true false 219 85 210 105 193 99 201 83 square false 0 Rectangle -7500403 true true 30 30 270 270 square 2 false 0 Rectangle -7500403 true true 30 30 270 270 Rectangle -16777216 true false 60 60 240 240 star false 0 Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 target false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 Circle -7500403 true true 60 60 180 Circle -16777216 true false 90 90 120 Circle -7500403 true true 120 120 60 tree false 0 Circle -7500403 true true 118 3 94 Rectangle -6459832 true false 120 195 180 300 Circle -7500403 true true 65 21 108 Circle -7500403 true true 116 41 127 Circle -7500403 true true 45 90 120 Circle -7500403 true true 104 74 152 triangle false 0 Polygon -7500403 true true 150 30 15 255 285 255 triangle 2 false 0 Polygon -7500403 true true 150 30 15 255 285 255 Polygon -16777216 true false 151 99 225 223 75 224 truck false 0 Rectangle -7500403 true true 4 45 195 187 Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 Rectangle -1 true false 195 60 195 105 Polygon -16777216 true false 238 112 252 141 219 141 218 112 Circle -16777216 true false 234 174 42 Rectangle -7500403 true true 181 185 214 194 Circle -16777216 true false 144 174 42 Circle -16777216 true false 24 174 42 Circle -7500403 false true 24 174 42 Circle -7500403 false true 144 174 42 Circle -7500403 false true 234 174 42 turtle true 0 Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 wheel false 0 Circle -7500403 true true 3 3 294 Circle -16777216 true false 30 30 240 Line -7500403 true 150 285 150 15 Line -7500403 true 15 150 285 150 Circle -7500403 true true 120 120 60 Line -7500403 true 216 40 79 269 Line -7500403 true 40 84 269 221 Line -7500403 true 40 216 269 79 Line -7500403 true 84 40 221 269 wolf false 0 Polygon -16777216 true false 253 133 245 131 245 133 Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 x false 0 Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ NetLogo 5.2.0 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 new 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 15 Line -7500403 false 150 150 90 180 Line -7500403 false 150 150 210 180 @#$#@#$#@ 0 @#$#@#$#@