class_docstr: Builds Approximation instance from a given trace,
  it has the same interface as variational approximation
class_docstr_tok: ["Builds","Approximation","instance","from","a","given","trace",",","it","has","the","same","interface","as","variational","approximation"]
code: def create_shared_params(
      self, trace=None, size=None, jitter=1, start=None
  ):
      if trace is None:
          if size is None:
              raise opvi.ParametrizationError(
                  "Need `trace` or `size` to initialize"
              )
          else:
              start = self._prepare_start(start)
              # Initialize particles
              histogram = np.tile(start, (size, 1))
              histogram += pm.floatX(
                  np.random.normal(0, jitter, histogram.shape)
              )
      else:
          histogram = np.empty(
              (len(trace) * len(trace.chains), self.ddim)
          )
          i = 0
          for t in trace.chains:
              for j in range(len(trace)):
                  histogram[i] = DictToArrayBijection.map(
                      trace.point(j, t)
                  ).data
                  i += 1
      return dict(
          histogram=pytensor.shared(pm.floatX(histogram), "histogram")
      )
  
imports: from typing import Optional
  import numpy
  import pytensor
  from arviz import InferenceData
  from pytensor import tensor
  from pytensor.graph.basic import Variable
  from pytensor.graph.replace import graph_replace
  from pytensor.tensor.variable import TensorVariable
  import pymc
  from pymc.blocking import DictToArrayBijection
  from pymc.distributions.dist_math import rho2sigma
  from pymc.util import makeiter
  from pymc.variational import opvi
  from pymc.variational.opvi import Approximation, Group, NotImplementedInference, _known_scan_ignored_inputs, node_property
label_desc: Use image node_id 2 for calling the EmpiricalGroup obj's underlying member method code with example usage: obj.create_shared_params(trace, size, jitter, start) and returns: dict