I have a model for which I want to wrap some PyMC around. However, the only way to interface with this model (written in Fortran) is with txt files - I need to write a specific txt file and then have the fortran call that, the ouputs of which get called by my Python (I realize this is not efficient and it is not my final product, but I wanted to get the MCMC figured out before I started dissecting the fortran). I have a lot of experience with pymc2 but am starting brand new with pymc3 and its Theano structures. I have realized that I currently don’t have a good way to write out the value of pymc variables in an individual realization in a string. How would I get that information? Chopped up code of what I want to do can be found below:
rinf = pymc3.Lognormal('rinf',mu = np.log(self.rinf), sd = 0.5*np.log(10)) #
rinf_send = T.cast(rinf,dtype='float64').eval() #not correct, but roughly what I think I am supposed to do
towrite="""
%0.3f RINF """ %(rinf_send)
file.write(towrite)
Can someone help me figure out what that second line is actually supposed to be? I have not had much luck in my searches thus far…
Thank you in advance.