R: Compute Chebyshev-coefficients given values on a Chebyshev...

chebcoef {chebpol} | R Documentation

## Compute Chebyshev-coefficients given values on a Chebyshev grid

### Description

Compute the multivariate Chebyshev-coefficients, given values on a Chebyshev grid.

### Usage

    chebcoef(val, dct = FALSE)

### Arguments

`val` | An `array` of function values on a Chebyshev grid. The `dim`-attribute must be appropriately set. If not set, it is assumed to be one-dimensional.
`dct` | Logical. Since the Chebyshev coefficients are closely related to the DCT-II transform of `val`, the non-normalized real-even DCT-II coefficients may be retrieved instead. I.e. those from FFTW_REDFT10 in each dimension. This is not used anywhere in the package, it is merely provided as a convenience for those who might need it.

### Details

If `val` has no `dim`-attribute, it is assumed to be one-dimensional of length the length of `val`.

If chebpol was compiled without FFTW, running `chebcoef` on large grids may be slow and memory-demanding.

### Value

An array of Chebyshev-coefficients for an interpolating Chebyshev-polynomial.

### See Also

`havefftw`

### Examples

    ## Coefficients for a 2x3x4 grid
    a <- array(rnorm(24),dim=c(2,3,4))
    chebcoef(a)

[Package chebpol version 2.1-2 Index]