data2fd                 package:fda                 R Documentation

_C_o_n_v_e_r_t _D_i_s_c_r_e_t_e _D_a_t_a _t_o _F_u_n_c_t_i_o_n_a_l _D_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     This function converts an array y of function values plus an array
     argvals of argument values into a functional data object. This a
     function that tries to do as much for the user as possible.

_U_s_a_g_e:

     data2fd(y, argvals=seq(0, 1, len = n), basisfd,
             fdnames=defaultnames,
             argnames=c("time", "reps", "values"))

_A_r_g_u_m_e_n_t_s:

       y: An array containing sampled values of curves. If y is a
          vector, only one replicate and variable are assumed. If y is
          a matrix, rows must correspond to argument values and columns
          to replications or cases, and it will be assumed that there
          is only one variable per observation. If y is a
          three-dimensional array, the first dimension (rows)
          corresponds to argument values, the second (columns) to
          replications, and the third (layers) to variables within
          replications. Missing values are permitted, and the number of
          values may vary from one replication to another. If this is
          the case, the number of rows must equal the maximum number of
          argument values, and columns of y having fewer values must be
          padded out with NA's. 

argvals : A set of argument values. If this is a vector, the same set
          of argument values is used for all columns of y. If argvals
          is a matrix, the columns correspond to the columns of y, and
          contain the argument values for that replicate or case. 

basisfd : Either: A basisfd object created by function
          create.basis.fd(), or the value NULL, in which case a basisfd
          object is set up by the function, using the values of the
          next three arguments. 

fdnames : A list of length 3, each member being a string vector
          containing labels for the levels of the corresponding
          dimension of the discrete data. The first dimension is for
          argument values, and is given the default name "time", the
          second is for replications, and is given the default name
          "reps", and the third is for functions, and is given the
          default name "values". These default names are assigned in
          function {tt data2fd}, which also assigns default string
          vectors by using the dimnames attribute of the discrete data
          array. 

argnames : A character vector of length 3 containing: (1) the name of
          the argument, e.g. "time" or "age" (2) a description of the
          cases, e.g. "weather stations" (3) the name of the observed
          function value, e.g. "temperature" These strings are used as
          names for the members of list fdnames. 

_D_e_t_a_i_l_s:

_V_a_l_u_e:

     An objecgt of the fd class containing the coefficient array with
     the name coefs, a basis.fd object with the name basis, and a list
     with the name fdnames.

_N_o_t_e:

_A_u_t_h_o_r(_s):

_R_e_f_e_r_e_n_c_e_s:

     Ramsay, J. O. and Silverman, B. W. 1997. Functional data analysis.
     Springer-Verlag, New York. 310 pp.

_S_e_e _A_l_s_o:

     project.basis, smooth.basis, create.fd

_E_x_a_m_p_l_e_s:

