eval.surp | R Documentation |

A surprisal vector of length `M`

is minus the log to a positive integer
base `M`

of a set of `M`

multinomial probabilities. Surprisal
curves are functions of a one-dimensional index set, such that at any
value of the index set the values of the curves are a surprisal vector.
See Details below for further explanations.

```
eval.surp(evalarg, Wfdobj, nderiv = 0)
```

`evalarg` |
a vector or matrix of argument values at which the functional data object is to be evaluated. |

`Wfdobj` |
a functional data object of dimension |

`nderiv` |
An integer defining a derivatve of |

A surprisal `M`

-vector is information measured in `M`

-bits.
Since a multinomial probability vector must sum to one, it follows
that the surprisal vector `S`

must satisfy the constraint
`log_M(sum(M^(-S)) = 0.`

That is, surprisal vectors lie within a
curved `M-1`

-dimensional manifold.

Surprisal curves are defined by a set of unconstrained `M-1`

B-spline
functional data objects defined over an index set that are transformed into
surprisal curves defined over the index set.

Let `C`

be a `K`

by `M-1`

coefficient matrix defining the
B-spline curves, where `K`

is the number of B-spline basis functions.

Let a `M`

by `M-1`

matrix `Z`

have orthonormal columns.
Matrices satisfying these constraints are generated by function
`zerobasis()`

.

Let `N`

by `K`

matrix be a matrix of B-spline basis values
evaluated at `N`

evaluation points using function
`eval.basis()`

.

Let `N`

by `M`

matrix `X`

= `B * C * t(Z)`

.

Then the `N`

by `M`

matrix `S`

of surprisal values is
`S`

= `-X + outer(log(rowSums(M^X))/log(M),rep(1,M))`

.

A `N`

by `M`

matrix `S`

of surprisal values at points
`evalarg`

, or their first or second derivatives.

Juan Li and James Ramsay

Ramsay, James O., Hooker, Giles, and Graves, Spencer (2009),
*Functional data analysis with R and Matlab*, Springer, New York.

Ramsay, James O., and Silverman, Bernard W. (2005),
*Functional Data Analysis, 2nd ed.*, Springer, New York.

Ramsay, James O., and Silverman, Bernard W. (2002),
*Applied Functional Data Analysis*, Springer, New York.

`smooth.surp`

```
# see example in man/smooth.surp.Rd
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.