Learn R Programming

rorutadis (version 0.4.2)

calculateStochasticResults: Stochastic results

Description

The function calculates stochastic results for alternative assignments, assignment-based preference relation and class cardinalities. The results are computed by sampling the space of compatible models.

Usage

calculateStochasticResults(problem, nrSamples = 100)

Arguments

problem
A problem to consider.
nrSamples
Number of samples. Use more for better quality of results.

Value

List with the following named elements:
  • assignments - n x p matrix, where n is the number of alternatives and p is number of classes; each element [i, j] contains the rate of samples, for which alternative a_i was assigned to class C_j. The exact result can be calculated with function calculateAssignments.
  • preferenceRelation - n x n matrix, where n is the number of alternatives; each element [i, j] contains the rate of samples, for which alternative a_i was assigned to class at least as good as class of a_j. The exact result can be calculated with function compareAssignments.
  • classCardinalities - p x (n + 1) matrix, where n is the number of alternatives and p is number of classes; each element [i, j] contains the rate of samples, for which j-1 alternatives were assigned to class C_i. Note! first column corresponds to 0 elements. The exact result can be calculated with function calculateExtremeClassCardinalities.

See Also

buildProblem calculateAssignments compareAssignments calculateExtremeClassCardinalities

Examples

Run this code
perf <- matrix(c(2,1,1,2), 2)
problem <- buildProblem(perf, 2, FALSE, c('g', 'g'), c(0, 0))

calculateStochasticResults(problem, 1000)

Run the code above in your browser using DataLab