Skip to content

Instantly share code, notes, and snippets.

@philipmw
Created January 23, 2021 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipmw/f11c30497484def48049e03a82fd6c04 to your computer and use it in GitHub Desktop.
Save philipmw/f11c30497484def48049e03a82fd6c04 to your computer and use it in GitHub Desktop.
Value of PCC's dividend compared to membership cost
CostOfMembership = 60;
AnnualPccSpend = 57 * 12; # chosen to make the two options equivalent
i = 0.07; # interest rate of investing this money
T = 5; # time period we care about, in years
FV_investingMembershipCost = CostOfMembership * (1 + i)^T;
singleYearPPrime = function(x, r, t) {
return(2 / 100 * x * (1 + r)^t); # https://en.wikipedia.org/wiki/Compound_interest#Periodic_compounding
}
FV_beingAMember = sum(
unlist(
Map(function(t) { return (singleYearPPrime(AnnualPccSpend, i, t)); }, 1:T)
)
);
# Results:
# FV_beingAMember = 84.18
# FV_investingMembershipCost = 84.15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment