View source: R/InterpChebValues.R
InterpChebValues | R Documentation |
InterpChebValues(values,x,domain)
evaluates the function fun by using Chebyshev
polynomial approximation specified by the function values evaluated at
Chebyshev points with specified domain.
InterpChebValues(values, x, domain)
values |
function values evaluated at Chebyshev points of the 2nd kind. |
x |
points, in which we want to compute the value of polynomial. |
domain |
vector containing lower and upper bound of interval. |
Function returns the function fun by using Chebyshev polynomial approximation specified by the function values evaluated at Chebyshev points with specified domain.
Ver.: 16-Nov-2021 15:52:07 (consistent with Matlab CharFunTool v1.3.0, 28-May-2021 14:28:24).
Other Utility Function:
ChebCoefficients()
,
ChebPoints()
,
ChebPolyValues()
,
ChebPoly()
,
ChebValues()
,
GammaLog()
,
GammaMultiLog()
,
GammaMulti()
,
GammaZX()
,
Hypergeom1F1MatApprox()
,
Hypergeom1F1Mat()
,
Hypergeom2F1Mat()
,
Hypergeom2F1()
,
HypergeompFqMat()
,
hypergeom1F1()
,
interpBarycentric()
## EXAMPLE1 (Chebyshev polynomial values specified by coefficients of Sine)
n <- 2^5+1
domain <- c(-pi,pi)
nodes <- ChebPoints(n,domain)
f <-list(sin(nodes[[1]]))
coeffs <- ChebCoefficients(f)
x <- seq(-pi,pi,length.out=100)
pval <- ChebPolyValues(coeffs,x)
plotReIm(function(x)
pval,x,
xlab = "x",
ylab ="Chebyshev polynomial",
title ="Chebyshev Polynomial Specified by its Coefficients")
## EXAMPLE2 (Chebyshev polynomial values of the Sine and Cosine functions)
n <- 2^5+1
domain <- c(-pi,pi)
nodes <- ChebPoints(n,domain)
f <- list(sin(nodes[[1]]), cos(nodes[[1]]), sin(nodes[[1]])*cos(nodes[[1]]))
coeffs <- ChebCoefficients(f);
x <- seq(-pi,pi,length.out=101)
pval_x <- ChebPolyValues(coeffs,c(),domain)
pval_x1<-list()
for (i in 1:length(pval_x[1,])) {
pval_x1[[i]] <- pval_x[,i]
}
plotReIm3(
pval_x1,x,
xlab="x",
ylab="Chebyshev polynomial",
title="Chebyshev Polynomial Specified by its Coefficients")
## EXAMPLE3 (Chebyshev polynomial values of the Normal PDF and CDF)
n <- 2^7+1
domain <- c(-8, 8)
nodes <- ChebPoints(n,domain)
f <- list(dnorm(nodes[[1]]), pnorm(nodes[[1]]))
coeffs <- ChebCoefficients(f)
x <- seq(-4,4,length.out=101)
pval_x <- ChebPolyValues(coeffs,x,domain)
pval_x1 <-list()
for (i in 1:length(pval_x[1,])) {
pval_x1[[i]] <- pval_x[,i]
}
plotReIm3(
pval_x1,x, title="Chebyshev Polynomial Values Specified by its Coefficients",
xlab = "x",
ylab ="Chebyshev polynomial" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.