I read recently the lecture:Fundamental Factor Models and find followings:
class MarketCap(CustomFactor):
# Here's the data we need for this factor
inputs = [morningstar.valuation.shares_outstanding, USEquityPricing.close]
# Only need the most recent values for both series
window_length = 1
def compute(self, today, assets, out, shares, close_price):
# Shares * price/share = total price = market cap
out[:] = shares * close_price
I wonder why it's so "complicated" to calculate the 'market cap'? In the 'Fundamental Reference' there is 'market_cap'. Why hasn't done as follow:
class MarketCap(CustomFactor):
inputs = [morningstar.valuation.market_cap]
window_length = 1
def compute(self, today, assets, out, mkt_cap):
out[:] = mkt_cap
I am wondering...