In my research work, I have written R functions which are useful in finance research. These are:
i) pdshare:
This function can be used to estimate the two most widely used approaches to measure price discovery: Information Share (Hasbrouck, 1995) and Component Share (Gonzalo-Granger, 1995). The function computes the share of a market in price discovery. The methodology is currently implemented for a bi-variate case only.
ii) dtd:
This function implements the Merton Model (1974) to derive the measure 'Distance to default' which can be used to assess the credit risk of a firm. The measure indicates how far is the firm from its default point.
These R functions are a part of 'ifrogs' package which can be downloaded from the GitHub repository.