jags

Error: “Slicer stuck at value with infinite density” running binomial-beta model in JAGS

寵の児 提交于 2021-02-19 07:00:36
问题 I'm trying to run a binomial-beta model in JAGS (see example code below). I keep getting the error: Error: The following error was encountered while attempting to run the JAGS model: Error in node a0 Slicer stuck at value with infinite density which I am struggling to make sense of. I thought perhaps the initial conditions were sending the beta distribution into infinite regions of parameter space but after some investigation that doesn't seem to be the case. Any thoughts on what this error

How to predict values using estimates from rjags / JAGS

妖精的绣舞 提交于 2021-02-11 06:58:50
问题 After setting up the model and training it with Gibbs Sampling, I got the result of all the prediction of hidden values with: jags <- jags.model('example.bug', data = data, n.chains = 4, n.adapt = 100) update(jags, 1000) samples <- jags.samples(jags, c('r','alpha','alpha_i','alpha_u','u','i'), 1000) Where r is a list of rating, and some of them are withheld for a prediction with the model. And suppose I can get them with r[test] , where test is a list of integer indicating the index of the

How to predict values using estimates from rjags / JAGS

我是研究僧i 提交于 2021-02-11 06:57:38
问题 After setting up the model and training it with Gibbs Sampling, I got the result of all the prediction of hidden values with: jags <- jags.model('example.bug', data = data, n.chains = 4, n.adapt = 100) update(jags, 1000) samples <- jags.samples(jags, c('r','alpha','alpha_i','alpha_u','u','i'), 1000) Where r is a list of rating, and some of them are withheld for a prediction with the model. And suppose I can get them with r[test] , where test is a list of integer indicating the index of the

Loop through (subsets) using jags

老子叫甜甜 提交于 2021-02-11 04:54:13
问题 I have a big dataframe with 10000 rows and 12 columns (discountdataset). The columns contain different variables. The first 210 rows represents subject 1 (there is also a column with "subject1"), the next 210 rows represent subject 2, and so on. I want to use jags and a loop function to loop through all 52 subjects in the dataframe, and assign a function to each of them. My code looks like this: #subsetting the dataframe by the variable subjectid subsetdiscount <- split(discountdataset, as

Inserting jagam code into runjags (JAGS) model

时光毁灭记忆、已成空白 提交于 2021-02-10 18:55:19
问题 I’ve been trying to incorporate smoothing into a runjags model that I’ve created to model seabird burrow numbers and distribution across an island. I’ve managed to generate some smoothing code by extracting the count data and x and y coordinates from the model output and using the JAGAM tutorial on this page http://www.petrkeil.com/?p=2385 I think I might be able to improve model performance by incorporating the smoothing into the jags model but I’m at a loss as to how to do this. Can you

Inserting jagam code into runjags (JAGS) model

与世无争的帅哥 提交于 2021-02-10 18:55:16
问题 I’ve been trying to incorporate smoothing into a runjags model that I’ve created to model seabird burrow numbers and distribution across an island. I’ve managed to generate some smoothing code by extracting the count data and x and y coordinates from the model output and using the JAGAM tutorial on this page http://www.petrkeil.com/?p=2385 I think I might be able to improve model performance by incorporating the smoothing into the jags model but I’m at a loss as to how to do this. Can you

Inserting jagam code into runjags (JAGS) model

独自空忆成欢 提交于 2021-02-10 18:54:37
问题 I’ve been trying to incorporate smoothing into a runjags model that I’ve created to model seabird burrow numbers and distribution across an island. I’ve managed to generate some smoothing code by extracting the count data and x and y coordinates from the model output and using the JAGAM tutorial on this page http://www.petrkeil.com/?p=2385 I think I might be able to improve model performance by incorporating the smoothing into the jags model but I’m at a loss as to how to do this. Can you

How to write model file for JAGS binomial using logit function

泪湿孤枕 提交于 2021-02-10 10:14:17
问题 I am working on an assignment using JAGS to model a binomial distribution who's p parameter is a function of another variable d . This is what I am trying to do: generate 10000 samples from the posterior for the two parameters alpha/beta produce samples to from the posterior predicted number of success when dist = 25 for 100 attempts calculate 95 credible interval for success rate at 25 feet distance I have written the model but it is giving an error. Below is the code I have already tried #R

How to write model file for JAGS binomial using logit function

情到浓时终转凉″ 提交于 2021-02-10 10:12:33
问题 I am working on an assignment using JAGS to model a binomial distribution who's p parameter is a function of another variable d . This is what I am trying to do: generate 10000 samples from the posterior for the two parameters alpha/beta produce samples to from the posterior predicted number of success when dist = 25 for 100 attempts calculate 95 credible interval for success rate at 25 feet distance I have written the model but it is giving an error. Below is the code I have already tried #R

How to write model file for JAGS binomial using logit function

不打扰是莪最后的温柔 提交于 2021-02-10 10:12:27
问题 I am working on an assignment using JAGS to model a binomial distribution who's p parameter is a function of another variable d . This is what I am trying to do: generate 10000 samples from the posterior for the two parameters alpha/beta produce samples to from the posterior predicted number of success when dist = 25 for 100 attempts calculate 95 credible interval for success rate at 25 feet distance I have written the model but it is giving an error. Below is the code I have already tried #R