## Prepayments with Fewer Than 360 Months Remaining

When fewer than 360 months remain in the pool, the applicable PSA prepayment vector is "seasoned" by the pool's age. (Elements in the 360-element prepayment vector that represent past payments are skipped. For example, on a 30-year mortgage that is 10 months old, only the final 350 prepayments are applied.)

Assume, for example, that you have two 30-year loans, one new and another 10 months old. Both have the same PSA speed of 100 and prepay using the vectors plotted below.

Still within the scope of relative valuation, you could also solve for the percentage of the standard PSA prepayment vector given the pool's arbitrary, user-supplied prepayment vector, such that the PSA speed gives the same Macaulay duration as the user-supplied prepayment vector.

If you supply a custom prepayment vector, you must account for the number of months remaining.

```Price = 101; Settle = datetime(2001,1,1); Maturity = datetime(2030,1,1); IssueDate = datetime(2000,1,1); GrossRate = 0.08125; PrepayMatrix = 0.005*ones(348,1); CouponRate = 0.075; Delay = 14; ImpliedSpeed = mbsprice2speed(Price, Settle, Maturity, ... IssueDate, GrossRate, PrepayMatrix, CouponRate, Delay)```
```ImpliedSpeed = 104.2543 ```

Examine the prepayment input. The remaining 29 years require 348 monthly elements in the prepayment vector. Suppose then, keeping everything the same, you change `Settle` to February 14, 2003.

```Settle = datetime(2003,2,14); ```

You can use `cpncount` to count all incoming coupons received after `Settle` by invoking

```NumCouponsRemaining = cpncount(Settle, Maturity, 12, 1, [], ... IssueDate) ```
```NumCouponsRemaining = 323 ```

The input `12` defines the monthly payment frequency, `1` defines the 30/360 basis, and `IssueDate` defines aging and determination-of-holder date. Thus, you must supply a 323-element vector to account for a prepayment corresponding to each monthly payment.