turnpoints              package:pastecs              R Documentation

_A_n_a_l_y_z_e _t_u_r_n_i_n_g _p_o_i_n_t_s (_p_e_a_k_s _o_r _p_i_t_s)

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

     Determine the number and the position of extrema (turning points,
     either peaks or pits) in a regular time series. Calculate the
     quantity of information associated to the observations in this
     series, according to Kendall's information theory

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

     turnpoints(x)
     summary(turnp)
     plot(turnp, level=0.05, lhorz=TRUE, lcol=2, llty=2, ...)
     lines(turnp, max=TRUE, min=TRUE, median=TRUE,
             col=c(4, 4, 2), lty=c(2, 2, 1), ...)
     extract(turnp, n, no.tp=0, peak=1, pit=-1)

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

       x: a vector or a time series 

   turnp: a 'turnpoints' object, as returned by the function
          `turnpoints()' 

   level: the significant level to draw on the graph if `lhorz=TRUE'.
          By default, `level=0.05', which corresponds to a 5% p-value
          for the test 

   lhorz: if `lhorz=TRUE' (by default), an horizontal line indicating
          significant level is drawn on the graph 

    lcol: the color to use to draw the significant level line, by
          default, color 2 is used 

    llty: the style to use for the significant level line. By default,
          style 2 is used (dashed line) 

     ...: Additional graph parameters 

     max: do we plot the maximum envelope line (by default, yes) 

     min: do we plot the minimum envelope line (by default, yes) 

  median: do we plot the median line inside the envelope (by default,
          yes) 

     col: a vector of three values for the color of the max, min,
          median lines, respectively. By default `col=c(4,4,2)' 

     lty: a vector of three values for the style of the max, min,
          median lines, respectively. By default `lty=c(2,2,1)', that
          is: dashed, dashed and plain lines 

       n: the number of points to extract. By default
          `n=length(turnp)', all points are extracted 

   no.tp: extract gives a vector representing the position of extrema
          in the original series. `no.tp' represents the code to use
          for points that are not an extremum, by default '0' 

    peak: the code to use to flag a peak, by default '1' 

     pit: the code to use to flag a pit, by default '-1' 

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

     This function tests if the time series is purely random or not.
     Kendall (1976) proposed a series of tests for this. Moreover,
     graphical methods using the position of the turning points to draw
     automatically envelopes around the data are implemented, and also
     the drawing of median points between these envelopes

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

     An object of type 'turnpoints' is returned. It has methods
     `print()', `summary()', `plot()', `lines()' and `extract()'.

_W_A_R_N_I_N_G:

     the `lines()' method should be used to draw lines on the graph of
     the original dataset (`plot(data, type="l")' for instance), not on
     the graph of turning points (`plot(turnp)')!

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

     Frdric Ibanez (ibanez@obs-vlfr.fr), Philippe Grosjean
     (phgrosjean@sciviews.org)

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

     Kendall, M.G., 1976. Time-series, 2nd ed. Charles Griffin & Co,
     London.

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

     `turnogram', `stat.slide'

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

     data(marbio)
     plot(marbio[, "Nauplii"], type="l")
     # Calculate turning points for this series
     Nauplii.tp <- turnpoints(marbio[, "Nauplii"])
     summary(Nauplii.tp)
     plot(Nauplii.tp)
     # Add envelope and median line to original data
     plot(marbio[, "Nauplii"], type="l")
     lines(Nauplii.tp)
     # Note that lines() applies to the graph of original dataset!!!
     title("Raw data, envelope maxi., mini. and median line")

