inference.R

First hack at phased lgs