Errors while trying to write joint likelihood of a normal_lpdf and a bernoulli_lpmf in Stan

Dear Stan experts, please have a look at my problem. Thanks in advance!

I don’t understand your particular model, but shouldn’t you be adding, not multiplying, the _lpmf and _lpdf to get a joint likelihood? The L in _lp*f means it’s calculated on the log scale, which is why you’re adding (+=) the priors to the target.

1 Like

Thank you very much Sir @lcomm! That did it! Thanks a lot!
Also, how believable/acceptable does the Bayes’ Factor (Null over alternative) of 127568 sounds?

Thanks!

Not a sir, but I appreciate the knighting.

I don’t use Bayes factors on a regular basis, but that sounds extreme. You either have a lot of evidence for choosing one model over the other or there is something wrong in your calculations. I would look into it more if I were you.

Also, I just noticed you are doing a lot of MCMC iterations. If you need that many for convergence, something very bad is happening. I would ask for help in a new thread before tinkering around with adapt_delta and max_treedepth. There is probably a better way to improve your sampling.

1 Like

@lcomm sorry for the confusion with Sir/Ma’am.

I am cross checking everything. I reduced adapt_delta to 0.8, the default and the max_treedepth to 10 which is again the default. The result however seems unchanged. Anyway, I am looking into it now. Thanks for your help!

Time for a linguistics digression.

When you call someone “Sir X”, it means they’re a knight in the UK. For instance, Paul McCartney is now “Sir Paul” after being knighted.

Without a name, “sir” and “madam” are just generic respectful placeholders. It saves you from having to say, “hey, you.” For example, I might say, “Excuse me, sir, do you know the way to Picadilly Circus?”.

1 Like

@Bob_Carpenter Thank you for the info. Always good to know something new.

Time for a The Beatles digression. :D
I heard Ringo Starr is a Sir now. I have always thought him to be a much overrated drummer! :P

Thank you ALL for your time and help. :)