lspec               package:polspline               R Documentation

_L_s_p_e_c: _l_o_g_s_p_l_i_n_e _e_s_t_i_m_a_t_i_o_n _o_f _a _s_p_e_c_t_r_a_l _d_i_s_t_r_i_b_u_t_i_o_n

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

     Fit an 'lspec' model to a time-series or a periodogram.

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

     lspec(data, period, penalty, minmass, knots, maxknots, atoms, maxatoms,
     maxdim , odd = FALSE, updown = 3, silent = TRUE) 

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

    data: time series (exactly one of 'data' and 'period' should be
          specified).  If 'data' is specified, 'lspec' first computes
          the modulus  of the fast Fourier transform  of the series
          using the function 'fft', resulting in a periodogram of
          length 'floor(length(data)/2)'.  

  period: value of the periodogram for a time series at frequencies 
          2pi*j/T, for 1<=j<=T/2. If period is specified, odd should
          indicate  whether the length of the series T is odd '(odd =
          TRUE)' or even '(odd = FALSE)'.  Exactly one of 'data' and
          'period' should be specified.  

 penalty: the parameter to be used in the AIC criterion. The method
          chooses  the number of basis  functions that minimizes '-2 *
          loglikelihood + penalty * (number of basis  functions)'. 
          Default is to use a penalty parameter of 'penalty =
          log(length(period))' as in BIC.  

 minmass: threshold value for atoms. No atoms having smaller mass than
          'minmass' are  included in the model. If 'minmass' takes its
          default value, in  95% of the samples, when data is Gaussian
          white noise, the model will not  contain atoms.  

   knots: ordered vector of values, which forces the method to start
          with these knots.  If 'knots' is not specified, the program
          starts with one knot at zero and then  employs stepwise
          addition of knots and atoms.  

maxknots: maximum number of knots allowed in the model. Does not need
          to be  specified, since the program has a default for
          'maxdim' and  the number of dimensions equals the number of
          knots plus the number of  atoms. If 'maxknots = 1' the fitted
          spectral density function is  constant.  

   atoms: ordered vector of values, which forces the method to start
          with discrete  components at these frequencies. The values of
          atoms are rounded  to the nearest multiple of 2*pi/T.  If
          atoms is not specified, the program starts with no atoms and
          then performs  stepwise addition of knots and atoms.  

maxatoms: maximum number of discrete components allowed in the model.
          Does not need to be  specified, since the program has a
          default for 'maxdim' and  the number of dimensions equals the
          number of knots plus the number of  atoms. If 'maxatoms = 0'
          a continuous  spectral distribution is fit.  

  maxdim: maximum number of basis  functions allowed in the model
          (default is  max(15,4*length(period)^0.2)).  

     odd: see 'period'. If 'period' is not specified, 'odd' is not
          relevant.  

  updown: the maximal number of times that 'lspec' should go through a
          cycle of stepwise  addition and stepwise deletion until a
          stable solution is reached.  

  silent: should printing of information be suppressed?

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

     Object of class 'lspec'. The output is organized to serve as input
     for 'plot.lspec' (summary plots), 'summary.lspec' (summarizes
     fitting), 'clspec' (for autocorrelations and autocovariances),
     'dlspec' (for spectral density and line-spectrum,)  'plspec' (for
     the spectral distribution), and 'rlspec' (for random time series
     with the same spectrum).

    call: the command that was executed.  

  thetap: coefficients of the polynomial part of the spline.  

  nknots: the number of knots that were retained.  

   knots: vector of the locations of the knots in the logspline model. 
          Only the knots that were retained are in this vector.   

  thetak: coefficients of the knot part of the  spline. The k-th
          coefficient is the coefficient  of  (x-t(k))^3_+.  

  natoms: the number of atoms that were retained.  

   atoms: vector of the locations of the atoms in the model.  Only the
          atoms that were retained are in this vector.   

    mass: The k-th coefficient is the mass at 'atom[k]'.  

    logl: the log-likelihood of the model.  

 penalty: the penalty that was used.  

 minmass: the minimum mass for an atom that was allowed.  

  sample: the sample size that was used, either computed as
          'length(data)' or  as '(2 * length(period))'  when 'odd =
          FALSE' or as '(2 * length(period) + 1)'  when 'odd = TRUE'.  

  updown: the actual number of times that 'lspec' went through a cycle
          of   stepwise addition and stepwise  deletion   until a
          stable solution was reached, or  minus the number of times
          that lspec went through a cycle of   stepwise addition and
          stepwise  deletion until it decided to quit.  

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

     Charles Kooperberg clk@fhcrc.org.

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

     Charles Kooperberg, Charles J. Stone, and Young K. Truong (1995).
     Logspline Estimation of a Possibly Mixed Spectral Distribution.
     _Journal of Time Series Analysis_, *16*, 359-388.

     Charles J. Stone, Mark Hansen, Charles Kooperberg, and Young K.
     Truong. The use of polynomial splines and their tensor products in
     extended linear modeling (with discussion) (1997).  _Annals of
     Statistics_, *25*, 1371-1470.

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

     'plot.lspec', 'summary.lspec', 'clspec', 'dlspec', 'plspec',
     'rlspec'.

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

     data(co2)
     co2.detrend <- unstrip(lm(co2~c(1:length(co2)))$residuals)
     fit <- lspec(co2.detrend)

