similar to: how to use optim() or nlm() to solve three nonlinear equations

Displaying 20 results from an estimated 300 matches similar to: "how to use optim() or nlm() to solve three nonlinear equations"

2010 Jan 23
2
About LU decomposition in R
Hi, How can I find and download a function in R to do the LU decompostion for finding the upper and lower triangular matrix.  Thank you so much. Joe ___________________________________________________ 您的生活即時通 - 溝通、娛樂、生活、工作一次搞定! [[alternative HTML version deleted]]
2008 Mar 19
0
Error en nlm(logdgenexpn, p = c(vmomest[[1]], vmomest[[2]]), x = x.genexp, : valor no finito provisto por 'nlm'
Dear useRs, I am analysing the behaviour of MLE for the two parameters of a kind of exponential distribution, leaving as initial values the estimators moments produced by the variation coefficient. I do using simulations, giving them an accountant, r. But running my codes remains a problem with the nlm function. To review details wearing On one of the lines put status
2010 Jun 15
1
Error in nlm : non-finite value supplied by 'nlm'
Hello, I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]). So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter. My function is the negative loglikelihood derived from a mixing operator. f=function(vector)
2003 Oct 24
1
first value from nlm (non-finite value supplied by nlm)
Dear expeRts, first of all I'd like to thank you for the quick help on my last which() problem. Here is another one I could not tackle: I have data on an absorption measurement which I want to fit with an voigt profile: fn.1 <- function(p){ for (i1 in ilong){ ff <- f[i1] ex[i1] <- exp(S*n*L*voigt(u,v,ff,p[1],p[2],p[3])[[1]]) } sum((t-ex)^2) } out <-
2002 Dec 11
0
nlm() vs. nls()
Dear R-experts! I've been using nls() for a while for fitting my data, approx 10,000 points long. Now, I have to use low-level minimizing functions to get more control on fitting process, so I tried nlm(). And, the fitting process became *much* more slower! The question is: why? why nls() works faster? Thank you very much! Timur.
2005 Jul 07
1
look for help on nlm in R
Hi, I had a hard time in learning nlm in R and appreciate any help. I encounted the following error message from time to time when I tried different starting parameter values (three parameter values in this case) in nlm(f=SS.fun,p=c(0.1/40,0.1,2),hessian = FALSE,N.measure=object,h=20) Error in f(x, ...) : only 0's may mix with negative subscripts Basically I know the three parameter
2004 Jan 16
0
Nlm
Hi I use both R and Splus to fit miximum likelihood models. In general these are Gaussian mixture models of various kinds. The ms (in Splus) and nlm (in R) generally provide us with the same results However nlm is not nearly as stable and reliable with respect to finding the min of a surface. Nlm on the other hand is faster. We have played with the various tol controls but have been unable to
2002 Nov 14
0
nlm / fscale
Dear all, I am using the nlm(base) function for a simple least squares problem. The size (order of magnitude) of the minimized function near the final parameter set is normally about 1e-10. Using the fscale=1e-10 argument in nlm is inefficient (no minimization is performed, iterations=0 or 1). Nlm only works when the minimized function is multiplied by 1e10 (without changing the default
1999 Nov 24
0
nlm gradient and hessian
Out of curiosity, I have tried, without success, to use the new facility in nlm to specify the gradient and hessian. (It is many years since I had a problem simple enough to make analytic derivation of these worthwhile.) The help now says that the function must have attributes with these names but gives no indication as to what should be in the attributes. The online example and demo do not use
2004 Aug 21
0
Convergence code in nlm function
Dear R users, I am using the nlm function for minimization of the very non-linear function of four parameters. I am running 100 simulations and almost always I get the convergence code =2 (Successive iterates within tolerance. Current iterate is probably solution.) [about 75 times of 100]. Frequently, 3 of 4 relative gradients are close to zero and the fourth is huge but there are also cases
2008 Oct 14
0
nlm return wrong function value - garch fitting
I am using nlm to maximize a likelihood function. When I call the likelihood function (garchLLH) via nlm however, nlm returns the wrong value of the function. When I test the likelihood function manually I get the correct answer. I'm probably doing something really stupid, maybe someone can point it out for me. ###############this is the function i am trying to minimize ############
2008 Jun 03
1
nlm behaviour and error
Hi R-Gurus, I've been cutting along quite nicely with nlm, until I threw in the following condition in the function that nlm is minimising: if (((term*bexp) < 0.0001)) { #warning(term*bexp, "=term*bexp",psi,"=psi") theta<-2000 } Now when I run this function anywhere else, there is no problem, whether or the if's condition is met. When
2003 May 28
0
supplying the Hessian to "nlm"
Dear all, I am trying to minimize a function with 3 parameters using nlm. I have worked out the 2nd derivatives (incl the cross-product terms) and would like to supply them to nlm for evaluation. What I am not sure about is how to set up the Hessian matrix for nlm. That is, attr(lhat, "hessian") <- c(???) Do I have to enter all 9 of the entries or just the lower triangle of the
2000 Dec 07
0
Tuning the nlm function
Hi Everyone, Is there a simple way to force nlm to take larger initial steps? Setting print.level = 2 allows me to inspect the step size at each iteration, but I appear not to have made any appreciable impact on it by changing values of typsize, fscale, steptol or stepmax. The steps repeatedly come out tiny, 1e-9 typically, and the algorithm is terminating not because the gradient is zero (it
2006 Jun 19
0
help on nlm (gradient) (fwd)
Hello No worries anymore. Figured it out. Thanks for everything. Luz ---------- Forwarded message ---------- Date: Sun, 18 Jun 2006 23:12:25 -0600 (MDT) From: Luz Maria Palacios Derflingher <palacios at math.ucalgary.ca> To: r-help at lists.R-project.org Cc: r-help at stat.math.ethz.ch. Subject: help on nlm (gradient) Hello. I am having some trouble using nlm in R for windows version
1999 Dec 16
1
nlm in R version 0.90
I am trying to obtain some more detail regarding the nlm function available in the latest release of R. Specifically, what mimimization routine is being used... and ... does there exist a fortran or C version of it? Thank you, Joanna Joanna Elizabeth MILLS, M.Sc. Ph: (902) 494-3747 Dalhousie University Fax: (902) 494-5130 Department of Mathematics and
1999 Nov 24
1
nlm continued
OK I figured it out. The attributes have to be on the value returned, not on the function itself. I tried a linear (not log linear) regression with Poisson, using only the gradient, not the hessian. It took one extra iteration (13 instead of 12) and gave twice as many warnings (28 instead of 16) compared to not supplying the gradient. The answers are identical to 5 decimal places. Sorry to
2000 Feb 07
1
demo(nlm) error under R 0.99.0
I can't seem to get the demo(nlm) to run under R version 0.99.0 Anyone know a solution? > fgh <- function(x) { gr <- function(x1, x2) { c(-400 * x1 * (x2 - x1 * x1) - 2 * (1 - x1), 200 * (x2 - x1 * x1)) } h <- function(x1, x2) { a11 <- 2 - 400 * (x2 - x1 * x1) + 800 * x1 * x1 a21 <- -400 * .... [TRUNCATED] > nlm(fgh,
2016 Apr 15
1
nlm() giving initials as estimates of parameters
Hi R community I have written a loglikelihood function which I am minimizing using nlm(). nlm() is giving me no results...I mean, I am getting initial values as estimates. No iteration. I have tried many initials value close to true values and far away from tru values. But every time I am getting initial values as estimates and no iteration. Anybody can guide why this happens. Thank You
2004 Jan 19
0
cifs-vfs connecting to Netware 6 running cifs.nlm
Hi All, I've got some problems accessing data on a netware server 6.0 running cifs.nlm from a Suse9 linux box. I was origanally trying to access it via smbfs however there were problems with files being truncated when writing and not being read properly. After reading through the archives to this list/newsgroup, I figured I might have better luck with the cifs-vfs module. However it