fdim                  package:fdim                  R Documentation

_C_a_l_c_u_l_a_t_i_o_n _o_f _g_e_n_e_r_a_l_i_z_a_t_e_d _f_r_a_c_t_a_l _d_i_m_e_n_s_i_o_n _o_f _D_a_t_a-_S_e_t_s.

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

     Returns the Fractal Dimension of data-frames.

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

     fdim(X, BaseR=2, Mnmax=TRUE, nMax=9, NumMinP=1, q=0, Alpha=0.2, PlotF=FALSE)

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

     The goal is to calculate the generalizated fractal dimension which
     can be written: 

          Dq=(1/(q-1))*(log(sum(Pj^q))/log(r)), when r -> 0

     where Pj is the probability that the element j has model points
     inside.  

       X: Data frame object containing the real data.

   BaseR: Factor for generation of cubic elements covering the space of
          state.

   Mnmax: Criteria for stopping the algorithm. TRUE for make sense the
          parameter nMax as steps of splitting the global box. In other
          case the algorithm stops when the number of boxes is greather
          than the half of number of points.

    nMax: Number of steps in the splitting process. (the exponent of
          the BaseR to determine the size of elementary box.)

 NumMinP: Minimum number of points inside of an elementary box to
          consider it is filled by points in terms of algorithm.

       q: Order of fractal dimension to be calculated. 

             *  q=0: Hausdorff Dimension

             *  q=0,999999: Information Dimension

             *  q=2: Correlation Dimension).

   Alpha: Confidence parameter to exclude some points if they are quite
          far in order to evaluate the slope of the linear regresion
          model.

   PlotF: Boolean for make possible to plot points directly.

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

     fdim returns fdim, the value of data's q-dimension.

     The subobjects returned by fdim are:

    fdim: Estimated q fractal dimension.

  points: Points (size of elements, number of elements with points
          inside).

slopeisOK: Inform us about the reliability of the fdim value.

coefficients: Structure of linear regression suitable for function
          coef.

pointsdif: Number of separated points.

residual: Residual of linear regression model.

sumSQRresidual: Squared sum of residuals for each point.

allpoints: All points calculated, even when they should be removed for
          the regression model.

   range: Range of all points

correlationdim: All points calculated to obtain the correlation
          dimension (q=2)

informationdim: All points calculated to obtain the information
          dimension (q=0.9999999999)

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

     Francisco Javier Martinez de Pison.
     francisco.martinez@dim.unirioja.es
     Joaquin Ordieres Mere.             
     joaquin.ordieres@dim.unirioja.es
     Manuel Castejon Limas.             
     manuel.castejon@dim.unirioja.es
     Fco. Javier de Cos Juez.           
     francisco-javier.de-cos@dim.unirioja.es

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

     Halsey C.T., Mogens H.J., Kandanoff L.P., Procaccia I., Shraiman
     B.I. "Fractal Measures and their singularities: The
     caracterization of strange sets". Physical Review  vol 33, n 2.
     1986

     Roberts J.A., Cronin A. "Unbiased estimation of multi-fractal
     dimensions of finite data sets" <URL:
     http://www.sci.usq.edu.au/pub/MC/staff/robertsa/multif.htm> . July
     1996.

     David M. Alexander, Phil Sheridan, Paul D. Bourke, Otto
     Konstandatos. "Global and local similarity of the primary visual
     cortex: mechanisms of orientation preference". HELNET -
     International Workshop on Neural Networks, September 1997

     Geoffrey B. West, James H. Brown, Brian J. Enquist. "The Fourth
     Dimension of Life: Fractal Geometry and Allometric Scaling of
     Organisms"., Santa Fe Institute of Research. 1999

     Christo Faloutsos, Volker Gaede. "Analisys of n-dimensional
     Quadtrees Using the Hausdorff Fractal Dimension". Mumbai (Bombay),
     Proceedings of the 22nd  VLDB Conference, India, 1996.

     Alberto Belussi, Christo Faloutsos. "Estimating the Selectivity of
     Spatial Queries Using the 'Correlation' Fractal Dimension".,
     Zurich, Switzerland, Proceedings of the 21st VLDB Conference,
     1995.

     Menndez Fernndez C.; Ordieres Mer J.; Ortega Fernndez F.
     "Importance of information pre-processing importance in the
     improvement of neural networks results.". International Journal on
     Expert System and Neural Networks, Vol. 13, No. 2, pp. 95-103. May
     1996.


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

     `introfdim', `slopeopt', `makefract'

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

     #Example 1
     library(fdim)
     data <- makeline(10000,3,100)           # Build a data-set if the user doesn't has it.
     df <- fdim(data,q=0,Alpha=0.3)          # Calculation of fractal dimension
     print (df$fdim)                         # Show us the q-dimension value.
     print (df)                              # Show us relevant information about the estimated
                                             # fractal dimension.

     plot(df$allpoints)                      # make a plot in order to see the ipoints individually
     abline(coef(df),col=2)                  # draw a line in order to see the correlation
                                             # If we think the confidence criteria must be changed ...
     df2 <- slopeopt(as.matrix(df$allpoints),Alpha=0.5)
     summary(df2)                            # Show us the quality of the approach.

     #Example 2
     data <- makessphere(1000)               #Build a data-set with points making a Sphere Surface
     if (require(xgobi)) xgobi(data)         #Show data      
     df <- fdim(data,q=0,Alpha=0.2,PlotF=TRUE)       # Calculation of fractal dimension
     print(df$fdim)                          #Fractal Dimension

