Hi all,
A basic question here. I have a VIX 2014 dataset, which is shown as:
date | tau | K | call_option_price | S | r | put_option_price |
2014/1/2 | 16 | 1735 | 98.6 | 1831.98 | 0.0018 | 2.175 |
2014/1/2 | 16 | 1740 | 93.9 | 1831.98 | 0.0018 | 2.175 |
2014/1/2 | 16 | 1745 | 88.85 | 1831.98 | 0.0018 | 2.525 |
2014/1/2 | 16 | 1750 | 84.05 | 1831.98 | 0.0018 | 2.6 |
2014/1/2 | 16 | 1755 | 79.4 | 1831.98 | 0.0018 | 2.825 |
...
2014/1/2 | 36 | 1740 | 97.7 | 1831.98 | 0.0022 | 7.6 |
2014/1/2 | 36 | 1745 | 93.4 | 1831.98 | 0.0022 | 8.05 |
2014/1/2 | 36 | 1750 | 89 | 1831.98 | 0.0022 | 8.55 |
2014/1/2 | 36 | 1755 | 84.6 | 1831.98 | 0.0022 | 9.15 |
2014/1/2 | 36 | 1760 | 80.25 | 1831.98 | 0.0022 | 9.8 |
2014/1/2 | 36 | 1765 | 75.95 | 1831.98 | 0.0022 | 10.45 |
2014/1/2 | 36 | 1770 | 71.5 | 1831.98 | 0.0022 | 11.25 |
...
2014/1/3 | 15 | 1735 | 97.25 | 1831.37 | 0.0018 | 1.625 |
2014/1/3 | 15 | 1740 | 92.6 | 1831.37 | 0.0018 | 1.775 |
2014/1/3 | 15 | 1745 | 87.5 | 1831.37 | 0.0018 | 1.925 |
2014/1/3 | 15 | 1750 | 82.65 | 1831.37 | 0.0018 | 1.925 |
2014/1/3 | 15 | 1755 | 77.8 | 1831.37 | 0.0018 | 2.25 |
2014/1/3 | 15 | 1760 | 73 | 1831.37 | 0.0018 | 2.45 |
2014/1/3 | 15 | 1765 | 68.45 | 1831.37 | 0.0018 | 2.75 |
2014/1/3 | 15 | 1770 | 63.75 | 1831.37 | 0.0018 | 3.05 |
2014/1/3 | 15 | 1775 | 59.05 | 1831.37 | 0.0018 | 3.375 |
2014/1/3 | 15 | 1780 | 54.25 | 1831.37 | 0.0018 | 3.7 |
...
2014/1/3 | 35 | 1740 | 96.45 | 1831.37 | 0.0022 | 6.9 |
2014/1/3 | 35 | 1745 | 92.45 | 1831.37 | 0.0022 | 7.3 |
2014/1/3 | 35 | 1750 | 87.95 | 1831.37 | 0.0022 | 7.85 |
2014/1/3 | 35 | 1755 | 83.55 | 1831.37 | 0.0022 | 8.35 |
2014/1/3 | 35 | 1760 | 79.2 | 1831.37 | 0.0022 | 9 |
2014/1/3 | 35 | 1765 | 74.9 | 1831.37 | 0.0022 | 9.7 |
2014/1/3 | 35 | 1770 | 70.65 | 1831.37 | 0.0022 | 10.4 |
2014/1/3 | 35 | 1775 | 66.5 | 1831.37 | 0.0022 | 11.2 |
2014/1/3 | 35 | 1780 | 62.4 | 1831.37 | 0.0022 | 12.1 |
2014/1/3 | 35 | 1785 | 58.35 | 1831.37 | 0.0022 | 13.05 |
The data is imported by proc import. Just focus the variable 'tau', where is defined as the near-term expiration (T1) by tau=16 for 2014/1/2 and next-term expiration (T2) by tau=36 for 2014/1/2. Similarly, the T1 for 2014/1/3 is 15 and T2 for the same day is 35.
The question is, how can I extract the T1 and T2 with corresponding other variables in the same row separately into two different tables or matrixes? and make it is available to conduct matrix calculation, such as i = 0 to n,
Y = a*T1[ i ] * b*T2[ i ] (Just a simple example, I have to conduct a complex calculation then)?
Thank you.