| mosg.equilibrium | R Documentation |
mgss.
The generic functions print and summary provide brief, and detailed information about the lexicographic Nash equilibrium. The generic function plot can be used to visualize the equilibrium.
## S3 method for class 'mosg.equilibrium' summary(object, ...) ## S3 method for class 'mosg.equilibrium.summary' print(x, ...) ## S3 method for class 'mosg.equilibrium' print(x, extended=FALSE, ...) ## S3 method for class 'mosg.equilibrium' plot(x, points=100, ...)
x |
an |
object |
an |
for print.mosg.equilibrium, the following parameter can be supplied:
extended |
if set to |
for plot.mosg.equilibrium, the following parameter can be supplied:
points |
the number of points to evaluate the density function over its support for plotting |
... |
further arguments passed to or from other methods. |
the result returned by the function summary carries the following fields:
optimalDefense |
a discrete probability distribution over the action space for player 1 (the defender). |
optimalAttacks |
a discrete probability distribution over the action space for player 2 (the attacker). |
assurances |
an optimal loss distribution valid under the assumption that the defender plays |
The action spaces for both players are defined in first place by the game for which the equilibrium was computed (via mgss on a game constructed by mosg).
print gives a shortened output restricted only to displaying the optimal defense for the defender and attack strategies per goal (as defined by the underlying game).
summary returns an object of class summary.mosg.lossdistribution, which has the fields:
"range" "mean" "variance" "quantiles" "is.discrete"
range |
the minimal and maximal values of the loss (as anticipated by the observations) |
mean |
the first moment as computed by |
variance |
the variance as computed by |
quantiles |
a 2x5-matrix of quantiles at the 10%,25%,50%,75% and 90% level |
is.discrete |
a Boolean flag being |
plot displays a grid of plots, starting with the optimal defense behavior plotted as a discrete distribution on top of a (m x 2)-matrix of plots. Each line in this grid shows the discrete optimal attack strategy on the right side (as a bar plot), paired with the loss distribution (extracted from x) caused when the defender plays optimalDefense and the attacker plays the respective optimal attack strategy.
Stefan Rass
print.mosg.equilibrium, mgss, mosg, lossDistribution
## raw data (PURELY ARTIFICIAL, for demo purposes only)
# N=100 observations in each category
obs111<-c(rep(1,40),rep(3,20),rep(5,10),rep(7,20),rep(9,10));
obs112<-c(rep(1,50),rep(2,10),rep(4,10),rep(6,20),rep(8,10));
obs121<-c(rep(1,20),rep(4,30),rep(6,20),rep(8,10),rep(10,20));
obs122<-c(rep(1,40),rep(2.5,20),rep(5,20),rep(7.5,10),rep(9,10));
obs211<-c(rep(1,30),rep(2,30),rep(5,10),rep(8,10),rep(10,20));
obs212<-c(rep(1,10),rep(2,10),rep(4,20),rep(7,20),rep(10,40));
obs221<-c(rep(1,30),rep(3,30),rep(4,10),rep(7,20),rep(9,10));
obs222<-c(rep(1,10),rep(3,10),rep(5,50),rep(8,20),rep(10,10));
obs311<-c(rep(1,40),rep(2,30),rep(4,10),rep(7,10),rep(9,10));
obs312<-c(rep(1,20),rep(3,20),rep(4,20),rep(7,20),rep(10,20));
obs321<-c(rep(1,10),rep(3,40),rep(4,30),rep(7,10),rep(9,10));
obs322<-c(rep(1,10),rep(4,30),rep(5,30),rep(7,10),rep(10,20));
## compute payoff densities
f111<-lossDistribution(obs111)
f112<-lossDistribution(obs112)
f121<-lossDistribution(obs121)
f122<-lossDistribution(obs122)
f211<-lossDistribution(obs211)
f212<-lossDistribution(obs212)
f221<-lossDistribution(obs221)
f222<-lossDistribution(obs222)
f311<-lossDistribution(obs311)
f312<-lossDistribution(obs312)
f321<-lossDistribution(obs321)
f322<-lossDistribution(obs322)
payoffs<-list(f111,f112,f121, f122,f211,f212,f221,f222, f311,f312,f321,f322)
G <- mosg( n=2,
m=2,
payoffs,
goals=3,
goalDescriptions=c("g1", "g2", "g3"),
defensesDescr = c("d1", "d2"),
attacksDescr = c("a1", "a2"))
eq <- mgss(G,weights=c(0.25,0.5,0.25))
print(eq)
summary(eq)
plot(eq)
# access the loss distributions computed in the game
summary(eq$assurances$g1)
mean(eq$assurance$g1) # get the average loss in goal "g1"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.