The Maths

This outlines & links to important information related to how Mansion calculates values used in assumptions. We've included the Python and JS code for those interested.

Something missing? Please email us at support@mansionlife.com
Defining more Clearly Annualized Rate of Return
Mansion utilizes a few terms throughout the site like "Annualized Return" or ARR (Annualized Rate of Return). It is important to note that these calculations or definitions are numerical techniques that find approximations for returns given certain inputs.

When we use these formulas, we will list the assumptions used in the formulas and you can see the detailed math below. Although formulas may be similar to IRR, to avoid confusion with GIPS accepted methodology for IRR calculations, our displayed rates of return are "annualized rates of return" representing cash flows recognized annually.
The Code for the Maths
You can view the code below in Javascript for our calculations. This code has some fixed assumptions which will vary by the use of the calculator based on where it's used on the site or based on assumptions for a given market or property.



An Explanation of the Math and Methods

Newton's Method (used in Mansion Calculator):

The `newton` function implements Newton's method, which is an iterative numerical technique used to find approximations to the roots (or zeros) of a real-valued function.
- **Parameters**:
 - `f`: The function for which we want to find the root.
 - `df`: The derivative of the function `f`.
 - `x0`: Initial guess.
 - `tol`: Tolerance level for the approximation (default is 1e-7).
 - `maxIter`: Maximum number of iterations (default is 1000).

- **Assumptions**:
 - The function `f` is differentiable and has a continuous derivative.
 - There exists a root close to the initial guess `x0`.

Average Annual Rate of Return (ARR):
The `arr` (or 'irr') function calculates the Average Annual Rate of Return for a series of cash flows. ARR is the discount rate that makes the Net Present Value (NPV) of a series of cash flows equal to zero. This is not the GIPS standards thus we don't represent the output as IRR when displayed.

- **Parameters**:
 - `cashFlows`: An array of cash flows.

- **Assumptions**:
 - Cash flows occur at regular intervals, annually in our calculator.
 - The ARR exists and is unique.

Cash Flows Calculation:
The `calculateCashFlows` function calculates various cash flows and values associated with an investment.

- **Parameters**:
 - Various parameters related to the investment, such as initial offering value, appreciation rates, cash flow percentages, etc.

- **Assumptions**:
 - Cash flows and home values grow at constant rates.
 - Ownership percentage remains constant throughout the holding period.

Calculation of `totalReturnedValue`:
`totalReturnedValue` is the total amount returned at the end of the investment period. It's calculated as the sum of the last year's cash flow (which includes the net proceeds from the sale of the home) and the dividends received in that year.

Calculation of `arrResult`:
`arrResult` is the Average Annual Rate of Return for the series of cash flows. It represents the annualized rate of return for the investment, taking into account the timing and amount of each cash flow on an annual basis.

Summary:
1. **Newton's Method**: An iterative method used to find the root of a function. Assumes the function is differentiable and has a continuous derivative.

2. **ARR**: Represents the discount rate that makes the NPV of cash flows zero. Assumes cash flows occur at regular intervals and that the ARR is unique. This is code specific only and IS NOT INTENDED TO REFLECT GIPS OR OTHER STANDARDS FOR IRR.

3. **Cash Flows Calculation**: Calculates the cash flows and values associated with an investment based on various parameters. Assumes constant growth rates and constant ownership percentage.

4. **totalReturnedValue**: Represents the total amount returned at the end of the investment period, including the net proceeds from the sale of the home after disposition expenses assumed at the rate shown.

5. **arrResult**: The annualized rate of return for the investment, considering the timing and amount of each cash flow.

This code provides a comprehensive analysis of an investment, considering various factors like appreciation, cash flows, and ownership percentage. The calculations are based on standard financial principles and make certain assumptions for simplicity and ease of computation.