Yosuke Tanigawa
2020/4/2
We are trying to fit multinomial model using brms and it seems like we are not able to get a stable fit. We would love to get some advise.
Specifically, when we try to fit 12 chains, and only one of them have samples.
When we try to lower the threshold of N (min_n
) and include more countries (columns), none of the 12 chain contained samples.
Our function call is in this form. We used LKJ(2) as the prior for the correlation.
fit <- brm(
response | trials(n) ~ 1 + (1 | ID | obs),
family=multinomial(),
data=A,
control = brm_control,
prior = c(
set_prior("lkj(2)", class="cor")
),
chains=12,
iter = brm_iter,
cores=6,
)
We observed those warning messages:
Chain @: Exception: validate transformed params: y is not positive definite. (in 'modele@@@' at line 493)
We used the latest version (2020/3/31 59a47b97949a4ef77b9398395b94262272bb3d0f
) of brms from GitHub.
brms.fit.R
is the script used in our analysis.
Our input file: https://github.com/rivas-lab/covid19/blob/master/HLA/HLA.2digits.wide.tables/HLA-A/UKB.HLA.country_of_birth.2digits.wide.tsv
Our output file (that has input matrix A
) is uploaded to Google Drive: https://drive.google.com/open?id=1wc0I7bn7Qjwm9JJ_Zz1XzCArrPkrKF9G
And those are the contents of the input data frames.