Perform time-dependant model calibration

Thank you for your fast answer.

Sorry I did not put the entiere code in my first message. Here is my function run_simu(parameters)(I removed the unnecessary arguments z0, final_t, datesand give it a dictionnary of parameters as you suggested. In fact, I defined it totally independant from the pymc3 and Theano modules:

def run_simu(params):
    records = []
    z_t = z0
    for day in range(final_t):
        if day in dates:  # just to record the simulated values only when I have measures
            records.append(z_t)
        # my model equation
        z_t = z_t * params['theta2'] + np.sin(2 * np.pi * day / params['theta3']) + params['theta1']\
              * np.cos(2 * np.pi * z_t)
    return np.array(records)

When I call it now I get the same error as before.

If I don’t use the pm.Determinstic object and just call the function run_simu(parameters)troubles only come when I declare my likelihood function. I think the issue comes from the fact that this function is not consistent with Theano : the parameters are TransformedRV (\theta_1 and \theta_2) or FreeRV (\theta_3) objects, when I combine them in the loop I get Elemwise{add,no_inplace}.0objects that I store in an array which is returned. Maybe the mean of the Normal likelihood cannot be an array of Elemwise{add,no_inplace}.0, but then do you have an idea of what should be done to fix it ? Should I declare it with the theano.as_op decorator?

Thank you again.