QuantumPrisonersDilemmaModel.QPDM
— TypeQPDM{T<:Real} <: AbstractQPDM
A model object for the Quantum Prisoner's Dilemma Model. The QPDM has four basis states:
- opponent defects and you defect
- opponent defects and you cooperate
- opponent cooperates and you defect
- opponent cooperates and you cooperate
The bases are orthonormal and in standard form. The model assumes three conditions:
- Player 2 is told that player 1 defected
- Player 2 is told that player 1 cooperated
- Player 2 is not informed of the action of player 1
Model inputs and outputs are assumed to be in the order above.
Fields
μd
: utility for defectingμc
: utility for cooperatingγ
: entanglement parameter for beliefs and actions
Example
using QuantumPrisonersDilemmaModel
model = QPDM(;μd=.51, γ=2.09)
References
Pothos, E. M., & Busemeyer, J. R. (2009). A quantum probability explanation for violations of ‘rational’decision theory. Proceedings of the Royal Society B: Biological Sciences, 276(1665), 2171-2178.
Base.rand
— Methodrand(dist::AbstractQPDM, n::Int; t = π / 2)
Generates simulated data for the following conditions:
- Player 2 is told that player 1 defected
- Player 2 is told that player 1 cooperated
- Player 2 is not informed of player 1's action
Arguments
dist::AbstractQPDM
n
: the number of trials per condition
Keywords
t = π / 2
: time of decision
Example
using QuantumPrisonersDilemmaModel
model = QPDM(;μd=.51, γ=2.09)
data = rand(model, 100)
Distributions.logpdf
— Methodlogpdf(dist::AbstractQPDM, n::Int, n_d::Vector{Int}; t = π / 2)
Returns the joint log density given data for the following conditions:
- Player 2 is told that player 1 defected
- Player 2 is told that player 1 cooperated
- Player 2 is not informed of player 1's action
Arguments
dist::AbstractQPDM
n
: the number of trials per conditionn_d
: the number of defections in each condition
Keywords
t = π / 2
: time of decision
Example
using QuantumPrisonersDilemmaModel
model = QPDM(;μd=.51, γ=2.09)
n_trials = 100
data = rand(model, n_trials)
logpdf(model, n_trials, data)
Distributions.pdf
— Methodpdf(dist::AbstractQPDM, n::Int, n_d::Vector{Int}; t = π / 2)
Returns the joint probability density given data for the following conditions:
- Player 2 is told that player 1 defected
- Player 2 is told that player 1 cooperated
- Player 2 is not informed of player 1's action
Arguments
dist::AbstractQPDM
n
: the number of trials per conditionn_d
: the number of defections in each condition
Keywords
t = π / 2
: time of decision
QuantumPrisonersDilemmaModel.predict
— Methodpredict(dist::AbstractQPDM; t = π / 2)
Returns predicted response probability for the following conditions:
- Player 2 is told that player 1 defected
- Player 2 is told that player 1 cooperated
- Player 2 is not informed of player 1's action
Arguments
dist::AbstractQPDM
Keywords
t = π / 2
: time of decision
Example
using QuantumPrisonersDilemmaModel
model = QPDM(;μd=.51, γ=2.09)
predict(model)