hilb: Hilbert Matrix

Description Usage Arguments Details Value See Also Examples

View source: R/hilb.R

Description

Generate Hilbert matrix of dimension n

Usage

1
  hilb(n)

Arguments

n

positive integer specifying the dimension of the Hilbert matrix

Details

Generate the Hilbert matrix H of dimension n with elements H[i, j] = 1/(i+j-1).

(Note: This matrix is ill-conditioned, see e.g. det(hilb(6)).)

Value

matrix of dimension n

See Also

vander

Examples

1
  hilb(5)

Example output

          [,1]      [,2]      [,3]      [,4]      [,5]
[1,] 1.0000000 0.5000000 0.3333333 0.2500000 0.2000000
[2,] 0.5000000 0.3333333 0.2500000 0.2000000 0.1666667
[3,] 0.3333333 0.2500000 0.2000000 0.1666667 0.1428571
[4,] 0.2500000 0.2000000 0.1666667 0.1428571 0.1250000
[5,] 0.2000000 0.1666667 0.1428571 0.1250000 0.1111111

pracma documentation built on Dec. 11, 2021, 9:57 a.m.