Cholesky, longitudinal data, ordinal outcome, brms

Hello,

I am running longitudinal analyses on a time-varying ordinal outcome with time-varying ordinal predictors.
Description:
1-In univariate analyses there was not much difference in LOO between polynomial monotonic variables, therefore, for simplicity, I keep the predictor as a polynomial.
2-I use time and id as levels.

My question is about how to write “lkj” prior and I am not sure if my model as shown below is correct.
-Thanks

 pbmulti1<-get_prior (rec_n_r_bodn ~ rec_comb_sevchf+rec_comb_sevhid+rec_comb_sevhypertension+rec_comb_sevarrythmia+rec_sevhyperlipid+rec_comb_sevpad+rec_comb_sevstroke+rec_comb_sevckd+rec_comb_sevdm+rec_comb_sevgi+rec_comb_sevcopd+rec_asthma+comb_plt+rec_comb_cancer+comb_hyperth+rec_comb_sevhypoth+rec_comb_sevanemia+rec_comb_sevoral+rec_comb_sevjd+rec_comb_sevosteoporosis+rec_sevhearing+rec_comb_seveye+ rec_comb_sevdepression+ rec_comb_sevparkinson+rec_comb_sevci+(1+rec_comb_sevchf+rec_comb_sevhid+rec_comb_sevhypertension+rec_comb_sevarrythmia+rec_sevhyperlipid+rec_comb_sevpad+rec_comb_sevstroke+rec_comb_sevckd+rec_comb_sevdm+rec_comb_sevgi+rec_comb_sevcopd+rec_asthma+comb_plt+rec_comb_cancer+
 comb_hyperth+rec_comb_sevhypoth+rec_comb_sevanemia+rec_comb_sevoral+rec_comb_sevjd+rec_comb_sevosteoporosis+rec_sevhearing+rec_comb_seveye+ rec_comb_sevdepression+ rec_comb_sevparkinson+rec_comb_sevci|new_time)+(1+rec_comb_sevchf+rec_comb_sevhid+rec_comb_sevhypertension+rec_comb_sevarrythmia+rec_sevhyperlipid+rec_comb_sevpad+rec_comb_sevstroke+rec_comb_sevckd+rec_comb_sevdm+rec_comb_sevgi+rec_comb_sevcopd+rec_asthma+comb_plt+rec_comb_cancer+
 comb_hyperth+rec_comb_sevhypoth+rec_comb_sevanemia+rec_comb_sevoral+rec_comb_sevjd+rec_comb_sevosteoporosis+rec_sevhearing+rec_comb_seveye+ rec_comb_sevdepression+ rec_comb_sevparkinson+rec_comb_sevci|idno),family=cumulative(),data =bodn_long)
 
 
    pbmulti1$prior[1]<-"normal(0,1)" #beta
    pbmulti1$prior[27]<-"normal(0,10)" #intercept cut-point
	pbmulti1$prior[30]<-"cholesky(10)" #new_time 
    pbmulti1$prior[45]<-"normal(0,2.5)" #sd 
	 
	 fit_bmulti1<-brm(
     formula =rec_n_r_bodn ~ rec_comb_sevchf+rec_comb_sevhid+rec_comb_sevhypertension+rec_comb_sevarrythmia+rec_sevhyperlipid+rec_comb_sevpad+rec_comb_sevstroke+rec_comb_sevckd+rec_comb_sevdm+rec_comb_sevgi+rec_comb_sevcopd+rec_asthma+comb_plt+rec_comb_cancer+
 comb_hyperth+rec_comb_sevhypoth+rec_comb_sevanemia+rec_comb_sevoral+rec_comb_sevjd+rec_comb_sevosteoporosis+rec_sevhearing+rec_comb_seveye+ rec_comb_sevdepression+ rec_comb_sevparkinson+rec_comb_sevci+(1+rec_comb_sevchf+rec_comb_sevhid+rec_comb_sevhypertension+rec_comb_sevarrythmia+rec_sevhyperlipid+rec_comb_sevpad+rec_comb_sevstroke+rec_comb_sevckd+rec_comb_sevdm+rec_comb_sevgi+rec_comb_sevcopd+rec_asthma+comb_plt+rec_comb_cancer+
 comb_hyperth+rec_comb_sevhypoth+rec_comb_sevanemia+rec_comb_sevoral+rec_comb_sevjd+rec_comb_sevosteoporosis+rec_sevhearing+rec_comb_seveye+ rec_comb_sevdepression+ rec_comb_sevparkinson+rec_comb_sevci|new_time)+(1+rec_comb_sevchf+rec_comb_sevhid+rec_comb_sevhypertension+rec_comb_sevarrythmia+rec_sevhyperlipid+rec_comb_sevpad+rec_comb_sevstroke+rec_comb_sevckd+rec_comb_sevdm+rec_comb_sevgi+rec_comb_sevcopd+rec_asthma+comb_plt+rec_comb_cancer+
 comb_hyperth+rec_comb_sevhypoth+rec_comb_sevanemia+rec_comb_sevoral+rec_comb_sevjd+rec_comb_sevosteoporosis+rec_sevhearing+rec_comb_seveye+ rec_comb_sevdepression+ rec_comb_sevparkinson+rec_comb_sevci|idno),family=cumulative(),data =bodn_long,prior=pbmulti1,chains=5,control=list(adapt_delta=0.99,max_treedepth=5),cores=future::availableCores())

Hi,

you mean pri$prior[x] <- "lkj(2)"?

yes, but I get an error message
"The only supported prior for correlation matrices is the lkj prior "
although I wrote it as you mentioned!!

pbmulti1$prior[1]<-"normal(0,1)" #beta
    pbmulti1$prior[27]<-"normal(0,10)" #intercept cut-point
	pbmulti1$prior[30]<-"lkj(2)" #new_time 
    pbmulti1$prior[45]<-"normal(0,2.5)" #sd 

Very strange - are you sure that [30] is where you should put it?

oh, it seems for some reason the priors are misplaced. Attached is what I got, I changed it and it is running. get_prior.txt (5.6 KB)

It is running, but I got the message
“Exception: validate transformed params:y is not positive definite” in one line
Is this OK , it’s my first time running this model in brms.
Thanks,

Hi,

not seen that message before but it seems that the model is expecting positive definite in the outcome variable, but it’s found values that are not positive definitive?

I will share the results when ready to find out.
-Thanks

Hi,

check y to start with, i.e., table(bodn_long$rec_n_r_bodn)

 table(bodn_long$rec_n_r_bodn)

  1   2   3   4   5   6   7   8   9  10  11  12 
282 381 590 689 813 848 768 661 543 444 286 214 

The model is not a good one. i need to re-think about it !

Hello,
My model did not work well! Very poor Rhat!
My assumption is that in my data not any one has repeated measures!
While this is OK with mle4 it seems it is not OK in brm!
I decided to break down the data and perform Lag analyses for ordinal. However this would be different from Lag-Time series, I assume because both response and predictors are ordinal.

On a different note, my question is how is the below formula for the multivariate predictors.
Thansk

y ~ mo(x) + (mo(x) | person)