R: Lagged Differences

diff {spam} | R Documentation

## Lagged Differences

### Description

Returns suitably lagged and iterated differences.

### Usage

    # diff.spam(x, lag = 1, differences = 1, ...)
    ## S4 method for signature 'spam'
    diff(x, lag = 1, differences = 1, ...)

### Arguments

`x` | a `spam` matrix containing the values to be differenced.
`lag` | an integer indicating which lag to use.
`differences` | an integer indicating the order of the difference.
`...` | further arguments to be passed to or from methods.

### Value

A `spam` matrix with elements similar to `as.spam(diff(as.matrix(x), ...))`.

### Author(s)

Reinhard Furrer

### See Also

`diff` in `base`, `precmat`.

### Examples

    # incidence matrix for a RW(3) model
    D <- diff.spam(diag.spam(10), lag=1, differences=3)
     t(D)

[Package spam version 2.3-0 Index]