Table of Contents


absorption_ratio - ar - Calculates the absorption ratio for a time series of asset returns based on Kritzman et al. (2010)

balance_loan - balance_loan - calculates the current loan value for a home at time t initially purchased in vintage i.

calc_closeness - calc_closeness - Calculates the closeness of a node in a network based on Billio et al. (2010)

calc_value_house - calc_value_house - Calculates the value of a house at time t with t beginning at begin_time.

cca - cca - calculates the difference between put price and CDS price to determine company contribution to systemic risk based on Grey et al. (2010).

cca_fun - cca_fun - Helper function to solve the system of non-linear equations in CCA

contrarian_trading_strategy - contrarian_trading_strategy - calculates the cumulative return of the contrarian trading strategy.

co_risk - co_risk - calculates the conditional co-risk between two institutions

credit_funding_shock - credit_funding_shock - Chan-Lau et al. (2009) simulates credit funding shock on banking system.

crowded_trades - crowded_trades - calculates the crowdedness per factor using definition 1 or definition 2 in Pojarliev et al. (2011).

dar - ar_shift - Calculates the standardized AR shift from AR based on Kritzman et al. (2010)

dateFromIndex - Returns Date string corresponding to an index into a 12 x 122 array of months and years (1919-2040).

default_insurance_premium - dip - Calculated the default insurance premium based on Huang et al. (2009).

delta_co_var - delta_co_var - Calculates the marginal contribution (delta CoVaR) of an institution to systemic risk.

dijkstra - dijkstra - Implements the Dijkstra algorithm and returns the distance from a single vertex to all others, but does not save the path.

directed_banking_linkages - directed_banking_linkages - Calculates the directed network of banking linkages for n countries between two time instants t1 and t2 based on Fender and McGuire (2010)

dynamic_causality_index - dynamic_causality_index - calculates dynamic causality index from the adjacency matrix of inter-institutional Granger causal relationships to measure interconnectedness based on Billio et al. (2010).

early_warning_signal - early_warning_signal - Calculates some metrics of an indicator to be used as an early warning signal of costly asset price booms.

find_group_node - find_group_node - Finds the group where node j belongs to

fit_ar_model - fit_ar_model - Fits an AR model to the y-series representing GDP data. It selects the order that is less than max_order and minimizes the BIC.

getOptionPrice - getOptionPrice - Calculates the greeks and the value of the embedded Bermudan put option in a mortgage using a binomial tree.

hac_regression - hac_regression - calculates the regression coefficients and the HAC heteroskedasticity and autocorrelation consistent estimator.

housing_refinance - housing_refinance - calculates the total_value of houses (new and cash-out refinanced), the total value of mortgage lender guarantees, and the aggregate sensitivity.

joint_gap_indicators - joint_gap_indicators - Calculates the signal-to-noise (SNR) ratio and the number of predicted crises of joint signal indicators for particular thresholds based on Borio et al. (2009).

kyles_lambda - kyles_lambda - Calculates the Kyle's lambda (price impact liquidity measure).

leverage - leverage - calculates the standard approximation of leverage for a firm.

linear_granger_causality - linear_granger causality - calculates the significance (p-value) of the Granger causal effect of institution 1 (input_institution_returns) on institution two (output_institution_returns) beyond that of institution two's own historical values, based on Billio et al. (2010).

loan_to_value - Calculates the loan-to-value ratio at time t for a home initially purchased in vintage i.

marginal_expected_shortfall - marginal_expected_shortfall - Calculates the marginal expected shortfall of a firm.

modified_sign - modified_sign - Finds the sign of vector.

my_trirnd - my_trirnd - creates a sample of random variables from a triangular distribution.

network_measures - network_measures - Using the adjacency matrix of inter-institutional Granger causal relationships, network measures of interconnectedness are calculated for all nodes based on Billio et al. (2010)

optimal_gap_thresholds - optimal_gap_thresholds - Calculates the optimal gap thresholds according to nts ratio and true positive rate based on Borio et al. (2009).

pca - pca - Calculates the covariance matrix of the returns for different assets and its eigenvalues and eigenvectors.

probability_liquidation - probability_liquidation - calculates the probability of fund liquidation. Takes as input coefficients generated from probability_liquidation_model.

probability_liquidation_model - probability_liquidation_model - calculates the coefficients in the logit model for fund liquidation probability. Generates coefficients as outputs to parameterize the probability_liquidation function.

prob_refinance - prob_refinance - calculates the probability of refinancing at time t.

prob_survival - prob_survival - Calculates the probability that a new home from vintage begin_time has not undergone a cash-out refinancing by time t.

quantile_regression - quantile_regression - calculates the q-quantile regression coefficients.

return_smoothing - return_smoothing - Calculates the smoothing weights and the parameter ksi for a hedge fund

simple_dijkstra - simple_dijkstra - Implements the Dijkstra algorithm and returns the distance from a single vertex to all others, but does not save the path.

stress_scenario_selection - stress_scenario_selection - Calculates the worst forecast error of a given country's AR model and uses this as its stress scenario.

systemic_expected_shortfall - systemic_expected_shortfall - Calculates the systemic expected shortfall for a firm.

systemic_liquidity_indicator - systemic_liquidity_indicator - calculates the Q-stats for each fund and the systemic liquidity indicator.

systemic_risk_exposures - systemic_risk_exposures - Performs multiple stress tests to determine which counterparty has the greatest exposures for each of N "important" institutions.

turbulence - turbulence - calculates turbulence per period using mahalanobis distance and characterizes turbulent periods based on desired q-percentile distribution threshold based on Kritzman et al. (2010)

turbulence_var - turbulence_var - calculates the value-at-risk of a portfolio using only data from turbulent periods. Turbulence is defined at a q-percentile based on Kritzman et al. (2010)

undirected_banking_linkages - undirected_banking_linkages - Calculates the undirected network of banking linkages for n countries based on Fender and McGuire (2010).