New module: Analytics.fs (loan comparison, sensitivity analysis, currency support)#69
Draft
Copilot wants to merge 4 commits into
Draft
New module: Analytics.fs (loan comparison, sensitivity analysis, currency support)#69Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/d2cbcaf8-9b1d-4106-afaa-00c98a3e0671 Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
…currency support Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/d2cbcaf8-9b1d-4106-afaa-00c98a3e0671 Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
…ency support) Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/d2cbcaf8-9b1d-4106-afaa-00c98a3e0671 Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add new module: Analytics.fs for loan comparison and sensitivity analysis
New module: Analytics.fs (loan comparison, sensitivity analysis, currency support)
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new
Analyticsmodule providing higher-level decision-support functions built on top of the existing scheduling/calculation infrastructure, plus ISO 4217 currency support as a cross-cutting concern.Currency support (
Calculation.fs)New
Currencystruct type andCurrencymodule with correct ISO 4217 minor-unit rounding:Loan comparison (
Analytics.LoanComparison)LoanComparison.compareaccepts(string * BasicParameters) arrayand returns aComparisonResultwith offers ranked four ways:Ranked lists:
RankedByTotalCostOfCredit,RankedByLevelPayment,RankedByApr,RankedByTotalAmountPayable. Ties broken by APR.TotalCostOfCreditis defined asScheduledPaymentTotal − Principal(fees + interest).Sensitivity analysis (
Analytics.SensitivityAnalysis)SensitivityAnalysis.analysetakes a baseBasicParametersand aPercent arrayof rate adjustments, returning aSensitivityScenario array— one row per adjustment — suitable for rendering as a table or chart:Works with
AnnualandDailyrates; aZerobase rate with a non-zero adjustment produces anAnnualrate.