Function to compute eigenvalues and eigenvectors of CAR1...

Function to compute eigenvalues and eigenvectors of RW1 structure matrix.

1 | ```
eigenRW1(n)
``` |

`n ` |
dimension of structure matrix |

`values ` |
eigenvalues |

`vectors ` |
eigenvectors |

Kate Cowles

Kunsch, H.R. (1994), "Robust priors for smoothing andimage restoriation," Annals of the Institute of Statistical Mathematics, 55, no. 1, 1-19.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
## The function is currently defined as
function(n)
{
# compute eigenvals and eigenvects of RW1
w <-( pi/n) * ((n-1):0)
evals <- 2 * (1-cos(w) )
evects <- sin( outer( 1:n, w ) ) - sin( outer( (0:(n-1)), w))
evects[,n] <- rep(1,n)
evects <- apply( evects, 2, function(v) v / sqrt( sum(v^2) ) )
list( values = evals, vectors = evects)
}
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.