r/BayesianProgramming • • Sep 13 '22

NA error with data without NA values

1 Upvotes

Hello all, i've trying several ways to run my STAN code, but i have always the same error.

Error in FUN(X[[i]], ...) : Stan does not support NA (in Y) in data
failed to preprocess the data; sampling not done

but my 'Y' matrix of data don't have NA data. so i don't know what is the mistake...

my STAN code is as follow:

data {
   
   int<lower=1> N; // number of records
   int<lower=1> NP; //  number of periods
   
   vector[N] R; // distances

   vector[NP] freq;
   
   vector[NP] Y[N];       // U
   
 }
 
 
 parameters {
   
   real c10;
   real c20;
   real c30;
   real c11;
   real c21;
   real c31;
   real c12;
   real c22;
   real c32;
   
   real c1s;
   real c2s;
   real c3s;
   
   cholesky_factor_corr[NP] L_p;
   vector[NP] stdev;

 }
 
 transformed parameters{
   
   vector[N] a0;
   vector[N] a1;
   vector[N] a2;
   
   for(k in 1:N){
     
     a0[k]=c10+c20*log10(R[k])+c30*square(log10(R[k]));
     a1[k]=c11+c21*log10(R[k])+c31*square(log10(R[k]));
     a2[k]=c12+c22*log10(R[k])+c32*square(log10(R[k]));

   }

 }
 
 
 model {
   
   vector[NP] mu_rec[N];
   matrix[NP,NP] L_Sigma;
   
   stdev ~ cauchy(0,0.5);
   
   L_p ~ lkj_corr_cholesky(1);
   L_Sigma = diag_pre_multiply(stdev, L_p);
   
   //prior
 
   c10 ~ normal(0.92362,0.37904);
   c20 ~ normal(-0.66292,0.41491);
   c30 ~ normal(0.63449,0.11123);
   c11 ~ normal(-1.35974,0.44268);
   c21 ~ normal(1.77347,0.48574);
   c31 ~ normal(-0.40108,0.13054);
   c12 ~ normal(0.93758,0.28134);
   c22 ~ normal(-1.04353,0.310557);
   c32 ~ normal(0.21054,0.08400);
   
   a0 ~ normal(0,10);
   a1 ~ normal(0,10);
   a2 ~ normal(0,10);
   
   
   for(f in 1:NP){
     for(i in 1:N){
     
     mu_rec[i,f] = a0[i] + a1[i]*log10(freq[f]) + a2[i]*square(log10(freq[f]));
     
     }
   }
   
   Y ~ multi_normal_cholesky(mu_rec,L_Sigma); //llh
 }

r/BayesianProgramming • • Sep 02 '22

Need help :c

1 Upvotes

Hello all,

I want to make a Bayesian inference to determine some coefficients, I have a previous study where it determines them but I don't know how to define the prior for my model. Could someone help me?


r/BayesianProgramming • • Jul 20 '22

Correcting a sample for bias based on supporting variables

1 Upvotes

Hi all. First time poster. I've done quite a bit of MCMC calibration but not much else.

I have a sample of data from 1000 anonymous individuals. I suspect the sample is biased (the individuals were self selected). For each individual I have data items A and B.

I also have data item A for the complete population of 10000 individuals.

How can I infer the population distribution of B?

Thanks in advance!


r/BayesianProgramming • • Mar 13 '21

HPD Credible set vs Equitailed Credible Set

1 Upvotes

In Bayesian statistic, if the posterior distribution is symmetric, are the HPD credible set and the Equitailed Credible set the same?


r/BayesianProgramming • • Jul 22 '20

Is there a benchmark approach to Bayesian hypothesis testing?

1 Upvotes

This is a very general question, but if I'm doing regression to compare between a treatment and a control condition, like in frequentist we have the p-value....which I know is not how Bayesians do it. But, what is show my hypothesis is valid? What are the evaluation criteria?


r/BayesianProgramming • • Dec 20 '19

Sean Matthews, Jannes Quer: Time series modelling with probabilistic... | PyData Berlin 2019

Thumbnail
youtube.com
1 Upvotes

r/BayesianProgramming • • Feb 07 '19

Webinar Registration - Zoom

Thumbnail
zoom.us
1 Upvotes

r/BayesianProgramming • • Dec 20 '18

PyMC3 Developer Guide — PyMC3 3.6.rc1 documentation

Thumbnail docs.pymc.io
1 Upvotes

r/BayesianProgramming • • Jul 28 '18

Do Bayesians Overfit? - Sebastian Nowozins slow blog

Thumbnail nowozin.net
1 Upvotes

r/BayesianProgramming • • Jun 03 '18

[1805.10662] Contextual Policy Optimisation

Thumbnail
arxiv.org
1 Upvotes

r/BayesianProgramming • • Jan 25 '18

[1801.07710] Bayesian Neural Networks

Thumbnail
arxiv.org
1 Upvotes

r/BayesianProgramming • • Jan 24 '18

[1801.06230] Overpruning in Variational Bayesian Neural Networks

Thumbnail
arxiv.org
1 Upvotes

r/BayesianProgramming • • Jan 23 '18

Boston Bayesians 2017 - Two Years of Bayesian Bandits for E-Commerce

Thumbnail
gist.github.com
1 Upvotes

r/BayesianProgramming • • Dec 07 '17

Derrick Higgins, AmFam Data Science & Analytics, discusses how Bayesian methods can be applied to improve the quality of annotated training sets.

Thumbnail
blog.dominodatalab.com
1 Upvotes

r/BayesianProgramming • • Nov 30 '17

[1711.09268] Generalizing Hamiltonian Monte Carlo with Neural Networks

Thumbnail
arxiv.org
1 Upvotes

r/BayesianProgramming • • Oct 17 '17

[1710.04759] Bayesian Hypernetworks

Thumbnail
arxiv.org
1 Upvotes

r/BayesianProgramming • • Sep 29 '17

[1704.02030] Using stacking to average Bayesian predictive distributions

Thumbnail
arxiv.org
1 Upvotes

r/BayesianProgramming • • Sep 28 '17

Approximate Inference - Call for Papers

Thumbnail
approximateinference.org
1 Upvotes

r/BayesianProgramming • • Aug 14 '17

Random Thoughts | Opinion: relation between Machine Learning and...

Thumbnail
blog.pletnikov.com
1 Upvotes

r/BayesianProgramming • • Jun 26 '17

Release v3.1 Final · pymc-devs/pymc3

Thumbnail
github.com
1 Upvotes

r/BayesianProgramming • • Jun 25 '17

dfm/daft

Thumbnail
github.com
1 Upvotes

r/BayesianProgramming • • Jun 25 '17

Torsten Scholak, Diego Maniloff Intro to Bayesian Machine Learning with PyMC3 and Edward

Thumbnail
youtube.com
1 Upvotes

r/BayesianProgramming • • Jun 19 '17

A python tutorial on bayesian modeling techniques (PyMC3)

Thumbnail
github.com
1 Upvotes

r/BayesianProgramming • • Jun 16 '17

Peadar Coyle: Variational Inference and Python

Thumbnail
youtube.com
1 Upvotes