How to specify GP dependent on non-obsereved random walk

106 views Asked by At

I have a cyclical signal I would like to model. I would like to allow the signal to be able to stretch and compress in time, and I do not know the exact profile.

At the moment, I am modelling the phase progression as a random walk, and capturing the cyclical nature by defining the mean likelihood as a sum of sines and cosines on the phase, where the weights on the cosines are parameters to be fitted.

i.e.

y = N(f(phase),sigma) =  N(sum_i(a_i*sin(phase) + b_i*cos(phase)),sigma)

(i.e. latex image of above)

This seems to work to some extent, but I would like to change the definition of f so that it does not rely on sums of sin and cos.

I was looking at Gaussian Processes, and thinking that there could be a solution to this there - but I can't figure out how (if it's possible) to define the y in terms of phase when using GP.

There is an example on the pymc github site:

y_obs = pm.gp.GP('y_obs', cov_func=f_cov, sigma=s2_n, observed={'X':X, 'Y':y})

The problem here is that X is defined as observed, while I need to model it as a random variable.

I tried this form:

y_obs = pm.gp.GP('y_obs', X = phase , cov_func=f_cov, sigma=s2_n, observed={ 'Y':y})

But that leads to an error:

 File "/home/person/.conda/envs/mcmcx/lib/python3.6/site-packages/pymc3/distributions/distribution.py", line 56, in __init__
    raise TypeError("Expected int elements in shape")

I am new to HB/GP/pymc3... and even stackoverflow. Apologies if the question is off.

0

There are 0 answers