Library: | fda |
See also: | data2fd getbasismatrix |
Quantlet: | evalfd | |
Description: | evaluates a functional data object FD, or an applied linear differential operator LFD, at argument values in an array EVALARG. |
Usage: | evalmat = evalfd(evalarg,fd,Lfd) | |
Input: | ||
evalarg | (p x q) matrix of argument values. q must be either equal to the number of replications, then each column will be applied to the corresponding replication, or equal to one, then the same vector of arguments is applied to all replications | |
fd | list, functional fd object, with q replications | |
Lfd | list, scalar or vector of integers which indicate the order of derivatives. In the case of an LDO with constant coefficients Lfd must be a (r x 2) matrix, where the first column contains the coefficients, the second one the orders of derivatives. If you want to apply an LDO with variable coefficients Lfd must be an LDO object. | |
Output: | ||
evalmat | (p x p2 x p3 x y) array, where p2 is the number of replications, p3 the number of variables in the fd object. y = r if Lfd is a vector, otherwise y = 1. |
library("fda") tvec = #(0, 2, 3, 6, 10) bspl = createfdbasis("bspline", #(0, 10), 7, tvec) ; one example for an LDO with constant coefficients: lfd = #(0.5, 1) ~ #(2, 3) proc(wt) = LDO1(evalarg) wt = matrix(2, rows(evalarg), cols(evalarg)) wt[1] = 1.25 .* evalarg wt[2] = 0.5 .* evalarg^2 endp LDO = createldo("LDO1", #(1, 3)) y = #(1, 2, 3, 4, 5)~#(0, 2, 3.97, NaN, 10.5)~#(9, 7, 5, 4,-3) tvec2 = tvec ~ tvec - 1 ~ tvec - 2 fdo = data2fd(y, tvec2, bspl, LDO) evalmat = evalfd(tvec, fdo, 0) evalmat
Contents of evalmat [1,] 1 0.74783 7 [2,] 2 3.97 4.6623 [3,] 3 5.1316 4.8539 [4,] 4 8.6902 0.17383 [5,] 5 10.407 -3.8023