Note
Go to the end to download the full example code.
Does asking about trust change trust?#
Human-computer interaction: does asking about trust change trust?
An automated assistant succeeds or fails over six interactions; the user is asked ‘Do you trust it?’ either only at the end or also halfway. Markov dynamics predict no effect of the halfway question; open-system dynamics predict one. Data are simulated.
import numpy as np
from quantum_mind.core import compare
from quantum_mind.families.dynamics import MarkovBelief, OpenSystemBelief, question_effect
Events and query designs#
Six interactions (1 success, 0 failure). Trust is asked at the end only, or also halfway.
events = (1, 1, 0, 1, 0, 1)
design = {'end_only': (events, (5,)), 'also_halfway': (events, (2, 5))}
os_true = OpenSystemBelief(phi0=1.6, a_pos=0.8, a_neg=1.2, gamma=0.3)
print('Question effect, open-system: %.3f; Markov: %.3f' % (question_effect(os_true, events, 5, 2),
question_effect(MarkovBelief(p0=0.5, up=0.3, down=0.3), events, 5, 2)))
Question effect, open-system: -0.076; Markov: -0.000
Can the models be told apart?#
Data simulated from the open-system model are fitted by both models at two sample sizes.
for n in (100, 1600):
data = os_true.sample(design, n, np.random.default_rng(n))
res = compare([OpenSystemBelief, MarkovBelief], data, design, restarts=6)
print('n = %4d per condition: selected %s (BIC %s)' % (n, type(res[0].model).__name__, [round(r.bic, 1) for r in res]))
n = 100 per condition: selected MarkovBelief (BIC [np.float64(324.6), np.float64(330.2)])
n = 1600 per condition: selected OpenSystemBelief (BIC [np.float64(5042.3), np.float64(5067.4)])
Total running time of the script: (0 minutes 3.159 seconds)