Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Guggisberg mikeguggis

  • Institute for Defense Analyses
  • Venice, CA
View GitHub Profile
@mikeguggis
mikeguggis / script.R
Last active Jul 28, 2018
Stack Exchange answer PR(X<Y|min(X,Y))
View script.R
library(MASS)
library(mvtnorm)
# Set parameters for generating simulated data
set.seed(1)
mu = c(.1,1.5)
Sigma = matrix(c(1.5,.5,.5,.7),2,2)
# Set minumum
m = 1
@mikeguggis
mikeguggis / sim.R
Last active Jul 9, 2018
Stack Exchange
View sim.R
library(MASS)
# Generate simulated data
set.seed(1)
mu = c(1,1.5)
Sigma = matrix(c(1.5,-.5,-.5,.7),2,2)
X = mvrnorm(10000000,mu,Sigma)
# Calculate pairwise minimums
mins = pmin(X[,1],X[,2])