Description Usage Arguments Value Author(s) Examples
Function implementing the Luce choice rule.
1 | luceChoice(value, all)
|
value |
A positive value specifying a weight or activation (or comparable measure) of the choice option for which the choice probability is calculated |
all |
A positive array of the weights or activations of all possible
choice options, including |
A value between [0,1]
Dorothee Hoppe
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | # load example data:
data(dat)
# add obligatory columns Cues, Outcomes, and Frequency:
dat$Cues <- paste("BG", dat$Shape, dat$Color, sep="_")
dat$Outcomes <- dat$Category
dat$Frequency <- dat$Frequency1
head(dat)
dim(dat)
# now use createTrainingData to sample from the specified frequencies:
train <- createTrainingData(dat)
# this training data can actually be used train network:
wm <- RWlearning(train)
# caculate activations of outcomes given the cue set blue_car
red_rabbit <- getActivations(getWM(wm), cueset = "red_rabbit")$red_rabbit
# caculate choice probability of outcomes given the cue set blue_car after
# normalizing with rectified linear unit
luceChoice(red_rabbit["vehicle"], red_rabbit)
luceChoice(red_rabbit["plant"], red_rabbit)
luceChoice(red_rabbit["animal"], red_rabbit)
# note that when some activations are negative, this rule either should not be
# applied, or negative values have to be corrected for, e.g., with applying a
# rectified linear unit (relu)
blue_car <- getActivations(getWM(wm), cueset = "blue_car")$blue_car
## Not run:
# this is should not be done without correction
luceChoice(blue_car["vehicle"], blue_car)
# use, e.g., function relu() on the raw values
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.