All Questions

Tagged with
2
votes
0answers
23 views

FFBS algorithm for estimating mean log-return parameter in stochastic volatility jump model

I am currently attempting to replicate this model: https://arxiv.org/pdf/1809.01501.pdf in r. My (first) problem is regarding how to sample from conditional posterior for mu, $(μ_{(j)}|Y_n, J_{(j−1)}...
2
votes
1answer
33 views

Nonlinear sin model with brms

I try to fit sin function with brms using next code: ...
0
votes
0answers
9 views

Difference between dlm and bsts

I'm working on a project which asks me to analysis the Facebook's stock price, and I have to do it the Bayesian way. This assignment doesn't have a particular goal and we are free to decide the what ...
0
votes
0answers
13 views

Bayesian ZIF negative binomial regression priors

I'm currently searching for some literature on the efficacy of various non-informative priors on zero-inflated negative binomial regression. However, most of the research I can find provides ...
2
votes
2answers
42 views

Selecting informative priors

I am questioning myself on how to chose the priors for a bayesian analysis in Rstudio. I'm trying to investigate the chances of relapse in a set of patients. These patients are all affected by a ...
0
votes
0answers
12 views

Simulating data in JAGS “ones trick”

I am trying to simulate data to use for posterior predictive checks in JAGS running through R, which is relatively simple for pre-loaded distributions, but I am looking to simulate data when I have ...
2
votes
1answer
39 views

Time series forecast with probability

I have historical data for a particular metric for each month for the last 3 years for different categories. The metric is a percentage and its heavily skewed towards 1 with more than 75% of values ...
1
vote
0answers
61 views

Binary logistic regression with brms

I've run a binary logistic regression in R, using brms. I have one independent variable (Age) and 3 dependent variables, Y1, Y2, and Y3. These dependent variables are all pass/fail tasks. For each ...
0
votes
0answers
17 views

How to choose the parameters of a prior distribution based on a range for the variance?

How can I use R to calculate the parameters of a prior distribution if I want the variance to fall within a specific range? For instance, I have a variable that follows the inverse gamma distribution ...
1
vote
0answers
18 views

Bayes factors in R for correlated proportions (such as a “Bayesian McNemar's test”)

Is there any way to get Bayes factors in R for correlated proportions (i.e., paired sample)? For example, the same group of 90 people is measured with one technique, then with another; once there are ...
0
votes
0answers
19 views

Calculating the posterior distribution of linear predictor

I am currently fitting a linear regression model in a bayesian framework in R with the package ngspatial. To investigate the quality of fit, I would like to calculate the bayes R2, as suggested here ...
0
votes
0answers
20 views

JAGS: Posterior Predictive Check for a Logistic Regression Model

I want to perform a posterior predictive check on some simple logistic regression models that I fitted in JAGS. I found a function in the R package jagsUI called pp.check (see doc here: (pp.check ...
0
votes
1answer
28 views

manual implementation of Gaussian naive bayesian returns posterior larger than 1

I try to implement Gaussian naive bayesian manually in R. I test my model on iris data set. I would like to build a predictive model. That is, I would like to ...
0
votes
1answer
33 views

How to interpret estimates and correlation of random effects (intercepts and slope) in a mixed-effects model in a Bayesian framework(brms)?

I do not understand how to interpret random slopes from the output of brms Among others, I read this post on the output from ...
1
vote
0answers
23 views

Does specifying normalizing constant significantly improves Hamiltonian Monte Carlo?

From my understanding the energy function needs only be specified such that it is proportional to the log density, and not specifying the normalizing constant should not greatly impact the sampling ...
0
votes
1answer
46 views

Confusion between using ratio, bayes theory, or others

I am confused as to what I should be using to derive an appropriate metric. The objective here is to find out if knowing if a person has X, Y, Z can help indicate if they are in the binary bucket A or ...
0
votes
0answers
31 views

How do I specify a moving average model in R-INLA?

I have a dynamic regression model specified as follows: $f_{c,t+1} \sim N(\eta_{c,t+1} + \phi\epsilon_t,\sigma^2_{f})$ $\epsilon_t=f_{c,t}-\eta_{c,t}$ $\eta_{c,t}=\beta_0+\beta_1x_{1,c,t}$ How ...
2
votes
1answer
394 views

How does mice::mice work?

The idea of multiple imputation seems to be based on the decomposition $$ p(\theta \mid y_{\text{obs}}) = \int p(\theta \mid y_{\text{obs}}, y_{\text{mis}})p( y_{\text{mis}} \mid y_{\text{obs}}) \text{...
2
votes
1answer
75 views

Gibbs sampler for a multilevel model with no predictors in R

I'm working on multilevel models and want to know how they are estimated in R. For that purpose I'm reading amongst other things "Data Analysis Using Regression and Multilevel/Hierarchical Models" by ...
0
votes
0answers
51 views

How to calculate marginal probabilities in ElemStatLearn package mixture.example

How do they calculate mixture.example$marginal? I understand this represents the marginal probability of each lattice predictor point but I don't understand how they computed these values.
1
vote
0answers
1k views

Singular fit with simplest random structure in lmer (lme4), is a Bayesian approach the only option?

I'm running a mixed model with the lmer function from the lme4 package in R and ran into some issues with singular fits. I get the warning message 'singular fit', ...
1
vote
1answer
35 views

Forward algorithm for ZIP - Hidden Markov model

I'm trying to adjust a Zero Inflated Poisson Hidden Markov Model with Stan. For the Poisson-HMM in a past forum this setting was shown. see link. While to adjust the ZIP with the classical theory is ...
0
votes
1answer
48 views

Using conditional probability to calculate sentiment score probability

Sorry, maybe this is a bit of a rookie question, but I would like to find out the probability of A(tweet sentiment being negative or positive) based B (the length of the tweet). This to me sounds ...
4
votes
2answers
134 views

Bayes Factor Poisson-Hidden Markov Model

I am following the Hidden Markov Models guide text for Time Series An Introduction Using R (Walter Zucchini). Chapter 7. Bayesian inference for Poisson-hidden Markov models. Specifically in section 7....
0
votes
0answers
49 views

Random effects vs Rubin's rule to obtain pooled parameter estimates from multiply imputed datasets

I would appreciate any help to understand the statistical difference between using random effects and Rubin's rule to obtain pooled parameter estimates from multiply imputed datasets. For example, if ...
2
votes
1answer
104 views

Correct usage/understanding of Bayes Factor when comparing two proportions

I'm just starting to learn R and explore Bayesian statistics, but I keep getting tripped on using Bayes Factor and (honestly), I'd love a little confirmation if my process is correct in interpreting ...
1
vote
1answer
38 views

Why sd of a normal distribution changes by only changing its mean (R code provided)

In my R code below, I'm wondering why $sd$ of N and K are larger than ...
0
votes
0answers
36 views

Defining custom Bayesian priors in R (BayesFactor package)

I'm performing some Bayesian analyses in R using the BayesFactor package, and was wondering whether it is possible to specify priors for the alternative not centered on zero (the current defaults ...
0
votes
0answers
40 views

bayesian decision making - comparing expected loss

The problem is like this: Suppose that I am considering which country should I invest on, country A and country B, based on their GDP growth rate $\alpha$. There are two possible choices for each ...
0
votes
0answers
133 views

Getting main and interaction effects from Bayesian factorial ANOVA in Stan

I am using Rstan to build a factorial ANOVA model with two factors and their interaction. The sample dataset has 2 factors, A (levels A1 and A2) and B (levels B1, B2, B3) and 10 replicates for each ...
2
votes
1answer
549 views

Joint posterior distribution of $(\mu,\sigma^2)$ in the Normal model

Find the joint posterior of $(\mu, \sigma^2)$ given Normal data. I've found the joint prior of $\mu$ and $\sigma^2$ (where $\displaystyle\sigma^2\sim\chi^{-2}(v_o,v_os_o^2)$ and $\mu\mid\sigma^2\sim ...
0
votes
1answer
44 views

Calculating Bayes Factor from Z score, n, and No

I'm completely stuck on how to get this answer from a course below. I guessed the answer, but I'm lost on how they get to it. I did the following in R ...
0
votes
0answers
80 views

Compute posterior expected loss for choosing B over A

The bayesAB package in r computes the posterior expected loss for choosing B over A when running the following commands: ...
2
votes
1answer
31 views

Books on Bayesian inferential analysis of GARCH models

Do you know books about Bayesian inferential analysis of GARCH models with the analysis of these models in R and JAGS? Here is a list of the books I already have: [Ardia] - Financial Risk Management ...
1
vote
1answer
50 views

Bayes inference: hypothesis testing on the average parameter

Bayesian inference field: given a dataset, if I assume a normal a priori distribution on the average parameter with zero mean and a given variance, those hypothesis tests can be carried out on the ...
3
votes
2answers
119 views

Simulating the Posterior Density of a Transformed Parameters

I am reviewing an example (p. 180-181, Example 11.3 and 11.4) from All of Statistics by Larry Wasserman. The example intends to illustrate that the posterior can be found analytically and can be ...
0
votes
0answers
29 views

How are bayesian networks created from an attribute matrix and target vector?

I'm very familiar with correlation networks but I can't seem to grasp my head around how Bayesian Networks are constructed. How are the "edges" determined? How is the structure determined? I was ...
4
votes
1answer
609 views

Binomial Regression “logit” vs “cloglog”

I am using a binomial regression with a categorical factor with 9 levels (named 'treat.group') and sample sizes in each group from 1-8. 1 treatment group has all positive cases (i.e., 1's) - and this ...
0
votes
0answers
37 views

R bayesian moderator analysis

I am making the transition from using frequentist methods for meta-analysis to a mixture of frequentist and bayesian, as needed. A barrier I am noticing is a lack of moderator analysis options in ...
1
vote
0answers
90 views

How to implement Exponential Power distribution in JAGS

I would like to fit a simulated data to Exponential Power likelihood using uniform mixture with gamma mixing presented in "Scale Mixtures Distributions In Statistical Modelling" by Choy and Chan: $EP(...
1
vote
1answer
44 views

Step wise AIC in model selection in R

When I was trying to do the model selection using the function step or stepAIC in R, there ...
0
votes
0answers
70 views

compare AIC and BIC results in R

The data I am using can be found here. These data were originally taken to explore multiple regression to predict the percentage of body fat based on 13 predictors (body measurements) that are easily ...
4
votes
0answers
70 views

How to infer a prior belief after observing a behavior

My participant goes through a maze made of 32 T intersections. At each intersection he must choose whether to go either to the left or to the right: one option will lead to another T intersection, ...
0
votes
0answers
41 views

using rstanarm for quantile regression

I understand that rstanarm can be used for GLMs, GAMs and hierarchical models. Does anyone know, if I can use it to estimate quantile regression models? If not, are there other Baysian R package, ...
1
vote
0answers
27 views

Correct likelihood to model distribution with positive and negative values, and a large number of zeroes?

I have a change score as my dependent variable, which appears to be highly kurtotic (the majority of people don't change, but a few participants change by a large degree). I cannot figure out the ...
0
votes
1answer
140 views

Survival time problem exponential with gamma prior

The survival times, in days, of patients diagnosed with a severe form of a terminal illness are thought to be well modelled by an exponential($\theta$) distribution. We observe the survival times ...
0
votes
0answers
31 views

Calculating Cauchy prior

I've recently used the package BayesFactor in R with the default priors scale r. I have been advised to adjust the Cauchy width based on some pilot data rather than ...
1
vote
1answer
650 views

Joint probability of two distributions

If I have one random variable that represents hours worked per job X~exponential($\theta$). I have another random variable that represents how many jobs obtained per month Y~Poisson($\lambda$). Using ...
0
votes
0answers
151 views

Coverage probability for the Bayesian credible interval for Normal distribution

Bayesian Inference for the Normal Distribution, I use the following r code to obtain the posterior distribution. Let's say the data, $X\sim N(\mu, \sigma^{2})$ and $\mu \sim N(0,10)$ and $\sigma \sim \...
2
votes
0answers
102 views

Calculating expected loss of posterior distribution

I'm working with 2 posterior distributions from AB tests. For the sake of simplicity let's assume: $$ A\sim Beta(10, 20) $$ $$ B\sim Beta(5, 25) $$ I want to calculate the posterior expected loss of ...