class_docstr: An object to perform a Monte Carlo run/simulation.
class_docstr_tok: ["An","object","to","perform","a","Monte","Carlo","run\/simulation","."]
docstr: :param fun: Function to call at each iteration of the Monte Carlo run.
  
  :param kwargs: (optional) Additional arguments that are passed to ``fun``.
  
  :result: Array of quantities returned from ``fun`` at each iteration.
docstr_tok: [":","param","fun",":","Function","to","call","at","each","iteration","of","the","Monte","Carlo","run",".",":","param","kwargs",":","(","optional",")","Additional","arguments","that","are","passed","to","``","fun","``",".",":","result",":","Array","of","quantities","returned","from","``","fun","``","at","each","iteration","."]
code: def run(
      self, fun: Callable[..., Any], **kwargs: Dict[str, Any]
  ) -> np.ndarray[np.float64, Any]:
      """
      :param fun: Function to call at each iteration of the Monte Carlo run.
  
      :param kwargs: (optional) Additional arguments that are passed to ``fun``.
  
      :result: Array of quantities returned from ``fun`` at each iteration.
      """
      # Type validations:
      type_validation(fun=fun)
      result = []
      for _ in range(self.num_trials):
          res = fun(**kwargs)
          result.append(res)
      return np.asarray(result, dtype=np.ndarray)
  
file_path: FinQuant/finquant/monte_carlo.py
imports: from typing import Any, Callable, Dict, Optional, Tuple
  import matplotlib.pylab
  import numpy
  import pandas
  from finquant.data_types import FLOAT, INT
  from finquant.quants import annualised_portfolio_quantities
  from finquant.type_utilities import type_validation
label_desc: Use image node_id 2 for calling the MonteCarlo obj's underlying member method code with example usage: obj.run(fun) and returns: np