Non-linear formula - trick for restriction on sign?

I found this pre-print a while ago and I found it very interesting:

My first thought was regaring if it would be possible to setup their model(s) with brms, extended with partial pooling.

EDIT: Model A (slightly rewritten from reference): \text{logit}(Pr(y_{ij}=1))=\alpha_j-\beta_j(o_j-x_i)^2, i - index for party, j - index for ideology/tag

I have the data, but it needs cleaning, but I think a non-linear formula (for their model A) would look something like:

nl(binary ~ a + exp(b)*(o-x)^2,
a ~ 1 + (1|ideology), # ideology tag specific constant (prevalence)
b ~ 1 + (1|ideology), # ideology tag discrimination parameter
o ~ (1|ideology), # ideology tag location
x ~ (1|party)) # party location
#family = binomial(link="logit")

I think we would like to set the prior for the SD of the party locations and the ideology tag as fixed at 1 to resolve the multiplicative invariance. The means are both fixed at zero to resolve the addition invariance. However, we still have the rotational/sign invariance to resolve, which is the tricky part to do directly in brms. In the paper they fix the ideology tag location for conservatism to be larger than 0. I am thinking along the line of changing the non-linear formula into something like

~ a + exp(b)*(o-(x+x*conservative*(x<0)*2*abs(x))^2

Conservative would an indicator for whether the ideology tag is conservatism. Do you think that would work?

1 Like

sorry your question seems to have fallen through. I honestly don’t understand those models very well. I however fear that you would pushing brms to its limits and you might be getting better results moving to pure Stan. It looks like a borderline case.

It all seems roughly correct up to:

I don’t think that would work as that would make the posterior non-smooth. I think what you want could be achieved with explicitly having a b_conservative parameter, i.e. something like:

nl(binary ~ a + (1 - conservative) * exp(b)*(o-x)^2 + conservative * exp(b_conservative) * (o - x) ^ 2,
a ~ 1 + (1|ideology), # ideology tag specific constant (prevalence)
b ~ 1 + (1|ideology), # ideology tag discrimination parameter
o ~ (1|ideology), # ideology tag location
b_conservative ~ 1,
x ~ (1|party)) # party location

And then use prior to give the Intercept for b_conservative a lower bound of 0.

Does that make sense?

There are a couple results on this forum for “ideal point” and also “latent factor models” seem to lie in a similar territory (e.g. as Constraining Latent Factor model / baysian probabalisic matrix factorization to remove multimodality). My impression is that those models are tough to crack, but I am not well read on this.

P.S.: It is usually good practice to repost the model formula you are after in the post - it took me some time to find it in the reference.