How to model a binary vector by the Beta-Bernoulli distribution in R or Python？ I have a set of data $x=(x_1,x_2,x_3,...)$;e.g:$x=(0.1,0.003,0.78,...)$
which follows a beta distribution. Since $x_i$ in my data $x :x_i ~ Bernoulli(p)$, where $p$ is the prior of average $x$ and follows the Beta prior distribution, $p~Beta( α, β)$. So is there any R or python script to model a binary vector by the Beta-Bernoulli distribution from my data $x$? 
 A: Is this really what your data looks like? If the xi I were to follow a Bernoulli distribution, should it not be x=(0,1,0,0,1,1,0...)? I.e. all 1 or 0?
If you have that kind of 0-1 data it's pretty easy to model. E.g. the aod R package can fit beta-binomial data (and e.g. in the rstan R package or the pystan python pacakge you could easily fit a hierachical model of this type either using maximum-likelihood or in a Bayesian way after specifying it in the Stan modeling language). Obviously, any package for beta-binomial data can deal with beta-Bernoulli/binary data, because that's just the special case with 1 binomial sample per unit.
If you only have the (binomial) proportions as you seem to show in your example data, then beta-regression may be what you could use. However, that has its problems, because for a small finite number of samples the observed proportions have a rather discrete distribution. On the other hand, if the observed proportions are based on huge numbers of samples that does not vary too much across units, that may be a non-problem.
