I am trying to fit a GAMLSS model with the response variable, y>0 with age and gender as independent variables. Since I need to model all 4 parameters of the distribution, I used BCPE as the family. The call is showing the error: Error in dBCPE(y, mu, sigma, nu, tau, log = TRUE) : mu must be positive
Please help
Since all values are positive, I am not able to identify the reason behind the error. Additionally, it is automatically running the code with GB2 family
The code is:
gamdata<-read.csv(file.choose(), header=T)
install.packages("gamlss")
library(gamlss)
age<-gamdata$age
gender<-gamdata$gender
A<-gamdata$A
m1<-gamlss(A~cs(age+gender, df=5),mu.formula=~cs(age+gender,df=5), sigma.formula=~cs(age+gender,df=5), nu.formula=~cs(age+gender,df=5), tau.formula=~cs(age+gender,df=5), family=gamlss.family(BCPE(mu.link="identity", sigma.link="log", nu.link="identity", tau.link="log")))
summary(m1)
The issued error is: Error in dBCPE(y, mu, sigma, nu, tau, log = TRUE) : mu must be positive