class_docstr: Stochastic model of asset price volatility over time.
  
  Compared to the `StochasticVolatility` model, this uses vectorized math and is
  significantly faster by default. The model assumes that asset prices follow a
  random walk, in which the volatility---the variance of the day-to-day
  returns---is itself changing over time. The volatility is assumed to evolve as
  an AR(1) process with unknown coefficient and white noise shock scale.
  
  ```none
  
  persistence_of_volatility ~ 2 * Beta(concentration1=20,
                                       concentration0=1.5) - 1.
  mean_log_volatility ~ Cauchy(loc=0, scale=5)
  white_noise_shock_scale ~ HalfCauchy(loc=0, scale=2)
  
  # Order-1 autoregressive process on log volatility.
  log_volatility[0] ~ Normal(
      loc=0,
      scale=white_noise_shock_scale / sqrt(1 - persistence_of_volatility**2))
  for t in range(1, num_timesteps):
    log_volatility[t] ~ Normal(
        loc=persistence_of_volatility * log_volatility[t - 1],
        scale=white_noise_shock_scale)
  
  for t in range(num_timesteps):
    centered_returns[t] ~ Normal(
      loc=0, scale=sqrt(exp(mean_log_volatility + log_volatility[t])))
  ```
  
  This class allows two different parameterizations of the `log_volatility`
  random variable, controlled by the `centered` argument to the initializer. The
  `centered=True` variant is as described in the block above, while the
  `centered=False` variant replaces the `log_volatility` random variable with
  `std_log_volatility` which has an standard isotropic multivariate normal
  prior. Realizations of that variable are thereafter transformed.
  
  The `centered=False` variant is significantly simpler to do inference on due
  to a more favorable posterior.
  
  #### References
  
  [1] <https://mc-stan.org/docs/2_23/stan-users-guide/
      stochastic-volatility-models.html>
class_docstr_tok: ["Stochastic","model","of","asset","price","volatility","over","time",".","Compared","to","the","`","StochasticVolatility","`","model",",","this","uses","vectorized","math","and","is","significantly","faster","by","default",".","The","model","assumes","that","asset","prices","follow","a","random","walk",",","in","which","the","volatility","--","-the","variance","of","the","day-to-day","returns","--","-is","itself","changing","over","time",".","The","volatility","is","assumed","to","evolve","as","an","AR","(","1",")","process","with","unknown","coefficient","and","white","noise","shock","scale",".","``","`","none","persistence_of_volatility","~","2","*","Beta","(","concentration1=20",",","concentration0=1.5",")","-","1.","mean_log_volatility","~","Cauchy","(","loc=0",",","scale=5",")","white_noise_shock_scale","~","HalfCauchy","(","loc=0",",","scale=2",")","#","Order-1","autoregressive","process","on","log","volatility",".","log_volatility","[","0","]","~","Normal","(","loc=0",",","scale=white_noise_shock_scale","\/","sqrt","(","1","-","persistence_of_volatility","*","*","2",")",")","for","t","in","range","(","1",",","num_timesteps",")",":","log_volatility","[","t","]","~","Normal","(","loc=persistence_of_volatility","*","log_volatility","[","t","-","1","]",",","scale=white_noise_shock_scale",")","for","t","in","range","(","num_timesteps",")",":","centered_returns","[","t","]","~","Normal","(","loc=0",",","scale=sqrt","(","exp","(","mean_log_volatility","+","log_volatility","[","t","]",")",")",")","``","`","This","class","allows","two","different","parameterizations","of","the","`","log_volatility","`","random","variable",",","controlled","by","the","`","centered","`","argument","to","the","initializer",".","The","`","centered=True","`","variant","is","as","described","in","the","block","above",",","while","the","`","centered=False","`","variant","replaces","the","`","log_volatility","`","random","variable","with","`","std_log_volatility","`","which","has","an","standard","isotropic","multivariate","normal","prior",".","Realizations","of","that","variable","are","thereafter","transformed",".","The","`","centered=False","`","variant","is","significantly","simpler","to","do","inference","on","due","to","a","more","favorable","posterior",".","#","#","#","#","References","[","1","]","<","https",":","\/\/mc-stan.org\/docs\/2_23\/stan-users-guide\/","stochastic-volatility-models.html",">"]
code: def _log_likelihood(self, value):
      return self._log_likelihood_fn(value)
  
imports: import collections
  import tensorflow.compat.v2
  import tensorflow_probability
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import prefer_static
  from inference_gym.internal import data
  from inference_gym.targets import bayesian_model
  from inference_gym.targets import model
  from inference_gym.targets.ground_truth import stochastic_volatility_log_sp500
  from inference_gym.targets.ground_truth import stochastic_volatility_log_sp500_small
  from inference_gym.targets.ground_truth import stochastic_volatility_sp500
  from inference_gym.targets.ground_truth import stochastic_volatility_sp500_small
label_desc: Use image node_id 3 for calling the VectorizedStochasticVolatility obj's underlying member method code with example usage: obj._log_likelihood(value) and returns: self