Skip to content

Instantly share code, notes, and snippets.

import sys
from PySide2 import QtCore, QtGui, QtWidgets
class InitialCard(QtWidgets.QLabel):
def __init__(self, text, parent):
super(InitialCard, self).__init__(text, parent)
self.setAutoFillBackground(True)
self.setFrameStyle(QtWidgets.QFrame.WinPanel|QtWidgets.QFrame.Sunken)
newFont = QtGui.QFont("MsReferenceSansSerif", 10)
newFont.setBold(False)
@joezuntz
joezuntz / 3x2pt.ipynb
Created July 9, 2018 15:58
3x2pt pipeline example output
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joezuntz
joezuntz / counterintuitive-noise-correlations.ipynb
Last active May 18, 2018 14:54
Correlating noise can improve constraints
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joezuntz
joezuntz / homework.py
Last active November 22, 2021 15:35
Homework code for Joe Zuntz problem
import numpy as np
from scipy.special import comb, factorial
from numpy import log
n_det = 10
# All the probability functions here are actually log probabilities.
# Priors
@joezuntz
joezuntz / truncated-exponential-sampling.ipynb
Last active February 22, 2017 10:56
Truncated Exponential Sampling With Negative Beta allowed
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
AVROculusTimeline timeline;
AVROculus * main_loop;
// add main_loop to the AVROculusTimeline object.
// add
// give the main oculus object a vector (and hold on to the vector to keep it alive)
// and a timeline. Add a method to populate both.
// write the transitionTo function
// add stub translateTo
#include <vector>
#include <stddef.h>
#include <time.h>
#define ENDED_TIMELINE_ENTRY -1
#define EMPTY_TIMELINE_ENTRY 0
typedef struct timeline_entry{
int type;
double timepoint;

Some guidelines for statisticians/mathematicians writing samplers and minimizers if they want them to be useful to scientists.

  • We don't need bespoke, highly-trained algorithms: we need general methods that need minimal human supervision.
  • If your algorithm isn't parallel then it is unlikely to be useful (we have a lot of CPUs).
  • We don't have the derivative of the likelihood in most cases. It's hard enough calculating the likelihood itself.
  • Dumb down the paper a little for us; we spend most of our time doing other things.
  • If you supply some code along with your algorithm we are vastly more likely to at least give it a try.
  • Write your code in Python or C (or maybe C++ if you must). We need to integrate your it into more general frameworks, not statistical toolboxes.
  • Write your code as a library that we can call from our own programmes, not as a top-level program on its own.
  • Don't do I/O yourself in your code. We'll handle that, just return some samples/values/metadata/whatever.