library(brms) ######shape=1 and scale = 4 w<-rweibull(n=300, shape = 1, scale = 4) w<-data.frame(w) m<-brm(w~1,data=w,family=weibull()) m s1 <- posterior_samples(m) #recover scale and shape parameters #scale mean(exp(s1$b_Intercept)) #shape mean(s1$shape) ###predict mean summary(w) f<-fitted(m) summary(f) #this way? mean(exp(s1$b_Intercept * (gamma(1 + 1/exp(s1$shape))))) #or this? mean(exp(s1$b_Intercept * (gamma(1 + 1/(s1$shape))))) #or this? mean(exp(s1$b_Intercept) * (gamma(1 + 1/(s1$shape)))) ######shape=10 and scale = 15 w<-rweibull(n=300, shape = 10, scale = 15) w<-data.frame(w) m<-brm(w~1,data=w,family=weibull()) m s1 <- posterior_samples(m) #recover scale and shape parameters #scale mean(exp(s1$b_Intercept)) #shape mean(s1$shape) ###predict mean summary(w) f<-fitted(m) summary(f) #this way? mean(exp(s1$b_Intercept * (gamma(1 + 1/exp(s1$shape))))) #or this? mean(exp(s1$b_Intercept * (gamma(1 + 1/(s1$shape))))) #or this? mean(exp(s1$b_Intercept) * (gamma(1 + 1/(s1$shape))))