{"ref":{"kind":"component","id":"investment_returns","key":"sha256:67b08534becd7cd7870f874f7b7ca718b13121893ea3e2200d8f9ee333d66478"},"label":"Investment Returns","description":"Measure invested basis, distributions, profit, MOIC, and annual IRR for one monthly cash-flow series.","inputs":[{"label":"Cash Flow","name":"cash_flow","valueType":{"axes":[{"extent":121,"name":"month","variable":true}],"dtype":"f64","unit":"$"}}],"outputs":[{"label":"Basis","name":"basis","valueType":{"axes":[],"dtype":"f64","unit":"$"}},{"label":"Cash Flow","name":"cash_flow","valueType":{"axes":[{"extent":121,"name":"month","variable":true}],"dtype":"f64","unit":"$"}},{"label":"Cash Flow Check","name":"cash_flow_check","valueType":{"axes":[],"dtype":"f64","unit":"$"}},{"label":"Distributions","name":"distributions","valueType":{"axes":[],"dtype":"f64","unit":"$"}},{"label":"IRR","name":"irr","valueType":{"axes":[],"dtype":"f64","unit":"%"}},{"label":"IRR Available","name":"irr_available","valueType":{"axes":[],"dtype":"f64","unit":"flag"}},{"label":"MOIC","name":"moic","valueType":{"axes":[],"dtype":"f64","unit":"x"}},{"label":"MOIC Available","name":"moic_available","valueType":{"axes":[],"dtype":"f64","unit":"flag"}},{"label":"Profit","name":"profit","valueType":{"axes":[],"dtype":"f64","unit":"$"}},{"label":"Profit Margin","name":"profit_margin","valueType":{"axes":[],"dtype":"f64","unit":"%"}}],"dependencies":[{"id":"sum_negative","key":"sha256:1644d6b6a8d3dfd9cd834e9a89b823a8dd9c74686fa62a3d87d8333fc8998c0c","kind":"component"},{"id":"sum_positive","key":"sha256:e8805466a8f52fd4b06236ffd2de1f85d67f647c9f9ee61dbe17db128f00c72d","kind":"component"},{"id":"safe_divide_multiple","key":"sha256:706f4800913795b99a6e74866d40a5edcb043292c2404c4e79e10479a1a56247","kind":"component"},{"id":"safe_divide_percent","key":"sha256:a262e04b8cd65d6a59d98b0d2baf6863582fb8755a06f37eb49b864efb61c476","kind":"component"}],"libraries":["returns"],"notes":{"conventions":["Treat negative cash flow as invested capital and positive cash flow as distributions.","Use monthly periods and report annualized periodic IRR.","Read the availability flags with MOIC and IRR; a reported zero can mean the metric is unavailable.","IRR availability requires positive invested capital and exactly one supported return root."]},"calculation":{"nodes":[{"id":"input-cash_flow","label":"Cash Flow","kind":"input"},{"id":"step-basis","label":"Basis","kind":"step","rule":"Result of Sum Negative","sources":[{"node":"input-cash_flow"}],"calls":[{"component":"sum_negative","purpose":"Measure the positive magnitude of negative values in one monthly currency series.","label":"Sum Negative","bindings":[{"name":"values","label":"Values","value":"Cash Flow"}]}]},{"id":"step-distributions","label":"Distributions","kind":"step","rule":"Result of Sum Positive","sources":[{"node":"input-cash_flow"}],"calls":[{"component":"sum_positive","purpose":"Sum the positive values in one monthly currency series.","label":"Sum Positive","bindings":[{"name":"values","label":"Values","value":"Cash Flow"}]}]},{"id":"output-cash_flow","kind":"output","label":"Cash Flow","rule":"Cash Flow","sources":[{"node":"input-cash_flow"}]},{"id":"output-irr","kind":"output","label":"IRR","rule":"IRR(Cash Flow)","sources":[{"node":"input-cash_flow"}],"calls":[{"function":"irr","label":"IRR","bindings":[{"name":"cash_flow","label":"Cash flow","value":"Cash Flow"}],"purpose":"Find the monthly discount rate that sets the present value of the cash flows to zero. Choose the monthly rate closest to zero when several qualify. Annualize it by compounding for twelve months.","rule":"IRR(Cash Flow)"}]},{"id":"step-moic_available","label":"MOIC Available","kind":"step","rule":"(Basis > 0)","sources":[{"node":"step-basis"}]},{"id":"output-basis","kind":"output","label":"Basis","rule":"Basis","sources":[{"node":"step-basis"}]},{"id":"step-moic","label":"MOIC","kind":"step","rule":"Result of Safe Divide Multiple","sources":[{"node":"step-basis"},{"node":"step-distributions"}],"calls":[{"component":"safe_divide_multiple","purpose":"Divide two currency scalars into a multiple, returning zero near a zero denominator.","label":"Safe Divide Multiple","bindings":[{"name":"denominator","label":"Denominator","value":"Basis"},{"name":"numerator","label":"Numerator","value":"Distributions"}]}]},{"id":"step-profit","label":"Profit","kind":"step","rule":"(Distributions − Basis)","sources":[{"node":"step-distributions"},{"node":"step-basis"}]},{"id":"output-cash_flow_check","kind":"output","label":"Cash Flow Check","rule":"((Sum(Cash Flow) + Basis) − Distributions)","sources":[{"node":"input-cash_flow"},{"node":"step-basis"},{"node":"step-distributions"}]},{"id":"output-distributions","kind":"output","label":"Distributions","rule":"Distributions","sources":[{"node":"step-distributions"}]},{"id":"output-irr_available","kind":"output","label":"IRR Available","rule":"(MOIC Available × IRR available(Cash Flow))","sources":[{"node":"step-moic_available"},{"node":"input-cash_flow"}],"calls":[{"function":"irr_available","label":"IRR available","bindings":[{"name":"cash_flow","label":"Cash flow","value":"Cash Flow"}],"purpose":"Check that material cash flows start negative and finish positive, and that the selected monthly rate gives the only annualized solution in the supported range. Report whether the return is available.","rule":"IRR available(Cash Flow)"}]},{"id":"output-moic_available","kind":"output","label":"MOIC Available","rule":"MOIC Available","sources":[{"node":"step-moic_available"}]},{"id":"output-moic","kind":"output","label":"MOIC","rule":"MOIC","sources":[{"node":"step-moic"}]},{"id":"step-profit_margin","label":"Profit Margin","kind":"step","rule":"Result of Safe Divide Percent","sources":[{"node":"step-basis"},{"node":"step-profit"}],"calls":[{"component":"safe_divide_percent","purpose":"Divide two currency scalars into a percent, returning zero near a zero denominator.","label":"Safe Divide Percent","bindings":[{"name":"denominator","label":"Denominator","value":"Basis"},{"name":"numerator","label":"Numerator","value":"Profit"}]}]},{"id":"output-profit","kind":"output","label":"Profit","rule":"Profit","sources":[{"node":"step-profit"}]},{"id":"output-profit_margin","kind":"output","label":"Profit Margin","rule":"Profit Margin","sources":[{"node":"step-profit_margin"}]}],"topics":[{"label":"Investment Returns","results":["output-basis","output-cash_flow","output-cash_flow_check","output-distributions","output-irr","output-irr_available","output-moic","output-moic_available","output-profit","output-profit_margin"]}]},"usedBy":[{"kind":"recipe","id":"condo_development","key":"sha256:e1e317fbad79babd19d06f30b451bf1b5fc74bf415bd554eb16205d31d5a7996"},{"kind":"recipe","id":"data_center_acquisition","key":"sha256:a3de19f40187caf36db2e6ce0da98119726e3c4bf05500115912b18e3fc8c1ca"},{"kind":"recipe","id":"data_center_development","key":"sha256:b76434a51896bf65e497e8679d3a1c7a72f5c0ed2705618ed598fbad02e7ef0e"},{"kind":"recipe","id":"secondary_dated","key":"sha256:e0959da66177c09759df3ce796541bcba3b11e1550527e1fa5ab01774fdd805c"},{"kind":"recipe","id":"hotel","key":"sha256:bf0956eceaed37e652044e718371c50f6d742ef9dc4b93edf968a748eda841c3"},{"kind":"recipe","id":"multifamily","key":"sha256:397eeb7b5a8b1a4584c66bc4c75f1a85494dbe812871f2e39c9192beb8a51f18"},{"kind":"recipe","id":"multifamily_development","key":"sha256:bd5fced62c36e2251666c32d8cd629753c9f945e2292b401f90f46ce957e1bcd"},{"kind":"recipe","id":"secondary","key":"sha256:66498892bb48f7b3beacc4888f44d52630de9a81a4f58b481a448a28525c7fdd"},{"kind":"recipe","id":"single_family_development","key":"sha256:7cbf7a6885faf03497d0f91f19204cb9d504c05b3623fa3a362281037883288e"}]}
