Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kvanderwijst authored Feb 13, 2020
1 parent 62d41b5 commit 481f015
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# nfactor-decomp
N-factor decomposition code implementing the Sun (1998) method
N-factor decomposition code implementing the Sun (1998) method.

## Usage:
Use two lists of length `n`: one for the start year, the other for end year.

```
decomposition(n, values_start, values_end)
```

This returns the value at the start (product of `values_start`), the value at the end (product of `values_end`) and a list of `n` values, which are the differences due to each factor. The sum of the differences is equal to the difference between the value at the end and the value at the start.

Make sure to import `numpy` and `itertools`:
```
import numpy as np
import itertools
```

0 comments on commit 481f015

Please sign in to comment.