percentChange              package:dse1              R Documentation

_C_a_l_c_u_l_a_t_e _p_e_r_c_e_n_t _c_h_a_n_g_e

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

     Calculate the percent change relative to the data lag periods
     prior.

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

         percentChange(obj, ...)
         ## Default S3 method:
         percentChange(obj, base=NULL, lag=1, cumulate=FALSE, e=FALSE, ...)
         ## S3 method for class 'TSdata':
         percentChange(obj, base=NULL, lag=1, cumulate=FALSE, e=FALSE, ...)
         ## S3 method for class 'TSestModel':
         percentChange(obj, base=NULL, lag=1, cumulate=FALSE, e=FALSE, ...)
         

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

     obj: An object of class TSdata or TSestModel, a time series
          matrix, a matrix with columns corresponding to series (which
          are treated  individually), or a list of one of these kinds
          of objects. (called m below)

       e: If e is TRUE the exponent of the series is used (after
          cumulating  if cumulate is TRUE). e can be a logical vector
          with elements corresponding to columns of m.

    base: If base is provided it is treated as the first period value 
          (that is, prior to differencing). It is prefixed to the m
          prior to  cumulating. It should be a vector of length
          dim(m)[2].  (If e is TRUE then base should be log of the
          original data).

     lag: integer indicating the number of periods relative to which
          the percent change should be calculated.

cumulate: logical indicating if the series should be cumulated before
          the percent change is calculated.

     ...: arguments passed to other methods.

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

     If code{cumulate} is TRUE then the data is cumulated first.
     'cumulate' can be a logical vector with elements corresponding to
     columns of m.

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

     For an object of class TSdata the percent change calculation is
     done with the output data and the result is an object of class
     TSdata (or a list of objects of class TSdata). For an object of
     class TSestModel the percent change calculation is done with
     'estimates$pred' and the result is an object of class TSdata (or a
      list of objects of class TSdata).

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

     'ytoypc'

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

     if(is.R()) data("eg1.DSE.data", package="dse1")
     z <- percentChange(outputData(eg1.DSE.data))

