lfo.run               package:RTisean               R Documentation

_M_o_d_e_l_i_n_g _d_a_t_a _t_h_r_o_u_g_h _a _l_o_c_a_l _l_i_n_e_a_r _a_n_s_a_t_z

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

     Makes either a local linear ansatz or a zeroth order ansatz  for a
     time series and iterates an artificial trajectory. The initial
     values for the trajectory are the last points of the original time
     series. Thus it actually  forecasts the time series.

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

     lfo.run(series, l, x = 0, m, c, d = 1, L = 1000, k = 30, r, f = 1.2, O = FALSE)

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

  series: a vector or matrix.

       l: number of points to use. 

       x: number of lines to be ignored. 

       m: number of components, embedding dimension. 

       c: column to be read. 

       d: delay for the embedding. 

       L: length of prediction. 

       k: minimal numbers of neighbors for the fit. 

       r: neighborhood size to start with. 

       f: factor to increase the neighborhood size if not enough
          neighbors were found. 

       O: performs a zeroth order fit instead of a local linear one. 

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

     Once in an iteration the algorithm creates a point which is far
     away from the original time series, the procedure stops since no
     neighbors can be found and no local model can be constructed (from
     Kantz, pag. 330).

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

     A vector containing the forecasted time series.

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

     ## Not run: 

     par(mfrow=c(2,1))
     dat<-logistic(r=3.6)
     nsteppred<-lfo.run(dat[1:950])
     plot(dat[951:1000],t="l",xlab="Time",ylab="x",ylim=c(0.2,0.9),
     main="Local linear model on logistic data")
     lines(nsteppred,col=2)
     validiter<-length(nsteppred)

     legend(40,0.35, "Real data",fill=1,bty="n",cex=0.7)
     legend(40,0.3, "Artificial data",fill=2,bty="n",cex=0.7)

     par(cex.lab=0.8)
     plot(abs(dat[951:1000][1:validiter]-nsteppred),t="l",xlim=c(1,50),xlab="Time",ylab="Distance from original time series")
     text(40,1,paste("Last neighbor found at iteration", validiter),cex=0.7)

     ## End(Not run)

