hankel: Form a symmetric Hankel matrix

View source: R/hankel.R

hankelR Documentation

Form a symmetric Hankel matrix

Description

Forms a symmetric Hankel matrix of order n from the values in vector \bold{x} and optionally the vector \bold{y}.

Usage

hankel(x, y = NULL)

Arguments

x

the first column to form the Hankel matrix.

y

the last column of the Hankel matrix. If y is not provided only its first n skew diagonals are formed and the remaining elements are zeros. Otherwise, it is assumed that x_n = y_1, and the first entry of vector y is discarded.

Value

A symmetric Hankel matrix of order n.

Examples

x <- 1:4
y <- c(4,6,8,10)

# H4
hankel(x)

# H({1,2,3,4},{4,6,8,10})
hankel(x, y)

fastmatrix documentation built on June 8, 2025, 11:43 a.m.