Simulate Stock-Flow Consistent Models
Abort if not
Abort if duplicated variables
Abort if typo on the codes of columns
Abort if column validation is not fulfilled
Abort if row validation is not fulfilled
Find dependencies and order the equations
Find dependencies and order the equations
Check if all values in x are equal
Take arguments and make them a row of a tibble
Broyden solver algorithm
Check shocks for length consistency and warn about risks of using exog...
Check shocks for length consistency and warn about risks of using exog...
Check that symmetry condition is valid and fulfill missing entries
Split the formulae into a tibble with the left-hand side and right-h...
Extend a baseline matrix
Fill all possible rows and columns and validate
Find blocks of independent equations (wrapper around igraph function...
Find names for display matrix
Get numeric matrix for evaluation from balance-sheet or transactions-f...
Check if two values are equal
Make the underlying matrix that will be modified in place by the solve...
Prep equations for Broyden and Newton solvers
Re-wrote the equations with the correct matrix syntax that will be use...
Pattern replacement var
Pattern replacement lag
Find cyclical nodes
Scan columns to fill whenever there's only one value missing.
Scan rows to fill whenever there's only one value missing.
Broyden solver wrapper
Check for missing endogenous variables
Find adjacency matrix for a system of equations
Place the equations in the correct order for estimation
Gauss Seidel algorithm
Make matrix for scenario calculations
Newton-Raphson solver implemented with rootSolve::multiroot()
Transform entries into latex style
Validate a balance-sheet or transactions-flow matrix on the simulated ...
Check that the portfolio matrix respect the horizontal and vertical ad...
sfcr_mlt_set constructor
sfcr_mlt_shock constructor
sfcr_mlt constructor
sfcr_set constructor
new_sfcr_tbl constructor
Pipe operator
Simulate the baseline scenario of a stock-flow consistent model
Plot the DAG with blocks and cycles information
Create a tbl_graph object blocks and cycles information
Plot the DAG with cycles information
Create a tbl_graph object with cycles information
Expand variables to implement sensitivity analysis
Get block structure of a sfcr_tbl object
Get Matrix form of sfcr_tbl object
Print matrix to screen
Create balance-sheet or transactions-flow matrices
Simulate multiple SFC models at the same time
Find a valid matrix of portfolio parameters
Generate random sequences inside sfcr_set()
Plot Sankey's diagram representation of transactions-flow matrix
Add scenarios to a sfcr model.
Get names of endogenous vars and their index
Define the formulas of the model
Create shock(s) to add to a sfcr_scenario().
Validate a transactions-flow or balance-sheet matrix
Routines to write, simulate, and validate stock-flow consistent (SFC) models. The accounting structure of SFC models are described in Godley and Lavoie (2007, ISBN:978-1-137-08599-3). The algorithms implemented to solve the models (Gauss-Seidel and Broyden) are described in Kinsella and O'Shea (2010) <doi:10.2139/ssrn.1729205> and Peressini and Sullivan (1988, ISBN:0-387-96614-5).