SmoothedSplineDistribution      package:fBasics      R Documentation

_S_m_o_o_t_h_e_d _S_p_l_i_n_e _D_i_s_t_r_i_b_u_t_i_o_n

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

     A collection and description of functions to compute  density,
     distribution function, quantile function  and to generate random
     variates for empirical  distributions. Estimates are done using
     smoothing  spline ANOVA models with cubic spline, linear spline, 
     or thin-plate spline marginals for numerical variables. 

     The functions are:

       'dssd'  Spline smoothed density,
       'pssd'  spline smoothed probability function,
       'qssd'  spline smoothed quantiles,
       'rssd'  random deviates drawn from a ssd.

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

     dssd(x, param)
     pssd(q, param)
     qssd(p, param)
     rssd(n, param)

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

       n: number of observations. 

       p: a numeric vector of probabilities. 

    x, q: a numeric vector of quantiles. 

   param: a S3 object specifying the parameters as returned by the
          function 'ssdFit'. 

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

     This is an easy to use version for the functions implemented in
     Chong Gu's contributed R package "gss" which is downloadable from
     the CRAN server. If you require more functionality, e.g. to tailor
     the parameter estimate we recommend to install Gu's  package. The
     installation does not interfere with the functions implemented in
     Rmetrics.

     Note, before you can use the functions you have to estimate the
     parameters 'param' using the function 'ssdFit'.

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

     All values are numeric vectors: 'd*' returns the density, 'p*'
     returns the distribution function, 'q*' returns the quantile
     function, and 'r*' generates random deviates.

_N_o_t_e:

     The functions do not implement the full functionality provided by
     R's contributed package "gss". Only the "cubic" spline method is
     provided and most of the optional arguments are set to default
     values. Since the original "gss" package does not interfere with
     Rmetrics you can load it in parallel. 

     It's worth to note that the "gss" package does not work under
     SPlus, but the modified and adapted functions 'ssdFit' and '*ssd'
     can be used.

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

     Chong Gu for the code from R's contributed package 'gss', 
      Diethelm Wuertz for the Rmetrics R-port.

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

     Gu C., Wang, J. (2003); emph{Penalized likelihood density
     estimation: Direct cross-validation  and scalable approximation}, 
     Statistica Sinica, 13, 811-826. 

     Gu C. (2002); _Smoothing Spline ANOVA Models_, New York,
     Springer-Verlag.

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

     ## SOURCE("fBasics.13C-SmoothedSplineDistribution")

     ## ssd -
     ## Not run: 
        xmpBasics("\nStart: Spline Smoothed Distribution > ")
        par(mfcol = c(2, 1), cex = 0.5)
        set.seed(1953)
        x = rnorm(1000)
        param = ssdFit(x)
        # Plot empirical density and compare with fitted density:
        hist(x, n = 25, probability = TRUE, border = "white", col = "steelblue4") 
        s = seq(min(x), max(x), 0.1)
        lines(s, dssd(s, param), lwd = 2)
        # Plot df and compare with true df:
        plot(sort(x), (1:1000/1000), main = "Probability", col = "steelblue4")
        lines(s, pssd(s, param), lwd = 2)
        # Compute quantiles:
        qssd(pssd(seq(-3, 3, 1), param), param) 
     ## End(Not run)

