class_docstr: More careful tests that sampling/preconditioning is actually working.
class_docstr_tok: ["More","careful","tests","that","sampling\/preconditioning","is","actually","working","."]
docstr: Calculate the (asymptotic) expected step size for given scales/P[accept].
  
  The distribution should be a multivariate Gaussian, and the approximation is
  appropriate in high dimensions when the spectrum is polynomially decreasing.
  For details, see [1], equations (3.1, 3.2).
  
  Args:
    scales: Tensor with the square roots of the eigenvalues of the
      covariance matrix.
    prob_accept: Average acceptance probability.
  
  Returns:
   step_size: Float of approximate step size to achieve the target acceptance
     rate.
  
  #### References
  
  [1]: Langmore, Ian, Michael Dikovsky, Scott Geraedts, Peter Norgaard, and
       Rob Von Behren. 2019. “A Condition Number for Hamiltonian Monte Carlo."
       http://arxiv.org/abs/1905.09813.
docstr_tok: ["Calculate","the","(","asymptotic",")","expected","step","size","for","given","scales\/P","[","accept","]",".","The","distribution","should","be","a","multivariate","Gaussian",",","and","the","approximation","is","appropriate","in","high","dimensions","when","the","spectrum","is","polynomially","decreasing",".","For","details",",","see","[","1","]",",","equations","(","3.1",",","3.2",")",".","Args",":","scales",":","Tensor","with","the","square","roots","of","the","eigenvalues","of","the","covariance","matrix",".","prob_accept",":","Average","acceptance","probability",".","Returns",":","step_size",":","Float","of","approximate","step","size","to","achieve","the","target","acceptance","rate",".","#","#","#","#","References","[","1","]",":","Langmore",",","Ian",",","Michael","Dikovsky",",","Scott","Geraedts",",","Peter","Norgaard",",","and","Rob","Von","Behren",".","2019",".","\u201c","A","Condition","Number","for","Hamiltonian","Monte","Carlo",".","''","http",":","\/\/arxiv.org\/abs\/1905.09813","."]
code: def _calculate_asymptotic_step_size(self, scales, prob_accept):
      """Calculate the (asymptotic) expected step size for given scales/P[accept].
  
      The distribution should be a multivariate Gaussian, and the approximation is
      appropriate in high dimensions when the spectrum is polynomially decreasing.
      For details, see [1], equations (3.1, 3.2).
  
      Args:
        scales: Tensor with the square roots of the eigenvalues of the
          covariance matrix.
        prob_accept: Average acceptance probability.
  
      Returns:
       step_size: Float of approximate step size to achieve the target acceptance
         rate.
  
      #### References
  
      [1]: Langmore, Ian, Michael Dikovsky, Scott Geraedts, Peter Norgaard, and
           Rob Von Behren. 2019. “A Condition Number for Hamiltonian Monte Carlo."
           http://arxiv.org/abs/1905.09813.
      """
      inv_nu = tf.reduce_sum((1.0 / scales) ** 4, axis=-1) ** -0.25
      step_size = (
          inv_nu
          * (2**1.75)
          * tf.sqrt(
              normal.Normal(0.0, 1.0).quantile(1 - prob_accept / 2.0)
          )
      )
      return step_size
  
imports: import collections
  from absl.testing import parameterized
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import reshape
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import joint_distribution_sequential
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import mvn_linear_operator
  from tensorflow_probability.python.distributions import mvn_tril
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import wishart
  from tensorflow_probability.python.experimental.distributions import mvn_precision_factor_linop
  from tensorflow_probability.python.experimental.mcmc import preconditioned_hmc
  from tensorflow_probability.python.internal import auto_composite_tensor
  from tensorflow_probability.python.internal import distribute_lib
  from tensorflow_probability.python.internal import distribute_test_lib
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import unnest
  from tensorflow_probability.python.mcmc import diagnostic
  from tensorflow_probability.python.mcmc import dual_averaging_step_size_adaptation
  from tensorflow_probability.python.mcmc import sample
  from tensorflow_probability.python.mcmc import simple_step_size_adaptation
  from tensorflow_probability.python.mcmc import transformed_kernel
  from tensorflow_probability.python.mcmc.internal import leapfrog_integrator
  from tensorflow_probability.python.stats import sample_stats
label_desc: Use image node_id 1 for calling the PreconditionedHMCCorrectnessTest obj's underlying member method code with example usage: obj._calculate_asymptotic_step_size(scales, prob_accept) and returns: step_size