Skip to content

Instantly share code, notes, and snippets.

;; gorilla-repl.fileformat = 1
;; **
;;; # Interventional Operator
;;;
;;; This example shows how to implement an interventional operator (the 'do' operator from the causal literature, but the name was already taken in closure).
;;;
;;; Once we define a model, the _do_ operator represents external interventions to the model. As we are writing the model, there is nothing that forbids us of writing the same model (queries) with the required intervention. The problem with that approach is that we end up duplicating the model’s logic. To solve this problem, we could implement the intervention as an operator, i.e., a function from the space of queries to the space of queries.
;;;
;;; In this Worksheet we are going to use the famous _sprinkler_ example.
@jburroni
jburroni / all_instances.ipynb
Created August 31, 2016 05:55
a metaclass for python that keep tracks of created classes and instances. So, when one modifies a class, all the instantiated instances will refer to this new class
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jburroni
jburroni / plot_complex_inequalities.ipynb
Created March 29, 2016 15:45
Plot complex inequealities
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jburroni
jburroni / plots_complex_inequalities.ipynb
Created March 29, 2016 15:20
Plots complex inequalities using ipython
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
###Author: Javier Burroni
###Creation: March 2016
###Please give credit when using this code
import matplotlib
matplotlib.use('Agg')
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
@jburroni
jburroni / gist:ea5edf39faae41953a04
Created July 8, 2015 22:52
analisis elecciones
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
@jburroni
jburroni / gist:3805dd69ea46f357d6e5
Created April 12, 2015 19:03
international trade blocks
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
@jburroni
jburroni / gist:5ffab703075d26c12e5e
Last active August 29, 2015 14:18
Trade Block by Iterations
Iteration Trade Blocks
0
Canada, USA
1
Malaysia, Singapore
Brazil, Argentina
Neth.Ant.Aru, Venezuela
China, China HK SAR
Germany, France,Monac