CIBC FX conversion baseline
A small statistical regression model estimating CIBC CAD/USD conversion rates relative to an explicitly supplied CAD-per-USD reference. This is a custom Python model, not a language model or Transformers checkpoint. It requires Python 3.10+ and only the standard library. Uploading it does not create a hosted inference API.
Method and usage
Separate median proportional adjustments are fitted for buying and selling USD:
estimated_rate = reference_rate * (1 + adjustment[direction])
estimated_cad = USD subtotal * estimated_rate
The USD subtotal must already include transaction commissions where applicable.
Do not add the original commission twice. Use buy_usd to fund a USD purchase
from CAD; use sell_usd to convert USD proceeds to CAD.
After downloading this repository:
python3 predict.py --direction sell_usd --reference-rate 1.40 --usd 1000
import json
from model import predict
with open('artifacts/model.json') as source:
fitted = json.load(source)
print(predict(fitted, 'sell_usd', 1.40, 1000))
Training and validation
Trained on 55 reviewed private transaction samples, with settlement dates from 2022-05-25 through 2025-11-03. Raw transactions, account identifiers, screenshots, cost bases, broker credentials and OpenAI assessments are not included in this repository.
Chronological evaluation used 35 earlier training samples and 20 later holdout samples, keeping each settlement date entirely within one side of the split. The published final model is subsequently refitted on all eligible samples; the holdout metrics describe the earlier model.
- Mean absolute CAD error: 25.60 CAD.
- Mean absolute percentage CAD error: 0.149%.
- Maximum absolute CAD error: 88.93 CAD.
Aggregate evaluation details are in evaluation.json. Private training data is
not distributed, so this repository supports inference but not reproducing the
original fit from raw data.
Limits
Training uses retrospective Yahoo settlement-day daily closes, which can differ from broker conversion-time references. Adjustments mix pricing and timing effects; they are not isolated broker fees. Accuracy with live or future reference rates is unvalidated. Samples sharing dates are correlated. This small historical sample does not establish current broker policy or a guaranteed error bound.
The model does not forecast market FX, stock prices, option prices or investment returns. Amount-range warnings are not prediction intervals. Downstream tools must state their conversion treatment and fee assumptions. No OpenAI dependency or recommendation logic is included.
Files
model.py: pure fitting and prediction functions.predict.py: command-line inference.artifacts/model.json: fitted parameters and model provenance.evaluation.json: aggregate holdout metrics.manifest.json: SHA-256 checksums of the published payload.