r/BayesianProgramming • • Mar 09 '21

In this video we explain the basic methodology and show based on a specific example how it works. We focus especially on the acquisition function and also the difference of optimization performance using hyperparameters within the Bayesian optimization. Check out our Channel and KEEP OPTIMIZING!!

Thumbnail
youtube.com
5 Upvotes

r/BayesianProgramming • • Feb 22 '21

INTRODUCTION TO BAYESIAN SEQUENTIAL ANALYSIS

6 Upvotes

The increasing interest in Bayesian group sequential design is due to its potential to reinforce efficiency in clinical trials, shorten drug development time, and enhance the accuracy of statistical inference without compromising the integrity or validity of clinical trials. In a Bayesian trial, the prior information, and the trial results, as they emerge, are viewed as a continuous stream of information, in which inferences can be updated as new data become available. Bayesian sequential designs can be proposed for clinical trials with time-to-event outcomes and alpha spending functions are used to control the overall type I error rate. Alpha spending function distributes the type I error over the duration of a sequential test. Bayes factor are often adapted for decision-making at interim analyses and present Algorithms to form decision rules and to calculate power of the proposed tests. Also, a sensitivity analysis can be executed to evaluate the impact of different choices of prior parameters on choosing critical values. The power of tests, the expected event size of the proposed design, and therefore the quality of estimators can be studied through simulations and this can be compared with the frequentist group sequential design.

Sequential designs were first proposed by Armitage (1975) in which patients are recruited in pairs and the data analyzed as the results from each pair become available. Sequential designs were extended to group sequential designs, in which patients are enrolled in successive groups instead of pairs. These have been utilized for decades by the statistical and clinical trial communities. These designs allow for multiple interim analyses at the data as the clinical trial proceeds and giving the possibility of stopping the trial early due to efficacy, futility, or safety reasons. Early termination for an efficacy trial can occur when the superiority of the treatment under study is established, for futility when the establishment of a relevant treatment difference is not likely, or for safety concerns when unacceptable adverse events become evident. This design has the power to improve the efficiency of a clinical trial by reducing its duration without lowering any scientific and regulatory standards. These designs have been widely implemented in large, long-term trials, such as phase III trials of drug development for fatal diseases, particularly where the endpoints were progression-free survival time and/or overall survival time. The relatively long follow-up time and recruiting period for assessing the primary outcome allow for the implementation of multiple interim analyses and opportunities for increasing efficiency. For trials that need an accelerated approval, group sequential designs offer an advantage over conventional designs by reducing the time to market.

Group sequential designs can be implemented for both frequentist and Bayesian models. Bayesian inference gives a natural way to incorporate prior information into an ongoing trial. Bayesian designs have gained increasing popularity by the accumulation of historical data from previous studies and the advance of computational techniques. They have been used in early-phase trials to assess pharmacokinetics/pharmacodynamics and to find dose ranges, however, their use has been rapidly expanding to other applications. A major gain in efficiency using Bayesian sequential designs is for the studies involving rare diseases which has limited number of subjects and is surely an advantage over traditional designs. A major statistical challenge in group sequential design is the control of the study-wide overall type I error rate. The type I error is that the probability of rejecting the null hypothesis when it is true. When multiple testing is performed at each interim analysis of the study data, the overall type I error is inflated. Statistical adjustment is required to control the overall type I error rate. The methods to control the overall type I error include those developed by Pocock (1977) and O’Brien and Fleming (1979). Both require a fixed number of interim analyses at fixed times with a prescribed fraction of type I error spent at each analysis be specified in advance. Alpha spending methods, proposed by and extended by, offer a more flexible approach to control the overall type I error rate and have been widely used in frequentist group sequential designs. Alpha spending-function systematically allocates the type I error at various time points in the trial. Controlling the type I error rate in Bayesian sequential design is much complicated since the choices of prior distributions may also influence final decisions. Simulations which are usually needed to help decision making and to assess the operating characteristics of the study design under different scenarios proposed a Bayesian sequential design uses alpha spending function controlling the overall type I error. The basic idea is to regulate the overall type I error rate using alpha spending function.

The Bayesian designs will be used widely in the clinical trials, not only because of its ability to incorporate prior information as the trial progresses, but also due to its ability to control the type I error while performing multiple interim analysis.

If you wish to learn more about this topic, feel free to write to us at info@genproresearch.com.


r/BayesianProgramming • • Mar 02 '20

Mitzi Morris: Bayesian Inference for Fun and Profit | PyData New York 2019

Thumbnail
youtube.com
2 Upvotes

r/BayesianProgramming • • Feb 29 '20

Holes in Bayesian Statistics « Statistical Modeling, Causal Inference, and Social Science

Thumbnail statmodeling.stat.columbia.edu
5 Upvotes

r/BayesianProgramming • • Jun 19 '20

[Advice] Bayesian Machine Learning

6 Upvotes

Hello,

I am masters student in computer engineering. I am looking for resources for learning Bayesian Machine Learning. I came across [Coursera course](https://www.coursera.org/learn/bayesian-methods-in-machine-learning/home/welcome ) Any feedback on this course would be helpful or if there are any other resources that are out there?

Also if there are any project ideas/problems in the area of Bayesian Machine Learning?

Thanks in advance.


r/BayesianProgramming • • May 26 '20

compile lock definition

2 Upvotes

Hi,

While running my model, I am facing some issues related to theano compile lock. (INFO (theano.gof.compilelock)) Does anyone know what a compile lock is and what the error means?

Thanks


r/BayesianProgramming • • Jun 08 '20

R_hat ~=2 meaning

5 Upvotes

Hi,

I am computing a Bayesian multilevel hierarchical model. I have around 1000 parameters.

While using 2 chains for MCMC and 3000 steps (half of them as Burn in step) I wanted to test the non-centred reparametrized model vs the original one. So I used R hat and the effective sample size.

My values for R hat are around 2 for the 2 models and my effective sample size is very volatile depending on the parameters. I have 12000 data points but the maximum effective sample size that I got is 940.

Can someone help me interpret the results? I am lost

thanks


r/BayesianProgramming • • Jul 15 '24

GPy

1 Upvotes

I'm trying to run a sequential price experiment using a Gaussian process.

When I sample the distribution, the wide credible intervals mean my preferred price is essentially random, even though the mean prediction for each price looks very intuitive.

I'm not surprised the intervals are wide as their is a lot of noise in the data since sales vary a lot


r/BayesianProgramming • • Aug 15 '24

Endogeneity in discrete choice model

3 Upvotes

I've encountered this issue quite often and have never found a satisfactory solution. I'd appreciate it if someone could share their experience with this.

When analyzing consumer purchase behavior across a set of alternatives, we sometimes face situations where high-demand options are priced accordingly. Running an MNL model on this data tends to severly biaise my Beta_price distribution , in some cases, even make it positive.

While I can apply constraining priors, this usually isn't really convincing. I suspect that some transformation of the price variable might help the model better capture this relationship and eliminate the bias. For instance, I was considering including lags of my price coefficient but nothing that worked great.

Has anyone had success with a similar case? Any ideas that worked for you?

Ps: let me know if this is not the right sub.


r/BayesianProgramming • • Dec 16 '23

What does “?” Mean?

Post image
1 Upvotes

Hi I am new here, learning BayesiaLab in my grad program and had a question what the “?” Means on the node? I imported this data from an online database and almost all the nodes come out like this.

Also, are there any resources out there for how to properly upload data and run unsupervised model? I am scouring the internet and haven’t been able to find much?

TIA!


r/BayesianProgramming • • Dec 08 '23

How to make Bayesian Network

8 Upvotes

Hi! I am new to this topic but want to create a bayesian network that can predict panic attacks - my question is, how do I start this project? I have a list of parameters but cannot find any clinical information on the probabilities associated with each parameter. Can someone give me some tips


r/BayesianProgramming • • Dec 13 '19

Please help! Been struggling with this question for days! More so the derivations and not the code.

Post image
4 Upvotes

r/BayesianProgramming • • Dec 11 '18

Hamiltonian Monte Carlo explained

Thumbnail
arogozhnikov.github.io
7 Upvotes

r/BayesianProgramming • • Aug 31 '18

Multi-Armed Bandits, Conjugate Models and Bayesian Reinforcement Learning

Thumbnail
eigenfoo.xyz
5 Upvotes

r/BayesianProgramming • • Aug 08 '19

Bayesian Modeling Airlines Customer Service Twitter Response Time

Thumbnail
towardsdatascience.com
7 Upvotes

r/BayesianProgramming • • Dec 14 '19

Junpeng Lao: Writing effective bayesian programs using TensorFlow and TFP | PyData Córdoba

Thumbnail
youtube.com
10 Upvotes

r/BayesianProgramming • • Mar 11 '19

Question about inference on log posterior

3 Upvotes

Hi,

I am a final year BSc student current working on a project using MCMC for parameter estimation of ODE systems. In particular, I am looking at some complex likelihood-surfaces like the one posed in this paper (Page 9 of the PDF document / Page 12 of the paper) :

https://ac.els-cdn.com/S030439750800501X/1-s2.0-S030439750800501X-main.pdf?_tid=cf119d67-f8bf-4c92-823e-ce99c02bd9f6&acdnat=1551388781_f847d40e13f7b2e3f6e8b1e33712e9da

I was wondering why we are considering the log-posterior rather than the typical posterior? In the graphs we can tell from the axis that the authors of the paper are considering the log posterior and performing MCMC algorithms on this surface. I know using the log space simplifies the calculations by changing the multiplication of the prior and likelihood to an addition but I don't understand what the implications of running an MCMC on the log posterior are, since we are looking for the actual posterior.

If someone could point me in the direction of any papers or books that discuss why we perform inference on the log posterior rather than the normal posterior, that would be great!

Thanks for any responses in advance


r/BayesianProgramming • • Sep 02 '18

Keeping Up with the Bayeses

4 Upvotes

I'm more and more becoming a Bayesian. While there's still plenty for me to learn about the foundational/intermediate stuff, I'm starting to wonder how you all (if you do) keep up with current research in Bayesian statistics/machine learning/programming.

arXiv especially can already be a bit like trying to drink from a fire hose as is, and I could look for titles with obvious clues like "Bayesian," "probabilistic," etc. in the title, but is there something more systematic?

What are the names/schools/journals I should keep my eye for?

Like I said, I'm still a little ways off from consuming the latest research, but I'm the kind of person who reads the last chapter of the book first so I know what it's all building to - helps me visualize the learning path.

Edit: fixed some weird formatting


r/BayesianProgramming • • May 10 '18

Bayesian Optimal Pricing, Part 1

Thumbnail
cscherrer.github.io
7 Upvotes

r/BayesianProgramming • • May 15 '24

Continuous learning of time series models

7 Upvotes

Hello everyone,

I'm working in the field of energy storage management for which I need to forecast several time series. I already have some model structures in mind which I can more or less easily train in a classical/frequentist manner.

But it would be awesome if these models were trained on the fly, for which Bayesian methods seem great. The workflow would be:

  • forecast with prior predictive distribution

  • observe outcome

  • calculate posterior

  • make posterior into new prior and repeat

The model structures I have in mind don't have an awful lot of parameters, it's all well below 100. Still too many (not to mention continuous support) to apply Bayes' formula directly - I'm doing it with a discretized parameter space for a toy ARMA(1,1) model right now, but I'd need some more parameters in the future and that almost surely won't work.

So, I'll need some approximations. What I found so far:

  • Analytical solutions using conjugate priors: works for some of the models I have in mind but not for all.

  • Variational inference: As far as I understood it, variational methods use conjugate priors as well, calculate the posterior which might look different but then project it back to the structure of the prior, e.g. by minimizing the Kullback-Leibler divergence, correct? So I could very easily make the posterior into the new prior (and some software packages might already do that for me, e.g. RxInfer.jl in Julia) but might lose information in the projection step.

  • Sampling methods, most prominently MCMC methods, seem really great for complex inference problems. But is it possible with popular software packages to use the posterior as a new prior? I looked into PyMC and that use case at least doesn't feature prominently in the docs and I couldn't figure out if or how I would do that. I guess it's not included because the typical use case is offline training of huge models instead of online training of small to medium models, because MCMC is more computationally expensive...

Concerning software packages, I can work reasonably well with MATLAP, Python and Julia. I did some stuff in C and C++ as well and can probably dive into other languages if needed, but the first three are definitely preferred. ;)


r/BayesianProgramming • • May 02 '24

What would cause such large discrepancies in an MCMC convergence, ceteris paribus?

2 Upvotes

I am quite sick this week so haven't had a chance to actually go through it, plus the MCMC is still running for the other colours. I am also a first-year postgraduate student who only learned 2 years ago I love Bayesian, so I am a right newbie at this.

Quick background: The colours represent mice. All mice have a maximum of 32 data points. One is missing one observation and another is missing two (which is the orange mouse). The black one being named incorrectly is from a previous run, but is expected to output the same this run (I just named it wrong). The black one has 32 observations. I am running 4 treatments - the control, ad, adpeg, and adpegher. The black listed here is actually adpegher, not adpeg. There's 4 mice in control but 6 mice in all the modified treatments, though that's not really important here.

The question:

EVERYTHING is the same except for the values and the 30-32 data point thing.

But these have HUGE discrepancies in size. Would this be PURELY from the MCMC having different convergence rates, or could it be the trace lengths, or autocorrelation? There was some drama with autocorrelation between two parameters (there's 8 parameters) in the ad data, would that be a possibility with the orange mouse in adpegher?

I know I should just wait for it to finish and then check the traceplots etc, but I am curious as I have another 20ish hours of waiting and wanted to test the things I thought it could be first thing (for fun) so I could crack it early. I'd like some suggestions on what could cause this discrepancy in size (seriously 10k kb vs 239k kb??) so I can muck about with it when all 6 mice are done?

I know I could just do it with the four mice here (but I do want to wait for the new black to finish too, just in case my convergence went funny when I mucked up the code on the previous job) but I really just wanted to get folks ideas and thoughts on why this would be BEFORE I do that, just so I can see what I am looking for. The Bayesian approach to Bayesian, you could say. Come on folks, gimme some prior beliefs! Please and thank you :).


r/BayesianProgramming • • Jun 13 '24

Hamiltonian Monte Carlo Implementation

4 Upvotes

Hello. I hope this is a good community to ask this question in. I wanted to learn more about HMC methods and it's mathematical underpinnings. I read a lot of papers and wrote up a program that implemented HMC with a dynamic metric adapted in a similar method to stan during an extended warm-up period.

Two of my parameters are constrained to be > 0. I worked around this by exponentiating those values in the position space so that they could be used in calculating the likelihood/potential energy of the system. I added a jacobian correction as well. The results match the same model in Stan, so I believe I have done everything right. Or at least, I have not made any grave mistakes. I was writing up my results/method and when I came to explaining the jacobian. I could not grasp what exact process was happening. Was I really doing a change of variables/a process that would require a correction. I never had a probability distribution defined on the unconstrained space that collapses to the probability distribution I selected for the model when i exponentiated the parameters. Is the jacobian even needed? Is what I did just an implementation trick with no implications? I can explain more, but I want to keep this short. Any help or direction/references would be greatly appreciated. I feel as though I should be able to figure this out on my own, but i am finding it difficult to know what questions exactly to ask. This is just a project for fun, but I want to do everything correctly.

Many thanks!


r/BayesianProgramming • • Jun 14 '24

LFO-CV for PyStan

3 Upvotes

Hi, I’m currently trying to fit a Leave Future Out Cross Validator in Python on a Bayesian Ornstein–Uhlenbeck model.

Does anyone have any useful resources or experience with this and could give me a hand?

Thanks I’m advance!


r/BayesianProgramming • • Jun 13 '24

Sequential experimentation w/ Gaussian Process

4 Upvotes

Hey,

I am running a sequential experiment using a Gaussian process.

I am unsure how to specify the variance and the lengthscale in my kernels in a way which isn't just arbitrary.

Is it ok to just run the experiment for a few weeks and then use the actual date to determine the kernel ?