search for: vutil1

Displaying 1 result from an estimated 1 matches for "vutil1".

Did you mean: util1
2007 Jun 19
1
Error handling
...ould complete the for loop even though there are errors). Of course this is just an example, in the simulation study the error comes up quite rarely but still it is annoying to handle it manually each time. Many thanks Peter The example: ------------ logfunc <- function (params) { vutil1 <- as.matrix(x2[,1:3]) %*% params vutil2 <- as.matrix(x2[,4:6]) %*% params logl <- 0 for (i in 1:6) { prob <- log((exp(vutil1[i])*achoices[i,1]+exp(vutil2[i])*achoices[i,2])/(exp(vutil1[i])+exp(vutil2[i]))) logl <- logl + prob } return (-logl) } x2 <- array(c(0,4,...