benford_analysis
Detect anomalies in journal entry populations by comparing leading digit distributions to Benford's law, returning MAD and chi-square statistics.
Instructions
金額の先頭桁の分布をベンフォードの法則と比較し、MAD と χ² を返す。母集団の性質を見るための道具で、個別仕訳の判定には使えない。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| digits | No | 1 = 先頭1桁、2 = 先頭2桁。既定は 1。 | |
| amounts | No | journals の代わりに金額だけを渡す場合。 | |
| journals | No | 仕訳の配列。簡易形 { date, debit_account, credit_account, amount } か、明細形 { date, lines: [{ account, debit, credit }] } のどちらでも受ける。 |