Quotient™ Makes Factor Construction Transparent

Jan 20, 2022 | Uncategorized

Quotient makes factor construction transparent through what we call the “lineage” functionality. With the lineage functionality, users can specify the raw data item components of a derived data item to be returned along with the computation of a derived data item. Displaying the raw data item components helps factor builders determine if the derived data item is being computed correctly or if adjustments are appropriate.

The following 18 Python code statements example is used to illustrate construction of a sales to enterprise value factor in Quotient using the lineage functionality. The following statements are as would be actual coded in Quotient minus the statement number, which is being used to refer to specific statements for this illustration. Statements 1-6, 15, 17, and 18 are core statements to create a sales to enterprise value factor in Quotient. Those statements were the subject of our last blog, Quotient Makes Factor Construction Easy. In this blog, we will only focus on the incremental statements that facilitate the lineage functionality.

(1) root_lib = RootLib()

(2) root_lib.set_control(‘ignore_mult’, False)

(3) root_lib.set_control(‘ignore_add’, ‘right’)

(4) datastream = root_lib[‘Datastream’]

(5) reuters_fnd = root_lib[‘Reuters Fnd (CFT)’]

(6) sales_sum4q = reuters_fnd[‘SALES_FI’].msum1d(4, ‘Fiscal’, ignore_missing=False)

Statements 7 and 8 set up the controls that allow the data container to store multiple variables or what we call a multi-variant Quble. Statement 7 instructs Quotient to add component variables as unions so that members of either data set are all included. If the control option had been set to intersection, then only members of both data sets are included in the combined Quble. Statement 8 treats each component Quble as univariant so that only the primary data variable, or what we call a valuespace, is added to lineage multi-variant Quble. Statement 9 creates an open Quble that will be used to store our component variables and names the Quble ‘sales2ev.’

(7) RootLib().set_control(‘keys_join_op’,’union’)

(8) RootLib().set_control(‘variate_mode’,’uni’)

(9) sales2ev = Quble.undefined_instance()

Statement 10 loads Datastream sourced monthly market capitalization in the ‘sales2ev’ Quble into a variable, what we call a valuespace, called ‘MKTCAP.’ At this point, the ‘sales2ev’ Quble is a univariate Qubles since it has only 1 valuespace. We want the final multi-variant ‘sales2ev’ Quble to return monthly a sales to enterprise value factor, ‘sales2ev,’ with its component raw data items monthly. We will load the monthly market capitalization, ‘MKTCAP_M,’ first into the ‘sales2ev’ Quble in order to make the Quble a monthly calendar Quble.

(10) sales2ev[‘MKTCAP’] = datastream[‘MKTCAP_M’]

Statements 11-13 load component raw data items, long term debt ‘LTD_FI’, balance sheet cash

‘CASH_FI’, and last quarter’s sales ‘SALES_FI’, respectively, from Reuters Fundamentals into the now multi-variant ‘sales2ev’ Quble. All of these data items are automatically being convert from fiscal quarterly time into calendar time by Quotient. This automatic conversion is due to ‘MKTCAP’ valuespace being in monthly calendar time.

(11) sales2ev[‘LTD’] = reuters_fnd[‘LTD_FI’]

(12) sales2ev[‘CASH’] = reuters_fnd[‘CASH_FI’]

(13) sales2ev[‘SALES’] = reuters_fnd[‘SALES_FI’]

Statement 14 loads component derived data item last 4 quarters’ sales, ‘sales_sum4q,’ into the multi- variant ‘sales2ev’ Quble. The last 4 quarters’ sales, ‘sales_sum4q,’ was derived in statement 6. The last 4 quarters’ sales, ‘sales_sum4q’, will automatically be converted from fiscal time to monthly calendar time.

(14) sales2ev[‘SALES_SUM4Q’] = sales_sum4q

(15) ev = datastream[‘MKTCAP_M’] + reuters_fnd[‘LTD_FI’] – reuters_fnd[‘CASH_FI’]

Statement 16 loads enterprise value, ‘ev,’ into the multi-variant ‘sales2ev’ Quble. The enterprise value, ‘ev,’ was derived in Statement 15. It too will be automatically be converted from fiscal time to monthly calendar time.

(16) sales2ev[‘EV’] = ev

Statement 17 computes the final sales to enterprise value factor, ‘SALES2EV,’ and stores the final values in the multi-variant ‘sales2ev’ Quble in a valuespace named ‘SALES2EV’. Since ‘SALES2EV’ is the last variable being added to the multi-variant Quble, ‘SALES2EV’ will be treated as the primary variable or valuespace in the Quble.

(17) sales2ev[‘SALES2EV’] = sales_sum4q / ev

(18) return sales2ev

The resulting multi-variant ‘sales2ev’ Quble returns the sales to enterprise value factor, ‘SALES2EV,’ along with its lineage components, market capitalization ‘MKTCAP,’ long term debt ‘LTD,’ cash ‘CASH,’ quarterly sales ‘SALES,’ derived data item last 4 quarters’ sales ‘SALES_SUM4Q,’ and derived data item enterprise value ‘EV.’

The following screen snapshot displays the output of the resulting multivariate ‘sales2ev’ Quble:

Discover the future of financial data analysis

Watch a free demonstration of Quotient™, our flagship financial data analysis product.