class_docstr: Test Annualized Volatility
class_docstr_tok: ["Test","Annualized","Volatility"]
docstr: Check volatility results against values calculated manually
docstr_tok: ["Check","volatility","results","against","values","calculated","manually"]
code: def test_volatility(self):
      """
      Check volatility results against values calculated manually
      """
      nassets = 3
      ann_vol = AnnualizedVolatility()
      today = pd.Timestamp("2016", tz="utc")
      assets = np.arange(nassets, dtype=np.float64)
      returns = np.random.normal(
          loc=0.001, scale=0.01, size=(ann_vol.window_length, nassets)
      )
      out = np.empty(shape=(nassets,), dtype=np.float64)
      ann_vol.compute(today, assets, out, returns, 252)
  
      mean = np.mean(returns, axis=0)
      annualized_variance = (
          ((returns - mean) ** 2).sum(axis=0) / returns.shape[0] * 252
      )
      expected_vol = np.sqrt(annualized_variance)
  
      np.testing.assert_almost_equal(out, expected_vol, decimal=8)
  
imports: from __future__ import division
  from nose_parameterized import parameterized
  from six.moves import range
  import numpy
  import pandas
  import talib
  from numpy.random import RandomState
  from zipline.lib.adjusted_array import AdjustedArray
  from zipline.pipeline.data import USEquityPricing
  from zipline.pipeline.factors import BollingerBands, Aroon, FastStochasticOscillator, IchimokuKinkoHyo, LinearWeightedMovingAverage, RateOfChangePercentage, TrueRange, MovingAverageConvergenceDivergenceSignal, AnnualizedVolatility, RSI
  from zipline.testing import check_allclose, parameter_space
  from zipline.testing.fixtures import ZiplineTestCase
  from zipline.testing.predicates import assert_equal
  from .base import BaseUSEquityPipelineTestCase
label_desc: Use image node_id 2 for calling the AnnualizedVolatilityTestCase obj's underlying member method code with example usage: obj.test_volatility() without return types