Creating a special Toeplitz matrix in R I'd like to know if there is a standard way of creating a matrix like the one shown below using the R programming language. 

$$
        \begin{bmatrix}
        1 &amp; \rho &amp; \rho^2 &amp; \cdots &amp; \rho^{T-1}\\
        \rho &amp; 1 &amp; \rho &amp; \cdots &amp; \rho^{T-2}\\
        \rho^2 &amp; \rho &amp; 1  &amp; \cdots &amp; \rho^{T-3}\\
        \vdots &amp;\vdots &amp;\vdots &amp; \ddots &amp; \vdots\\
        \rho^{T-1} &amp; \rho^{T-2} &amp; \rho^{T-3} &amp; \cdots &amp; 1
        \end{bmatrix}
$$

The code I've been using to create matrices like this one is shown below. 

For illustrative purposes, let rho = 0.8 and T = 20.

rho &lt;- 0.8
t   &lt;- 20
toeplitz(c(1, poly(rho, t-1, raw=TRUE)))


Although the output of this code does, indeed, produce the matrix of interest, I get the feeling that there's probably a better way of doing it.

Can this code snippet be improved - in the sense that there is a more elegant, more standard, more correct, or more efficient way of creating the matrix?
In this case, poly is probably too much trouble. You can just calculate the polynomial yourself with rho^seq.int(0, t-1). Altogether that gives

toeplitz(rho^seq.int(0, t-1))