library(rethinking)
G <- c("D","ND")
Purple <- c(670, 601)
Pink <- c(315,604)
Total <- c(985, 1205)
GID <- c(1,2)
Data <- data.frame(G, Purple, Pink, Total, GID)
model_1a <- quap(
alist(
Purple ~ dbinom(Total,p) ,
Total <- Total[ID] ,
p <- a[ID] ,
a[ID] ~ dbeta(10,10)
) , data = Data)
precis(model_1a, depth=2)
When I run this problem it throws me the error:
# Error in quap(alist(Purple ~ dbinom(Total, p), Total <- Total[ID], p <- a[ID], : non-finite value supplied by optim".
Even though I have the same thing as my professor did in one of his lectures, his model runs, mine does not.
I am just trying to get done my lab assignment following the help video my professor posted, and I am running into this issue.
It takes a long time to assemble all the dependencies but after running the code and looking at the arguments inside the
quapcall, I noticed there was no definition forIDand wondered if it might be a triple typo (ID->GID):