I have a time-series that I want to do time series forecasting on, such as using facebook prophet. However, my timeseries datapoints are not single floats, but rather a distribution(with mean and uncertainties). Is there a way to do time-series forecasting on such a dataset?
Thank you for answering
That’s an interesting problem. I’ve done something a little like that before. The code below fits an AR1 model where the observed data points are distributions, not points. The basic idea is to avoid using the
observed argument and use the distributions as priors on latent variables.
import pymc3 as pm
import numpy as np
import matplotlib.pyplot as plt
n = 20
random_sds = np.exp(np.random.randn(20))
random_means = np.random.randn(20)
with pm.Model() as model:
k = pm.Uniform('k')
tau = pm.Gamma('tau',alpha=0.1,beta=0.1)
y = pm.AR1('y',k=k, tau_e=tau, shape=n)
x = pm.Normal('x', mu=y-random_means, sd=random_sds, shape=n)
trace = pm.sample(cores=1,chains=1)