est.shcoa {ShapDoE}R Documentation

Estimating the Shapley value based on component orthogonal array (COA) with a prime power d

Description

Estimating the Shapley value based on component orthogonal array (COA) with a prime power d

Usage

est.shcoa(d, n, val, p, f_d, ...)

Arguments

d

a power of prime p, the number of players.

n

an integer, the sample size.

val

the predefined value function.

p

a prime, the bottom number of d.

f_d

a vector represents the coefficients of primative polynomial on GF(d). For example the primative polynomial on GF(3^2) is x^2+x+2, then let f_d=c(1,1,2).

...

other parameters used in val(sets,...).

Value

a vector including estimated Shapley values of all players based on COA.

Examples

temp_adjacent<-matrix(0,nrow=8,ncol=8)
temp_adjacent[1,6:8]<-1;temp_adjacent[2,7]<-1;temp_adjacent[c(4,6,7),8]<-1;
temp_adjacent<-temp_adjacent+t(temp_adjacent)
temp_val<-function(sets,adjacent){
  if(length(sets)==1) val<-0
  else{
    subadjacent<-adjacent[sets,sets]
    nsets<-length(sets)
    A<-diag(1,nsets); B<-matrix(0,nsets,nsets)
    for(l in 1:(nsets-1)){
      A<-A%*%subadjacent
      B<-B+A
    }
    val<-ifelse(sum(B==0)>nsets,0,1)
  }
  return(val)
}
est.shcoa(8,112,temp_val,2,c(1,0,1,1),temp_adjacent)

[Package ShapDoE version 1.0.0 Index]