Description Usage Arguments Value Author(s) See Also Examples

View source: R/hhh4_W_powerlaw.R

Compute power-law weights with decay parameter `d`

based on a matrix of neighbourhood orders `nbmat`

(e.g., as obtained via `nbOrder`

).
Without normalization and truncation,
this is just *o^{-d}* (where *o* is a neighbourhood order).
This function is mainly used internally for `W_powerlaw`

weights in `hhh4`

models.

1 | ```
zetaweights(nbmat, d = 1, maxlag = max(nbmat), normalize = FALSE)
``` |

`nbmat` |
numeric, symmetric matrix of neighbourhood orders. |

`d` |
single numeric decay parameter (default: 1). Should be positive. |

`maxlag` |
single numeric specifying an upper limit for the power
law. For neighbourhood orders > |

`normalize` |
Should the resulting weight matrix be normalized such that rows sum to 1? |

a numeric matrix with same dimensions and names as the input matrix.

Sebastian Meyer

1 2 3 4 5 6 7 | ```
nbmat <- matrix(c(0,1,2,2,
1,0,1,1,
2,1,0,2,
2,1,2,0), 4, 4, byrow=TRUE)
zetaweights(nbmat, d=1, normalize=FALSE) # harmonic: o^-1
zetaweights(nbmat, d=1, normalize=TRUE) # rowSums=1
zetaweights(nbmat, maxlag=1, normalize=FALSE) # results in adjacency matrix
``` |

surveillance documentation built on July 25, 2018, 1:01 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.