Custom likelihood with stochastic volatility

Dear all,

I faced some error during sample posterior predictive.
The error that I faced is as follow:
ValueError: Distribution was not passed any random method. Define a custom random method and pass it as kwarg random

Below is my code:

import numpy as np
import pandas as pd
import datetime as dt
from pandas_datareader import data
import matplotlib.pyplot as plt
%matplotlib inline

np.random.seed(1000000) #Who wants to be a millionaire

start, end = dt.datetime(2014, 1, 1), dt.datetime(2015, 12, 31)
sp500 = data.DataReader(’^GSPC’,‘yahoo’, start, end).loc[:,‘Close’]

#train, test = np.arange(0, 450), np.arange(451,509)

returns = np.log(sp500[1:] / sp500[0:-1].values) # Calculate log returns
n=len(returns)-1
plt.plot(returns)

import pymc3 as pm
with pm.Model() as model:

y_obs_last = pm.Data('y_obs_last', returns[1:])

def custom_likelihood(y_obs_last, y_obs):
    expected = y_obs_last + corr
    return pm.StudentT.dist(nu=nu, mu=expected, lam=1/np.exp(-2*corr)).logp(y_obs)

sigma = pm.Exponential('sigma', 1./.02, testval=.1)
mu = pm.Normal('mu', 0, sd=5, testval=.1)

nu = pm.Exponential('nu', 1./10)
corr = pm.GaussianRandomWalk('corr', tau=sigma**-2, shape=n)

r = pm.DensityDist('r', custom_likelihood, observed={'y_obs_last': returns[1:], 'y_obs': returns[:-1]}) 

with model:
start = pm.find_MAP(vars=[corr], method=“L-BFGS-B”)

with model:
step = pm.NUTS(vars=[corr, mu, nu,sigma],scaling=start, gamma=.25)
start2 = pm.sample(100, step, start=start)[-1]

# Start next run at the last sampled position.
step = pm.NUTS(vars=[corr, mu, nu,sigma],scaling=start2, gamma=.55)
trace = pm.sample(2000, step, start=start2)

with model:
y_test = pm.sample_posterior_predictive(trace, 500)

May I know how to solve this error?
Thanks in advance