Hey! This is my blog, where I write about random things. Does anyone care? Not sure, but I’m going to do it anyway because it’s a fun toy to experiment with web technologies and also because I’ve maintained a website since the mid 90’s so why stop now?
Alternative formulation of Weighted Average Life
Normally when folks calculate an asset’s weighted average life they use the formula $$ WAL = {{\sum_n{n \cdot Prin_n}} \over Par_0} $$ where $$ Par_n = \hbox{Par value at time n} \\[7pt] $$ and $$ Prin_n = \hbox{Principal payment at time n} \\[7pt] $$
In a previous blog post I had presented this formula $$ WAL = {\sum{Par_n} \over Par_0} \\ $$ without any context, other than to leave it to the reader to prove.
Hénon map
Building a Hénon map with javascript
I first found out about the Hénon map as an undergrad and have loved it ever since. Can I simulate it in javascript? Let’s find out!
The Hénon map is a dynamical system that exhibits chaotic behavior. It takes two parameters a and b. Depending on the values the map can exhibit periodic , chaotic or intermittent (switching back and forth between chaotic and stable orbits). It is described by the formula:
$$
\begin{aligned}
x_{n+1} &= 1 - ax_n^2+y_n\\
y_{n+1} &= bx_n
\end{aligned}
$$
The Hénon map is basically taking the x-y plane and stretches, folds and squishes it like kneading bread. For some parameters it will tend toward a fixed point or set of points, but for others it exhibits chaotic dynamics - which means that no matter how accurately you describe the current position, it will be impossible to predict where it will be in the future (other than within the bounds of the attractor).
Hosting from AWS with GitHub
History of carltracy.com
Tiktok Shortcode for Hugo
Formula for the Weighted Average Life of a Mortgage
A while ago for work I had created a process that required a formula for the weighted average life (WAL) of a mortgage with level payments. I found one online:
$$ W = N D_N - \frac{1}{r} $$
where:
$$
\begin{aligned}
d &= { 1 \over 1 + r} = \hbox{one month discount factor} \\[7pt]
r &= {a \over 12} = \hbox{monthly discount} \\[10pt]
N &= \hbox{Loan period in months} \\[10pt]
D_n &= {1 \over 1-d^n}
\end{aligned}
$$
That formula is pretty convenient because it means given a rate and a WAL we can solve pretty easily for how long the loan has to be in order to have a particular WAL without doing a bunch of infinite sums. So where does that fomula come from? Originally I found it here , but I wanted to see if I could derive it.