similar to: MLEs using optim

Displaying 20 results from an estimated 10000 matches similar to: "MLEs using optim"

2006 Aug 24
1
Optim question
This is a very basic question, but I am a bit confused with optim. I want to get the MLEs using optim which could replace the newton-raphson code I have below which also gives the MLEs. The function takes as input a vector x denoting whether a respondent answered an item correctly (x=1) or not (x=0). It also takes as input a vector b_vector, and these are parameters of test items (Rasch estimates
2012 Aug 02
1
finding the MLEs of IG parameters by EM-Alorithm
Dear all I'm trying to caculate the MLEs for parameters of Inverse Gaussian distribution (in a k-sample problem with common mean) by using EM-Algorithm. I found some package for EM-Algorithm that are useful for missing or incomplete data and are not helpful for solving my problem. (Exactly, the problem is: Let Xij, i=1,..,k , j=1,...,ni, be a random sample from IG(?,?i). So the
2008 Jun 24
1
Hessian in box-constraint problem - concern OPTIM function
Hello all useRs, I am using the OPTIM function with particular interest in the method L-BFGS-B, because it is a box-constraint method. I have interest in the errors estimates too. I make: s.e. <- sqrt( diag( solve( optim(...,method='L-BFGS-B', hessian=TRUE)$hessian ))) but in help say: "Note that this is the Hessian of the unconstrained problem even if the box constraints
2007 Jul 21
1
Gamma MLE
Hello, I was asked to try the following code on R, gamma.mles function (xx,shape0,rate0) { n<- length(xx) xbar<- mean(xx) logxbar<- mean(log(xx)) theta<-c(shape0,rate0) repeat { theta0<- theta shape<- theta0[1] rate<- theta0[2] S<- n*matrix(c(log(rate)-digamma(shape)+logxbar,shape/rate-xbar),ncol=1) I<- n*matrix(c(trigamma(shape),-1/rate,-1/rate,shape/rate^2),ncol=2)
2010 May 07
2
problem in using optim
Dear R users, When I was trying to use the function *optim* to get the MLEs, quite a few warning messages showed up as below: Warning in log(psi * lam) : NaNs produced I am just wondering what does this mean? Was it something wrong with my likelihood function or was it sth wrong with the data? Thanks in advance. Carol Gao [[alternative HTML version deleted]]
2010 Sep 29
1
nlminb and optim
I am using both nlminb and optim to get MLEs from a likelihood function I have developed. AFAIK, the model I has not been previously used in this way and so I am struggling a bit to unit test my code since I don't have another data set to compare this kind of estimation to. The likelihood I have is (in tex below) \begin{equation} \label{eqn:marginal} L(\beta) = \prod_{s=1}^N \int
2008 May 16
0
How to determine sensible values for 'fnscale' and 'parscale' in optim
Dear R-help, I'm using the 'optim' functions to minimise functions, and have read the documentation, but I'm still not sure how to determine sensible values to use for the 'fnscale' and 'parscale' options. If I have understood everything correctly, 'fnscale' should be used to scale the objective function, so that for example if the default is
2012 Oct 18
7
summation coding
I would like to code the following in R: a1(b1+b2+b3) + a2(b1+b3+b4) + a3(b1+b2+b4) + a4(b1+b2+b3) or in summation notation: sum_{i=1, j\neq i}^{4} a_i * b_i I realise this is the same as: sum_{i=1, j=1}^{4} a_i * b_i - sum_{i=j} a_i * b_i would appreciate some help. Thank you. -- View this message in context: http://r.789695.n4.nabble.com/summation-coding-tp4646678.html Sent from the R
2009 Dec 10
1
MLE for a t distribution
Given X1,...,Xn ~ t_k(mu,sigma) student t distribution with k degrees of freedom, mean mu and standard deviation sigma, I want to obtain the MLEs of the three parameters (mu, sigma and k). When I try traditional optimization techniques I don't find the MLEs. Usually I just get k->infty. Does anybody know of any algorithms/functions in R that can help me obtain the MLEs? I am especially
2005 Apr 11
1
TSeries GARCH Estimates accuracy
Hi, I am trying to fit a GARCH(1,1) model to a financial timeseries using the 'garch' function in the tseries package. However the parameter estimates obtained sometimes match with those obtained using SAS or S-Plus (Finmetrics) and sometimes show a completely different result. I understand that this could be due to the way optimization of MLEs are done, however, I would appreciate any
2006 Sep 26
1
warning message in nlm
Dear R-users, I am trying to find the MLEs for a loglikelihood function (loglikcs39) and tried using both optim and nlm. fredcs39<-function(b1,b2,x){return(exp(b1+b2*x))} loglikcs39<-function(theta,len){ sum(mcs39[1:len]*fredcs39(theta[1],theta[2],c(8:(7+len))) - pcs39[1:len] * log(fredcs39(theta[1],theta[2],c(8:(7+len))))) } theta.start<-c(0.1,0.1) 1. The output from using optim is
2012 Oct 29
2
Two-way Random Effects with unbalanced data
Hi there, I am looking to fit a two-way random effects model to an *unblalanced* layout, y_ijk = mu + a_i + b_j + eps_ijk, i=1,...,R, j=1,...,C, k=1,...,K_ij. I am interested first of all in estimates for the variance components, sigsq_a, sigsq_b and sigsq_error. In the balanced case, there are simple (MM, MLE) estimates for these; In the unbalanced setup,
2010 Jun 26
4
optim() not finding optimal values
I am trying to use optim() to minimize a sum-of-squared deviations function based upon four parameters. The basic function is defined as ... SPsse <- function(par,B,CPE,SSE.only=TRUE) { n <- length(B) # get number of years of data B0 <- par["B0"] # isolate B0 parameter K <- par["K"]
2012 Nov 21
2
ifelse + numeric
Hi, I have a data frame and I need to add another column. I am using: data[,4] <- ifelse(data[,3]<1,data[,1]/(1-data[,3]),"NA") This is returning values but are in quotation marks. The error I am getting is "non-numeric argument to binary operator" I need column four in data to be numeric. Tried as.numeric but it did not work well either. Would appreciate any help.
2008 Apr 26
1
integration error when I use "optim" and "integrate" simultaneously
Dear R users, When I use two functions, 'optim' and 'integrate', simultaneously, I always get an error like this -------------------------------------------------------------------------- numint = function(z) { dlnorm(z,mu[1],sqrt(exp(g[1]))) * dnorm((z-mu[2])/sqrt(exp(g[2])))/sqrt(exp(g[2])) } integrate(numint,lower=0,upper=Inf)$value Error in integrate(numint, lower = 0,
2010 Jun 17
2
Pretty printing progress
I have a function that is an iterative process for estimating some MLEs. I want to print some progress to screen as the process iterates. I would like to try and line things up nicely in the R window, but am not sure the best way to do this. Below is a toy example. Suppose I want the value of 10 to be just below "iteration" and the value of -1234 to be just below 'Log
2005 Jul 03
1
Symbolic Maximum Likelihood in R
Dear List: Is any one aware of a package that would extend the D() function and allow for one to maximize a likelihood function symbolically? Something akin to Solve[x==0, parameter] function in Mathematica? Clearly R has the capacity to _compute_ MLEs given a set of data. But, I'm looking for a package that would allow for me to define the likelihood function, find the 1st order partial
2010 Feb 12
1
validate (rms package) using step instead of fastbw
Dear All, For logistic regression models: is it possible to use validate (rms package) to compute bias-corrected AUC, but have variable selection with AIC use step (or stepAIC, from MASS), instead of fastbw? More details: I've been using the validate function (in the rms package, by Frank Harrell) to obtain, among other things, bootstrap bias-corrected estimates of the AUC, when variable
2004 Jun 10
1
overhaul of mle
So, I've embarked on my threatened modifications to the mle subset of the stats4 package. Most of what I've done so far has *not* been adding the slick formula interface, but rather making it work properly and reasonably robustly with real mle problems -- especially ones involving reasonably complex fixed and default parameter sets. Some of what I've done breaks backward
2005 Jul 10
1
O/T -2 Log Lambda and Chi Square
Hi R People: Sorry about the off topic question. Does anyone know the reference for "-2 Log Lambda is approx dist. Chi square", please? It may be Bartlett, but I'm not sure.... thanks in advance! Sincerely, Laura Holt mailto: holtlaura at gmail.com