N2G               package:AnalyzeFMRI               R Documentation

_F_i_t_s _t_h_e _N_2_G _m_o_d_e_l

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

     Fits the N2G model (1 Normal and 2 Gamma's mixture model) to a
     dataset using Maximum Likelihhod.

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

     N2G(data, par.start = c(4, 2, 4, 2, 0.9, 0.05))

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

    data: The dataset.

par.start: The starting values for the optimization to maximize the
          likelihood. The parameters of the model are ordered in the
          vector par.start in the following way (refer to the model
          below)

          c(a, b, c, d, p1, p2)

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

     The mixture model considered is a mixture of a standard normal
     distribution and two Gamma functions. This model is denoted N2G.

     x ~ p1 * N(0, 1) + p2 * Gamma(a, b) + (1 - p1 - p2) * -Gamma(c, d)

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

     A list with components 

     par: The fitted parameter values.

    lims: The upper and lower thresholds for the Normal component of
          the fitted model

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

     J. L. Marchini

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

     'N2G.Class.Probability',  'N2G.Likelihood.Ratio', 
     'N2G.Spatial.Mixture', 'N2G.Density' ,         'N2G.Likelihood' , 
      'N2G.Transform', 'N2G.Fit'    ,              'N2G.Inverse'   ,   
          'N2G.Region'

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

     par <- c(3, 2, 3, 2, .3, .4)
     data <- c(rnorm(10000), rgamma(2000, 10, 1), -rgamma(1400, 10, 1))
     hist(data, n = 100, freq = FALSE)

     q <- N2G.Fit(data, par, maxit = 10000, method = "BFGS")
     p <- seq(-50, 50, .1)
     lines(p, N2G.Density(p, q), col = 2)

