Learn R Programming

ror (version 1.2)

rorsmaa: Robust Ordinal Regression SMAA sampler

Description

Implements stochastic simulation of the indices used in a SMAA-type decision analysis with UTA^GMS models. The current version assumes ascending preferences, i.e. higher criterion evaluation means higher preferability (=better).

Usage

rorsmaa(performances, preferences)

Arguments

performances
m x n performance matrix with m alternatives and n criteria
preferences
k x 2 matrix of preferences statements (row indices of alternatives in performance matrix). Each row r is a preference statements meaning that preferences[k,1] is weakly preferred to preferences[k,2]

See Also

utagms,ror-package

Examples

Run this code
library(ror)

## Function needed to generate pareto-optimal alternatives
randomPointFromHypersphere <- function(ncrit) {
  rns <- c()
  while(TRUE) {
    rns <- rnorm(ncrit)
    if (all(rns > 0)) {
      break
    }
  }
  mul <- 1 / sqrt(sum(rns * rns))
  return(rns * mul)
}

performances <- t(replicate(10, randomPointFromHypersphere(5)))  # 10 alts, 5 crit
preferences <- matrix(c(1, 2, 4, 5, 7, 8, 1, 3), ncol=2, byrow=TRUE)

## RORSMAA gives the POIs and RAIs
ror <- rorsmaa(performances, preferences)
print(ror$poi)
print(ror$rai)
cat(ror$misses, "misses while generating 10k value functions\n")

## Not run: 
# ## Plot the results
# plot(ror$rai)
# plot(ror$poi)
# ## End(Not run)

Run the code above in your browser using DataLab