similar to: question about optim

Displaying 20 results from an estimated 20000 matches similar to: "question about optim"

2010 Oct 22
2
Error message in using nlm() and optim()
I am facing a problem when trying to maximize the likelihood function. I am actually estimating a dynamic switching regression model using simulated likelihood approach. The likelihood function is estimated using Simulations and is extremely complex. It comprises of 16 parameters ,q1, q2, q3,.......q16. While attempting to maximize the likelihood function, using the functions nlm() and optim(),
2003 Nov 12
2
question about matrix
Hello, I have a few questions about matrix in R. Can we make a matrix whose elements are list? I would like to save two different values in each elements of matrix. If there is a package or something which can deal with complex numbers, that will do it too. Also, I am wondering whether there is a function to calculate the rank of the matrix. I found a matrix package, but it doesn't have
2007 Apr 10
1
nlm() and optim()
Dear R-users, I have just joint the list and much appreciate any thoughts on 2 issues. Firstly, I want to reproduce some minimization results conducted in MATLAB. I have suceeded with nlm and optim-method CG. I have been told that I should get also with other optim methods. Actually, I found the same results when testing a very straightforward equation. However with a more complicated model it
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
2004 Oct 12
2
constrained optimization using nlm/optim?
I'm looking for an example of a simple R script that impliments a contrained nonlinear function using nlm or optim. I'm not exactly sure how to impliment the constraints within the objective function that is passed to nlm/optim. obj.func <- function( p ) { x(p) <- unconstrained obj function value if( constraint1 > something ) { obj.func <- x(p) } else {
2005 Oct 03
1
ML optimization question--unidimensional unfolding scaling
I'm trying to put together an R routine to conduct unidimensional unfolding scaling analysis using maximum likelihood. My problem is that ML optimization will get stuck at latent scale points that are far from optimal. The point optimizes on one of the observed variables but not others and for ML to move away from this 'local optimum', it has to move in a direction in which the
2009 Dec 06
5
optim with constraints
Hi, dear R users I am a newbie in R and I wantto use the method of meximum likelihood to fit a Weibull distribution to my survival data. I use "optim" as follows: optim(c(1, 0.25),weibull.like,mydata=mydata,method="L-BFGS-B",hessian = TRUE) My question is: how do I setup the constraints so that the two parametrs of Weibull to be pisotive? Or should I use other function
2010 Feb 02
1
how to use optim() or nlm() to solve three nonlinear equations
Dear all, I just know how to solve an eaquation by using optim() or nlm(). But, now, I have three nonlinear equations, how could we use optim() or nlm() to solve  a system of nonlinear equations in R?  Thank you so much. Sincerely, Joe ___________________________________________________ 您的生活即時通 - 溝通、娛樂、生活、工作一次搞定! [[alternative HTML version deleted]]
2009 Nov 03
1
Maximum Likelihood Estimation
Hi, I would like estimate a model for function of production's Coob-Douglas using maximum likelihood. The model is log(Y)= beta[1]+beta[2]*log(L)+beta[3]*log(K). I tried estimate this model using the tools nlm ( ) and optim ( ) using the log-likelihood function below: > mloglik <- function (beta, Y, L, K) { + n <- length(Y) + sum ( (log(Y)-
2003 Jan 23
2
Profile on optim/nlm
Greetings, Before I reinvent the wheel has anyone done a profile function for a fit using optim (or nlm)? (like the buggy profile.ms in S+) . It seems a bit tricky as the function to be minimised has to have arguments corresponding to the variables being fitted - which is one less than the function provided to optim()... I guess you can create another function on the fly somehow. Cheers,
2005 Nov 03
1
ML optimization question--unidimensional unfolding scalin g
Alternatively, just type debug(optim) before using it, then step through it by hitting enter repeatedly... When you're done, do undebug(optim). Andy > From: Spencer Graves > > Have you looked at the code for "optim"? If you > execute "optim", it > will list the code. You can copy that into a script file and walk > through it line by line to
2005 Oct 11
2
Sometimes having problems finding a minimum using optim(), optimize(), and nlm() (while searching for noncentral F parameters)
Hi everyone. I have a problem that I have been unable to determine either the best way to proceed and why the methods I'm trying to use sometimes fail. I'm using the pf() function in an optimization function to find a noncentrality parameter that leads to a specific value at a specified quantile. My goal is to have a general function that returns the noncentrality parameter that
2008 Aug 08
2
Suggestion for the optimization code
Dear list, Here's a suggestion about the different optimization code. There are several optimization procedures in the base package (optim, optimize, nlm, nlminb, ..). However, the output of these functions are slightly different. For instance, 1. optim returns a list with arguments par (the estimates), value the minimum (maxima) of the objective function, convergence (optim
2007 Sep 16
1
Problem with nlm() function.
In the course of revising a paper I have had occasion to attempt to maximize a rather complicated log likelihood using the function nlm(). This is at the demand of a referee who claims that this will work better than my proposed use of a home- grown implementation of the Levenberg-Marquardt algorithm. I have run into serious hiccups in attempting to apply nlm(). If I provide gradient and
2008 Aug 05
1
optimize simultaneously two binomials inequalities using nlm( ) or optim( )
Dear R users, I?m trying to optimize simultaneously two binomials inequalities (used in acceptance sampling) which are nonlinear solution, so there is no simple direct solution. Please, let me explain shortly the the problem and the question as following. The objective is to obtain the smallest value of 'n' (sample size) satisfying both inequalities: (1-alpha) <= pbinom(c, n, p1)
2001 Nov 25
2
another optimization question
Dear R list members, Since today seems to be the day for optimization questions, I have one that has been puzzling me: I've been doing some work on sem, my structural-equation modelling package. The models that the sem function in this package fits are essentially parametrizations of the multinormal distribution. The function uses optim and nlm sequentially to maximize a multinormal
2011 May 30
1
Error in minimizing an integrand using optim
Hi, Am not sure if my code itself is correct. Here's what am trying to do: Minimize integration of a function of gaussian distributed variable 'x' over the interval qnorm(0.999) to Inf by changing value of parameter 'mu'. mu is the shift in mean of 'x'. Code: # x follows gaussian distribution # fx2 to be minimized by changing values of mu # integration to be done over
2002 Apr 26
1
optim or nlm with matrices
Hi, I have the following hypothetical optimization problem: -det(t(x-A%*%x1)%*%(x-A%*%x1)) where A,x,x1 are matrices. A coefficients and x and x1 are variable matrices or vectors. I tried to apply optim and nlm functions but I kept receive the following massage: Error in A%*%x1 : non-conformable arguments. The massage appears even the -det() can be calculated and the dimensions are checked. here
2011 Jul 12
1
LOESS function Newton optimization
I have a question about running an optimization function on an existing LOESS function defined in R. I have a very large dataset (1 million observations) and have run a LOESS regression. Now, I want to run a Newton-Raphson optimization to determine the point at which the slope change is the greatest. I am relatively new to R and have tried several permutations of the maxNR and nlm functions with
2011 Sep 22
1
nlm's Hessian update method
Hi R-help! I'm trying to understand how R's nlm function updates its estimate of the Hessian matrix. The Dennis/Schnabel book cited in the references presents a number of different ways to do this, and seems to conclude that the positive-definite secant method (BFGS) works best in practice (p201). However, when I run my code through the optim function with the method as "BFGS",