I have data which looks like:

```
   AGE   AGE_CAT decile house_price
1   22 bin_18_24      1    4726.947
2   22 bin_18_24      2    8161.651
3   23 bin_18_24      3   11699.392
4   24 bin_18_24      4   14941.351
5   21 bin_18_24      5   17676.896
6   20 bin_18_24      6   21592.982
7   20 bin_18_24      7   29277.973
8   20 bin_18_24      8   37110.146
9   23 bin_18_24      9   47122.003
10  19 bin_18_24     10  112750.115
11  25 bin_25_29      1    7584.590
12  25 bin_25_29      2   17151.103
13  27 bin_25_29      3   25990.247
14  25 bin_25_29      4   32154.051
15  27 bin_25_29      5   38576.356
16  28 bin_25_29      6   47229.818
17  26 bin_25_29      7   54688.024
18  29 bin_25_29      8   64382.058
19  29 bin_25_29      9   80473.481
20  26 bin_25_29     10  187721.742

```

Where;

AGE is the persons age,

AGE\_CAT is the category of peoples ages (between 18 and 24),

decil is a ranking of 1 to 10 of the persons house Price (i.e. decile 10 = most expensive).

I am trying to compute the NPV based on this formula;

[![enter image description here](https://i.stack.imgur.com/Qozna.jpg)](https://i.stack.imgur.com/Qozna.jpg)

Where $(a)$ is the AGE, $b\_i(a) = [decile1(a), decile10(a)]$.

I am having a hard time trying to figure out what "a\_tilde" is. I have been told that its the index for age and that by putting in "tilde" we allow age to vary independently of the age of the bin (AGE\_CAT).

In R I am using this code:

```
npvs <- df %>%
  mutate(a_tilde = 1, # I don`t know what should be here
         discount = 1 / (1 + rate) ^ (a_tilde - AGE),
         CF_disc = house_price * discount)

```