Learn R Programming

far (version 0.6-7)

interpol.matrix: Interpolation matrix

Description

Calculate the matrix giving the linear interpolation of regularly spaced points.

Usage

interpol.matrix(n = 12, m = 24, tol = sqrt(.Machine$double.eps))

Value

A nxm matrix if they are integer, else a

sum(n)xsum(m) matrix.

Arguments

n

Number (integer) of points in output space

m

Number (integer) of points in the input function (or space)

tol

A relative tolerance to detect zero singular values.

Author

J. Damon

Details

The general principle is, considering a function for which we know values at m equally spaced points (for instance 1/m, 2/m, ..., 1), to compute the matrix giving the linear approximation of n equally spaced points (for instance 1/n, 2/n, ..., 1).

The function works whether n or m is the largest.

The function is vectorized, so m and n can be vectors of integers. In this case, they have to be of the same size and the resulting matrix is block diagonal.

See Also

theoretical.coef, simul.far or simul.farx.

Examples

Run this code
  mat1 <- interpol.matrix(12,24)
  mat2 <- interpol.matrix(c(3,5),c(12,12))
  print(mat1 %*% base.simul.far(24,5))
  print(mat2 %*% base.simul.far(24,5))  

Run the code above in your browser using DataLab