search for: vsamples

Displaying 5 results from an estimated 5 matches for "vsamples".

Did you mean: samples
2008 May 22
1
Computing Maximum Loglikelihood With "nlm" Problem
Hi, I tried to compute maximum likelihood under gamma distribution, using nlm function. The code is this: __BEGIN__ vsamples<- c(103.9, 88.5, 242.9, 206.6, 175.7, 164.4) mlogl <- function(alpha, x) { if (length(alpha) > 1) stop("alpha must be scalar") if (alpha <= 0) stop("alpha must be positive") return(- sum(dgamma(x, shape = alpha, log = TRUE))) } mlogl_out <- nlm(mlog...
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_...
2008 May 23
1
maximizing the gamma likelihood
...t;- function(data, fixed=c(FALSE,FALSE)) { op <- fixed function(p) { op[!fixed] <- p shape <- exp(op[1]) scale <- exp(op[2]) a <- length(data)*shape*log(scale) b <- (shape-1)*sum(log(data)) c <- -1.0*scale*sum(data) -(a + b + c) } } vsamples<- c(14.7, 18.8, 14, 15.9, 9.7, 12.8) nLL <- make.negloglik(vsamples) temp <- optim(c(scale=1,shape=1), nLL, method="BFGS")[["par"]] estimates <- log(temp) print(estimates) check <- estimates[1]/mean(vsamples) print(check)
2008 May 23
0
Est. Component Size with AIC/BIC under Gamma Distribution
...ce <- abs(thetalast - thetacurrent) # E-STEP new_maxlogl <- nlm(mlogl, mean(smpl), theta_func=theta, samp=smpl) # M-STEP if (new_maxlogl$minimum > best) { best <- new_maxlogl$minimum } } best } # main program # my samples vsamples<- c(14.7, 18.8, 14, 15.9, 9.7, 12.8) # initialize start_ <- 300 error_ <- 0.001 thetastart <- 1 k <- 5 # compute AIC/BIC for k component for (nofc in 1:k { cat("k = ", nofc, "\n") maxlogl <- -(mlogl_process(vsamples,error_,thetastart)) bic_k <- find...
2011 Nov 28
6
xenoprof patch for oprofile-0.9.7
I am rebasing Fedora rawhide oprofile package to oprofile-0.9.7. The xenoprof patches on http://xenoprof.sourceforge.net/#download look a bit dated. The newest version is for oprofile-0.9.5. I massaged the patch oprofile-0.9.5-xen.patch to apply to oprofile-.0.9.7. Attached is that updated patch. Does this look reasonable? Is there a desire to get this into upstream oprofile? Or should the