Function Repository Resource:

# GramP

Evaluate the Gram polynomial

Contributed by: Jan Mangaldan
 ResourceFunction["GramP"][k,m,t] gives the Gram polynomial .

## Details

Mathematical function, suitable for both symbolic and numerical manipulation.
Explicit formulas are given for nonnegative integer k.
For certain special arguments, ResourceFunction["GramP"] automatically evaluates to exact values.
ResourceFunction["GramP"] can be evaluated to arbitrary numerical precision.

## Examples

### Basic Examples (2)

Compute the fifth Gram polynomial:

 In[1]:=
 Out[1]=

Plot over a subset of the reals:

 In[2]:=
 Out[45]=

### Scope (2)

Evaluate to high precision:

 In[46]:=
 Out[46]=

 In[47]:=
 Out[47]=

### Applications (2)

Plot the first few Gram polynomials:

 In[48]:=
 Out[86]=

Use Gram polynomials to construct a quartic least-squares fit for equispaced data:

 In[87]:=

Construct the basis functions and the design matrix:

 In[88]:=

The normal equations are easily solved in the Gram basis:

 In[89]:=
 Out[89]=

Show the data with the curve:

 In[90]:=
 Out[90]=

### Properties and Relations (3)

GramP can be represented as a DifferenceRoot:

 In[91]:=
 In[92]:=
 Out[92]=

GramP satisfies a discrete orthogonality relation:

 In[93]:=
 Out[93]=

The elements of SavitzkyGolayMatrix can be expressed in terms of GramP:

 In[94]:=
 Out[94]=
 In[95]:=
 Out[95]=

## Version History

• 1.0.0 – 06 January 2021