normpoly              package:Lmoments              R Documentation

_N_o_r_m_a_l-_p_o_l_y_n_o_m_i_a_l _q_u_a_n_t_i_l_e _m_i_x_t_u_r_e

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

     Density, distribution function, quantile function and random
     generation for the normal-polynomial quantile mixture.

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

     dnormpoly(x,param)
     pnormpoly(x,param)
     qnormpoly(cp,param)
     rnormpoly(n,param)
     normpoly_pdf(x,param)
     normpoly_cdf(x,param)
     normpoly_inv(cp,param)
     normpoly_rnd(n,param)

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

       x: vector of quantiles

      cp: vector of probabilities

       n: number of observations

   param: vector of parameters

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

     The length the parameter vector specifies the order of the
     polynomial in the quantile mixture.  If k<-length(param) then
     param[1:(k-1)] contains the mixture coefficients of polynomials
     starting from the constant and param[k] is the mixture coefficient
     for normal distribution. (Functions normpoly_pdf, normpoly_cdf,
     normpoly_inv and  normpoly_rnd are aliases for compatibility with
     older versions of this package.)

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

     'dnormpoly' gives the density, 'pnormpoly' gives the cumulative
     distribution function, 'qnormpoly' gives the quantile function,
     and 'rnormpoly' generates random deviates.

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

     Juha Karvanen juha.karvanen@ktl.fi

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

     Karvanen, J. 2005. Estimation of quantile mixtures via L-moments
     and trimmed L-moments,  _Computational Statistics & Data
     Analysis_, in press, <URL:
     http://www.bsp.brain.riken.jp/publications/2005/karvanen_quantile_
     mixtures.pdf>.

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

     'data2normpoly4' for the parameter estimation and 'dcauchypoly'
     for the Cauchy-polynomial quantile mixture.

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

     #Generates a sample 500 observations from the normal-polynomial quantile mixture, 
     #calculates L-moments and their covariance matrix,
     #estimates parameters via L-moments and 
     #plots the true pdf and the estimated pdf together with the histogram of the data.
     true_params<-lmom2normpoly4(c(0,1,0.2,0.05));
     x<-rnormpoly(500,true_params);
     lmoments<-Lmoments(x);
     lmomcov<-Lmomcov(x);
     estim_params<-lmom2normpoly4(lmoments);
     hist(x,30,freq=FALSE)
     plotpoints<-seq(min(x)-1,max(x)+1,by=0.01);
     lines(plotpoints,dnormpoly(plotpoints,estim_params),col='red');
     lines(plotpoints,dnormpoly(plotpoints,true_params),col='blue');

