@@ -32,7 +32,6 @@ to setup [rs]
32
32
; alpha + beta): the first (second) entry is the denominator for
33
33
; theory 1 (2).
34
34
set b (list (a1 + b1) (a2 + b2))
35
- set current-theory-info [0 0 ]
36
35
; calculate the prior (i.e. mean of the beta distribution) from the random
37
36
; alphas / betas.
38
37
calc-posterior
@@ -335,85 +334,6 @@ to set-researcher-colors
335
334
set color turquoise
336
335
]
337
336
end
338
-
339
-
340
-
341
-
342
-
343
- ; Calculates how confident the researcher is in the fact that her current best
344
- ; theory is actually the best theory (i.e. how unlikely it is that she will
345
- ; change her mind). This calculation only makes sense in case researchers have
346
- ; converged.
347
- to calc-confidence
348
- if converged-ticks = 0 [
349
- set g-depressed-confidence false
350
- ]
351
- if g-depressed-confidence [stop]
352
- let stop? false
353
- ask turtles [
354
- if stop? [stop]
355
- let belief-to-beat item ((mytheory + 1 ) mod 2 ) current-theory-info
356
- * strategy-threshold
357
- let cur-theory mytheory
358
- if converged-ticks = 0 [
359
- set avg-neighbor-signal mean [item cur-theory subj-th-i-signal] of
360
- (turtle-set link-neighbors self)
361
- ]
362
- ; if the scientist would be given sufficient time for her belief to
363
- ; converge to the average signal of her and her link-neighbors, would
364
- ; this be enough for her to abandon her current theory? If so, she's not
365
- ; confident enough.
366
- if avg-neighbor-signal <= belief-to-beat [
367
- set confidence 0
368
- set stop? true
369
- set g-depressed-confidence true
370
- stop
371
- ]
372
- ; the following calculations are based on probability maximization of the
373
- ; normal-distribution. This is separately documented at [placeholder].
374
- let alpha item mytheory a
375
- let varepsilon avg-neighbor-signal - belief-to-beat
376
- let delta item mytheory current-theory-info - belief-to-beat
377
- if (2 * alpha - 1 ) * delta <= belief-to-beat [
378
- set confidence 0
379
- set stop? true
380
- stop
381
- ]
382
- let exit-probability 0.5 + 0.5 * erf (
383
- ((0 - 2 * alpha + 1 ) * delta + belief-to-beat)
384
- / (sqrt((0 - 2 * alpha * delta + delta + belief-to-beat)
385
- * (belief-to-beat + varepsilon) * (0 - 1 + belief-to-beat + varepsilon)
386
- / (varepsilon * (belief-to-beat + delta)))
387
- * (belief-to-beat + delta)))
388
- ifelse exit-probability > 0 [
389
- set confidence 1 - exit-probability
390
- ][
391
- set confidence 1
392
- ]
393
- ]
394
- ifelse stop? [
395
- set g-confidence 0
396
- ][
397
- set g-confidence reduce * [confidence] of turtles
398
- ]
399
- end
400
-
401
-
402
-
403
-
404
-
405
- ; reports a numerical approximation for the error-function function on its
406
- ; negative domain, therefore the argument (x) must be smaller than 0. For
407
- ; sources see infotab.
408
- to-report erf [x]
409
- let t (1 - .5 * x)
410
- report exp ( 0 - x ^ 2 - 1.26551223 + 1.00002368 / t
411
- + .37409196 / t ^ 2 + 0.09678418 / t ^ 3
412
- - .18628806 / t ^ 4 + .27886807 / t ^ 5
413
- - 1.13520398 / t ^ 6 + 1.48851587 / t ^ 7
414
- - .82215223 / t ^ 8 + .17087277 / t ^ 9 )
415
- / t - 1
416
- end
417
337
@#$#@#$#@
418
338
GRAPHICS-WINDOW
419
339
210
0 commit comments