I’m using the rethinking package in R to make a simple linear model. In the folowing code I use a prior normal distribution for the dependent variable and everything works good.
library(rethinking)
col <- alist(
courework_n ~ dnorm(mean,0.2),
mean <- a + b*result_n + c,
a ~ dnorm(0,10),
b ~ dnorm(0,10),
c ~ dnorm(0,10)
)
colmap <- map( col , data.frame(data) )
But when I use a package for triangular distribution which is not supported directly by R, I get the following error
Error in map(col, data.frame(data)) : unused argument (log = TRUE)
This is the code for defining the model with the triangle distribution
install.packages("RTriangle")
library(triangle)
col <- alist(
courework_n ~ dtriangle(0,1,mode),
moda <- a + b*result_n + c,
a ~ dnorm(0,10),
b ~ dnorm(0,10),
c ~ dnorm(0,10)
)
col_map <- map( col , data.frame(data) )