Skip to content

Commit

Permalink
Set mean reversion target to D0(4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishiko732 committed Jul 27, 2024
1 parent 9285e33 commit 94fdec0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fsrs/algorithm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,16 @@ export class FSRSAlgorithm {

/**
* The formula used is :
* $$\text{next}_d = D - w_6 \cdot (R - 2)$$
* $$D^\prime(D,R) = w_5 \cdot D_0(2) +(1 - w_5) \cdot \text{next}_d$$
* $$\text{next}_d = D - w_6 \cdot (g - 3)$$
* $$D^\prime(D,R) = w_7 \cdot D_0(4) +(1 - w_7) \cdot \text{next}_d$$
* @param {number} d Difficulty $$D \in [1,10]$$
* @param {Grade} g Grade (rating at Anki) [1.again,2.hard,3.good,4.easy]
* @return {number} $$\text{next}_D$$
*/
next_difficulty(d: number, g: Grade): number {
const next_d = d - this.param.w[6] * (g - 3)
return this.constrain_difficulty(
this.mean_reversion(this.param.w[4], next_d)
this.mean_reversion(this.init_difficulty(Rating.Easy), next_d)
)
}

Expand Down

0 comments on commit 94fdec0

Please sign in to comment.