search for: theta_func

Displaying 2 results from an estimated 2 matches for "theta_func".

Did you mean: the_func
2008 May 23
2
About Passing Arguments to Function
Hi, Below I have a function mlogl_k, later it's called with "nlm" . __BEGIN__ vsamples<- c(14.7, 18.8, 14, 15.9, 9.7, 12.8) mlogl_k <- function( k_func, x_func, theta_func, samp) { tot_mll <- 0 for (comp in 1:k_func) { curr_mll <- (- sum(dgamma(samp, shape = x_func, scale=theta_func, log = TRUE))) tot_mll <- tot_mll + curr_mll } tot_mll } # Calling the function above mlogl_out <- nlm(mlogl_k, mean(vsamples), k_func =2,...
2008 May 23
0
Est. Component Size with AIC/BIC under Gamma Distribution
Dear all, I am trying to model number of samples from a given series. The series are modelled according Gamma function. In order to estimate the # samples, I use BIC/AIC with MLE (computed from dgamma function). Here is the code I have. __BEGIN__ mlogl <- function( x_func, theta_func, samp) { # computing log_likelihood return( - sum(dgamma(samp, shape = x_func, scale=theta_func, log = TRUE))) } find_bic <- function(mll,smpl,k) { bic <- (-2 * mll) + (k * log(length(smpl))) bic } find_aic <- function(mll,smpl,k) { aic <- (-2 * mll) + (k *...