Sim.Weights: Simulation of weights

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Simulate.Weights.R

Description

Simulation of weights employing the Dirichlet distribution. The concentration parameters for the Dirichlet distribution are tentative weights.

Usage

1
Sim.Weights(n, utilities, alpha)

Arguments

n

number of simulations

utilities

utility dataframe, first column is the identifier

alpha

concentration parameter for the Dirichlet distribution

Details

Taking advantage of the Dirichlet distribution properties, the weights could be simulated with a concentration around given weights.

Value

List with data.frames {simulation, weights} with total utilities and simulated weights

Author(s)

Pedro Guarderas pedro.felipe.guarderas@gmail.com

See Also

Eval.Utilities

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library( data.table )
N<-10
utilities<-data.table( id = 1:N, 
                       u1 = runif( N, 0, 1 ), 
                       u2 = runif( N, 0, 1 ), 
                       u3 = runif( N, 0, 1 ),
                       u4 = runif( N, 0, 1 ) )
n<-100
alpha<-c( 0.2, 0.5, 0.1, 0.2 )
S<-Sim.Weights( n, utilities, alpha )

Example output



mau documentation built on May 1, 2019, 8:23 p.m.