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: :param investmentinfo: Investment information of a stock.
  :param data: Historical price data of a stock.
docstr_tok: [":","param","investmentinfo",":","Investment","information","of","a","stock",".",":","param","data",":","Historical","price","data","of","a","stock","."]
code: def __init__(
      self, investmentinfo: pd.DataFrame, data: pd.Series
  ) -> None:
      """
      :param investmentinfo: Investment information of a stock.
      :param data: Historical price data of a stock.
      """
      self.name = investmentinfo.Name
      self.investmentinfo = investmentinfo
      super().__init__(data, self.name, asset_type="Stock")
      # beta parameter of stock (CAPM)
      self.beta = None
      # R squared coefficient of stock
      self.rsquared = None
  
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 1 to create a new Stock object from inherited base classes: Asset with example: obj = Stock(investmentinfo, data)