Shifted lognormal stan conversion and mean function

Why does the shifted_lognormal() family make stan code such as

 target += lognormal_lpdf(Y - ndt | mu, sigma);

How does this subtraction by the shift parameter accomplish shifting the distirbution to the right horizontally?

Further, I am confused about the syntax of response ~ predictors here. Do the predictors here represent the inputs to the mean function or the inputs to the function for the first parameter?

For example, in the following code:

fit3 <- brm(reaction_time  ~ 1 + bigram+ trial_num +  (1 + bigram | participant_id) ,
           data = experiment_df , 
           family = shifted_lognormal(),
           prior = c(set_prior("normal(6,0.2)",class = "Intercept"),
           set_prior("normal(-0.6,0.2)", class = "b", coef = "trial_num"),
           set_prior("normal(0,1)", class = "b", coef = "bigram"),
           set_prior("gamma(1,1)", class = "sigma")),
           control = list(adapt_delta = 0.95),
           max_treedepth = 20)

Does this mean that the mean function of this shifted lognormal distribution is a function of bigram and trial_num with population and random effects, or instead that the parameter mu is a function of these predictors? And, for the shifted log normal mu is not the mean but exp(mu) is the median.

1 Like