similar to: maximizing the gamma likelihood

Displaying 20 results from an estimated 500 matches similar to: "maximizing the gamma likelihood"

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)))
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 }
2009 Aug 20
1
Understanding R code
What is 1. par.ests <- optimfit$par 2. fisher <- hessb(negloglik, par.ests, maxvalue=maxima); 3. varcov <- solve(fisher); 4. par.ses <- sqrt(diag(varcov)); Thanks a lot, fit.GEV <- function(maxima) { sigma0 <- sqrt((6. * var(maxima))/pi) mu0 <- mean(maxima) - 0.57722 * sigma0 xi0 <- 0.1 theta <- c(xi0, mu0, sigma0) #10/5/2007: removed assign() for maxima.nl
2011 Oct 17
1
simultaneously maximizing two independent log likelihood functions using mle2
Hello, I have a log likelihood function that I was able to optimize using mle2. I have two years of the data used to fit the function and I would like to fit both years simultaneously to test if the model parameter estimates differ between years, using likelihood ratio tests and AIC. Can anyone give advice on how to do this? My likelihood functions are long so I'll use the tadpole
2007 Jan 10
2
problems with optim, "for"-loops and machine precision
Dear R experts, I have been encountering problems with the "optim" routine using "for" loops. I am determining the optimal parameters of several nested models by minimizing the negative Log-Likelihood (NLL) of a dataset. The aim is to find the model which best describes the data. To this end, I am simulating artificial data sets based on the model with the least number
2010 Jul 08
2
Using nlm or optim
Hello, I am trying to use nlm to estimate the parameters that minimize the following function: Predict<-function(M,c,z){ + v = c*M^z + return(v) + } M is a variable and c and z are parameters to be estimated. I then write the negative loglikelihood function assuming normal errors: nll<-function(M,V,c,z,s){ n<-length(Mean) logl<- -.5*n*log(2*pi) -.5*n*log(s) -
2006 Aug 09
1
scaling constant in optim("L-BFGS-B")
Hi all, I am trying to find estimates for 7 parameters of a model which should fit real data. I have a function for the negative log likelihood (NLL) of the data. With optim(method="L-BFGS-B",lower=0) I am now minimizing the NLL to find the best fitting parameters. My problem is that the algorithm does not converge for certain data sets. I have read that one should scale the fn
2006 Aug 26
1
problems with loop
Dear all, I am trying to evaluate the optimisation behaviour of a function. Originally I have optimised a model with real data and got a set of parameters. Now I am creating simulated data sets based on these estimates. With these simulations I am estimating the parameters again to see how variable the estimation is. To this end I have written a loop which should generate a new simulated data
2012 Jul 05
3
Maximum Likelihood Estimation Poisson distribution mle {stats4}
Hi everyone! I am using the mle {stats4} to estimate the parameters of distributions by MLE method. I have a problem with the examples they provided with the mle{stats4} html files. Please check the example and my question below! *Here is the mle html help file * http://stat.ethz.ch/R-manual/R-devel/library/stats4/html/mle.html http://stat.ethz.ch/R-manual/R-devel/library/stats4/html/mle.html
2009 Jul 02
1
Quantitative Risk Management by McNeil
Dear Specialists in R, May be somebody has experiment in using pakage for the book Quantitative Risk Management by McNeil? This package is writen in R. I have run this package for fitting the data to Nornal Inverse Gaussian distribution and fased with following problem. > Return<-read.csv("data.csv") > Transpose<-t(Return) > fit.NH(Transpose, case="NIG",
2007 Dec 04
2
weighted Cox proportional hazards regression
I'm getting unexpected results from the coxph function when using weights from counter-matching. For example, the following code produces a parameter estimate of -1.59 where I expect 0.63: d2 = structure(list(x = c(1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1), wt = c(5, 42, 40, 4, 43, 4, 42, 4, 44, 5, 38, 4, 39, 4, 4, 37, 40, 4, 44, 5, 45, 5, 44, 5), riskset =
2006 Sep 14
1
EBAM ERROR
Dear RUsers, I am new to R. I am learning how to use R. I am a PC user and run R on windows. I would appreciate if some one could guide me on a few questions I have: 1) I have 4 cel files (2 replicates for NORM and Disease resp). I have been able to run siggenes on this dataset where I have 4 labels in the class file groupsnhi.cl op-> (0,0,1,1) and my data has been read into datrmanhi after
2019 Apr 24
1
Bug in "stats4" package - "confint" method
Dear R developers, I noticed a bug in the stats4 package, specifically in the confint method applied to ?mle? objects. In particular, when some ?fixed? parameters define the log likelihood, these parameters are stored within the mle object but they are not used by the ?confint" method, which retrieves their value from the global environment (whenever they still exist). Sample code: >
2012 Oct 05
2
problem with convergence in mle2/optim function
Hello R Help, I am trying solve an MLE convergence problem: I would like to estimate four parameters, p1, p2, mu1, mu2, which relate to the probabilities, P1, P2, P3, of a multinomial (trinomial) distribution. I am using the mle2() function and feeding it a time series dataset composed of four columns: time point, number of successes in category 1, number of successes in category 2, and
2004 Aug 10
1
Question about mle function
Dear all, I'd like to find the mle esttimates using the mle function mle(negloglik, start = list(), fixed=list(), method="..."). I am using the L-BGFS-B method and I don't supply the gradient function. Is there a way to print the gradients found at the solution value? I am using R-1.9.1 on Windows and on Unix. Thank you in advance, Victoria Landsman. [[alternative
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
2004 Oct 05
1
Bug in optim - way to solve problem?
Hi, I want to automatically fit variograms to a large number of different sample data sets, and call the funtion "likfit" (in package geoR) from within a for-loop. "likfit" does again call "optim". After ssuccessfully fitting variograms to some of the data sets, the procedure crashes and I get the error message: Error in optim(par = ini, fn = negloglik.GRF,
2004 Jul 14
1
Running the optimization on the subset of parameters
Dear all, I'd like to find a minimum of (-loglik) function which is a function of k parameters. I'd like to run the minimization algorithm for the different subsets of the parameters and assign the fixed values to the complementary subset. How should I define my (-loglik) function such that it can be passed to the optim or other optimization function? Much thanks for any suggestions.
2003 Dec 11
0
Re: [R] chisq.test freezing on certain inputs (PR#5701)
On Thu, 11 Dec 2003, Jeffrey Chang wrote: > Hello everybody, > > I'm running R 1.8.1 on both Linux and OS X compiled with gcc 3.2.2 and > 3.3, respectively. The following call seems to freeze the interpreter > on both systems: > > chisq.test(matrix(c(233, 580104, 3776, 5786104), 2, 2), > simulate.p.value=TRUE) > > By freeze, I mean, the function call never
2003 Dec 11
2
chisq.test freezing on certain inputs
Hello everybody, I'm running R 1.8.1 on both Linux and OS X compiled with gcc 3.2.2 and 3.3, respectively. The following call seems to freeze the interpreter on both systems: > chisq.test(matrix(c(233, 580104, 3776, 5786104), 2, 2), simulate.p.value=TRUE) By freeze, I mean, the function call never returns (running > 10 hours so far), the process is unresponsive to SIGINT (but I