I am interested in creating a list / array of functions "G" consisting of many small functions "g". This, essentially, should correspond to a series of “evolving” functions over time.
Each "g" takes two variables and returns the product of these variables with an external global variable indexed at the same step.
Assume that obs_mat(T x 1) is a predefined global array and tcorresponds to time steps
G = []
for t in range(T):
def g(current_state, observation_noise):
obs = obs_mat[t]
return current_state * observation_noise * obs
G.append(g)
Unfortunately, when I test the resulting functions, they do not seem to understand the difference in a constant that changes over time obs, i.e. (Got G[0](100,100)the same as G[5](100,100)). I tried to play with volume obs, but without much luck. Can anyone help me in the right direction?
source
share