Command Reference : Matrix Language Reference
Vector containing geometric sequence.
Syntax: @seqm(d1, d2, n)
d1: number
d2: number
n: integer
Return: vector
Returns a vector holding a geometric sequence of n elements. The initial element has value d1, and the ratio between each subsequent element and its predecessor is d2.
vector v1 = @seqm(1, 2, 10)
creates a V1 an 10 element vector with first element 0, and each subsequent element representing a power of 2.
vector v2 = @seqm(1, 1/1.05, 20)
computes 20 periods of discount factors for discount rate 0.05. Then we may use these factors to replicate the built-in @pv present-value function:
scalar pv1 = @sum(@seqm(1, 1/1.05, 20))
scalar pv2 = @pv(.05, 20, 200, 0, 1)
which computes the present value of a stream of $200 payments over 20 periods, with a discount rate of 0.05.
See also @seq.