chebnodegen: Unidimensional Chebyshev nodes

Description Usage Arguments Details Value References Examples

View source: R/definefuns.R

Description

The function generates uni-dimensional chebyshev nodes.

Usage

1
chebnodegen(n, a, b)

Arguments

n

A number of nodes

a

The lower bound of inverval [a,b]

b

The upper bound of interval [a,b]

Details

A polynomial approximant s_{i} over a bounded interval [a,b] is constructed by:

s_{i} = \frac{b+a}{2} + \frac{b-a}{2}cos (\frac{n - i + 0.5 }{n} π ) for i = 1,2,\cdots,n.

More detail explanation can be refered from Miranda and Fackler (2002, p.119).

Value

An array n Chebyshev nodes

References

Miranda, Mario J. and Paul L. Fackler. (2002) Applied Computational Economics and Finance. Cambridge: The MIT Press.

Examples

1
2
3
4
## 10 Chebyshev nodes in [-1,1]
chebnodegen(10,-1,1)
## 5 Chebyshev nodes in [1,5]
chebnodegen(5,1,5)

Example output

 [1] -0.9876883 -0.8910065 -0.7071068 -0.4539905 -0.1564345  0.1564345
 [7]  0.4539905  0.7071068  0.8910065  0.9876883
[1] 1.097887 1.824429 3.000000 4.175571 4.902113

capn documentation built on May 1, 2019, 11:15 p.m.

Related to chebnodegen in capn...