class_docstr: Class that contains information about a stock/fund.
  
  :param investmentinfo: Investment information of a stock.
  :param data: Historical price data of a stock.
  
  The ``Stock`` class extends the ``Asset`` class and represents a specific type of asset,
  namely a stock within a portfolio.
  It requires investment information and historical price data for the stock to initialize an instance.
  
  In addition to the attributes inherited from the ``Asset`` class, the ``Stock`` class provides
  a method to compute the beta parameter and one to compute the R squared coefficient
  specific to stocks in a portfolio when compared to the market index.
class_docstr_tok: ["Class","that","contains","information","about","a","stock\/fund",".",":","param","investmentinfo",":","Investment","information","of","a","stock",".",":","param","data",":","Historical","price","data","of","a","stock",".","The","``","Stock","``","class","extends","the","``","Asset","``","class","and","represents","a","specific","type","of","asset",",","namely","a","stock","within","a","portfolio",".","It","requires","investment","information","and","historical","price","data","for","the","stock","to","initialize","an","instance",".","In","addition","to","the","attributes","inherited","from","the","``","Asset","``","class",",","the","``","Stock","``","class","provides","a","method","to","compute","the","beta","parameter","and","one","to","compute","the","R","squared","coefficient","specific","to","stocks","in","a","portfolio","when","compared","to","the","market","index","."]
docstr: Computes and returns the Beta parameter of the stock.
  
  :param market_daily_returns: Daily returns of the market index.
  
  :rtype: :py:data:`~.finquant.data_types.FLOAT`
  :return: Beta parameter of the stock
docstr_tok: ["Computes","and","returns","the","Beta","parameter","of","the","stock",".",":","param","market_daily_returns",":","Daily","returns","of","the","market","index",".",":","rtype",":",":","py",":","data",":","`","~.finquant.data_types.FLOAT","`",":","return",":","Beta","parameter","of","the","stock"]
code: def comp_beta(self, market_daily_returns: pd.Series) -> FLOAT:
      """Computes and returns the Beta parameter of the stock.
  
      :param market_daily_returns: Daily returns of the market index.
  
      :rtype: :py:data:`~.finquant.data_types.FLOAT`
      :return: Beta parameter of the stock
      """
      # Type validations:
      type_validation(market_daily_returns=market_daily_returns)
      cov_mat = np.cov(
          self.comp_daily_returns(),
          market_daily_returns.to_frame()[market_daily_returns.name],
      )
  
      beta = float(cov_mat[0, 1] / cov_mat[1, 1])
      self.beta = beta
      return beta
  
file_path: FinQuant/finquant/stock.py
imports: from typing import Optional
  import numpy
  import pandas
  from sklearn.metrics import r2_score
  from finquant.asset import Asset
  from finquant.data_types import FLOAT
  from finquant.type_utilities import type_validation
label_desc: Use image node_id 2 for calling the Stock obj's underlying member method code with example usage: obj.comp_beta(market_daily_returns) and returns: beta