Dear stan community. I am providing brms with a custom, power law pmf and I’d like to know whether I missed some obvious ways to speed computations up, as fitting it is very time consuming at the moment. Every kind of advice is appreciated a lot!
real power_lpmf(int y, real mu) {
vector[200] support;
for(i in 1:200){
support[i] = 1/(i^mu);
}
return log( (1/(y^mu))/sum(support) );
}
Here’s the power law distribution. N = 200 is fine for my purposes, but later on I’d potentially want to increase it to ~ 1000
f(y;\mu,N)={\frac {1/y^{\mu}}{\sum \limits _{i=1}^{N}(1/i^{\mu})}}.