Skip to content

Instantly share code, notes, and snippets.

View mobeets's full-sized avatar

Jay H mobeets

View GitHub Profile

Chana Masala

Prep time: 15 mins Cooking time: 40-45 mins Serves: 4

Ingredients:

  • 2 Onions - sliced finely
  • 4 cloves of garlic - chopped finely (or crushed)
@mobeets
mobeets / random_cribbage.py
Created June 17, 2018 03:03
estimating what percentage of cribbage games are winnable by random play
import itertools
import numpy as np
# https://github.com/relsqui/pydeck
from pydeck import standard, cribbage
CARDS_PER_DEAL = 6
CARDS_PER_HAND = 4
POINTS_TO_WIN = 121
VERBOSE = False
0.620713 0.463101 0.869851 0.610158 0.702451 0.767094
0.797397 0.441206 0.753544 0.679309 0.524256 0.752844
0.58715 0.137027 0.938175 0.590607 0.840056 0.652926
0.176337 0.909013 0.356048 0.306722 0.134125 0.669478
0.790946 0.155954 0.173121 0.310723 0.989607 0.294101
0.620713 0.463101 0.869851 0.610158 0.702451 0.767094
0.797397 0.441206 0.753544 0.679309 0.524256 0.752844
0.58715 0.137027 0.938175 0.590607 0.840056 0.652926
0.176337 0.909013 0.356048 0.306722 0.134125 0.669478
0.790946 0.155954 0.173121 0.310723 0.989607 0.294101
@mobeets
mobeets / ferguson.md
Last active August 29, 2015 14:12
questions to ask next time someone makes definitive or latently racist comments about Ferguson

The following questions can be asked of people (e.g., family members) who somehow manage to form simple opinions about very complex events.

Q1. Where have you learned about the event? First-hand? Or second-hand, through the media?

Q2. Have you ever sought out news about the event?

For example, have you ever had a question about the event and then sought an answer yourself, or do you learn about it as presented via friends and/or the media?

Q3. Have you tried your best to consider the perspective of both sides involved? If so, is there a benefit to you personally in arriving at a definitive opinion?

@mobeets
mobeets / CMU_Pitt.md
Last active August 29, 2015 14:07
neuroscience/statistics programs

Programs

tl;dr: 1) apply to PhD in: stats/neuro, 2) stats; 3) apply to CNBC program

PhD in Statistics and Neural Computation: This degree is aimed at students who want to join the PNC program, while also specializing in statistics.

Ph.D. Program in Neural Computation: a graduate training program in computational neuroscience for students seeking training in the application of quantitative approaches to the study of the brain.

CNBC Grad Training Program: to be admitted to the CNBC Training Program, students must have been accepted into one of the affiliated doctoral programs at either the University of Pittsburgh or Carnegie Mellon. For students applying from outside the two universities, applications to the doctoral program and the CNBC program may be submitted simultaneously. n.b. not a degree-granting program but I still need to apply

@mobeets
mobeets / journal.md
Last active August 29, 2015 14:07
journal management ideas

Workflow

  1. Command line jrn creates file (from template if desired) for specified day, date range, file format
  2. Daily builds
  • inputs: *.rtf, *.txt, *.md, *.html, *.png. *.jpeg
  • output: *.md
  • dirs: Journal/ -> _posts/
  • update _data/counts.json
  1. Jekyll template for viewing/searching posts
@mobeets
mobeets / outline.md
Last active August 29, 2015 14:07
Using Gibbs to fit state-space model with point process observations

Paper: Markov Chain Monte Carlo Methods for State-Space Models with Point Process Observations

Model

  • P(Y_k | X_k, mu, beta) ~ Poisson(lambda_k)
  • lambda_k = exp(mu + beta*X_k)
  • x_k = px_{k-1} + alphaI_k + e_k

where e_k normally distributed with zero mean and known variance; also, I, alpha, and beta are known.

@mobeets
mobeets / neuro.md
Last active August 29, 2015 14:06
neuroscience lists
@mobeets
mobeets / ffbs.md
Last active August 29, 2015 14:06
Gibbs sampling to estimate AR(1) model parameters

Gibbs sampling to estimate AR(1) model parameters.

Source: SSC 389: AR(1) + noise

Definitions

  • Xt is hidden state at time t
  • Yt is observed state at time t
  • Dt is information known at time t, i.e. {Y1, ..., Yt}
  • T is length of X, Y, D
@mobeets
mobeets / snr.md
Last active August 29, 2015 14:05
Q: Why does calculating SNR involve squaring the signal strength?

Definitions

SNR = Power(signal) / Power(noise)

Power(x(t)) = average Energy(x(t)) over all t

Energy(x(t)) = the area under |x(t)|^2

(Energy/power involve squaring the signal because you are interested in the magnitude of the signal and not just its amplitude. That's it.)