code: def apply_parameters(self, g, df, initialization_trace=None):
      for node in nx.topological_sort(g):
          parent_names = g.nodes()[node]["parent_names"]
          if parent_names:
              if not initialization_trace:
                  sd = np.array(
                      [df[node].std()]
                      + (
                          df[node].std() / df[parent_names].std()
                      ).tolist()
                  )
                  mu = np.array(
                      [df[node].std()]
                      + (
                          df[node].std() / df[parent_names].std()
                      ).tolist()
                  )
                  node_sd = df[node].std()
              else:
                  node_sd = initialization_trace[
                      "{}_sd".format(node)
                  ].mean()
                  mu = initialization_trace[
                      "beta_{}".format(node)
                  ].mean(axis=0)
                  sd = initialization_trace["beta_{}".format(node)].std(
                      axis=0
                  )
              g.nodes()[node]["parameters"] = pm.Normal(
                  "beta_{}".format(node),
                  mu=mu,
                  sd=sd,
                  shape=len(parent_names) + 1,
              )
              g.nodes()[node]["sd"] = pm.Exponential(
                  "{}_sd".format(node), lam=node_sd
              )
      return g
  
file_path: dowhy/dowhy/do_samplers/mcmc_sampler.py
imports: from typing import List
  import networkx
  import numpy
  import pymc3
  from dowhy import EstimandType
  from dowhy.do_sampler import DoSampler
label_desc: Use image node_id 4 for calling the McmcSampler obj's underlying member method code with example usage: obj.apply_parameters(g, df, initialization_trace) and returns: g