similar to: help on nlm (gradient) (fwd)

Displaying 20 results from an estimated 2000 matches similar to: "help on nlm (gradient) (fwd)"

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
2003 Nov 17
0
gradient option in 'nlm' function
<FONT face="Default Sans Serif, Verdana, Arial, Helvetica, sans-serif" size=2><DIV>Dear list members,</DIV><DIV>&nbsp;</DIV><DIV>I am trying to use "nlm" function to maximize a mixture likelihood of beta densities. There are five unknown parameters in the likelihood. Since I can get the analytic gradient, I attach the "gradient"
2006 Sep 30
1
Gradient problem in nlm
Hello everyone! I am having some trouble supplying the gradient function to nlm in R for windows version 2.2.1. What follows are the R-code I use: fredcs39<-function(a1,b1,b2,x){return(a1+exp(b1+b2*x))} loglikcs39<-function(theta,len){ value<-sum(mcs39[1:len]*fredcs39(theta[1],theta[2],theta[3],c(8:(7+len))) - pcs39[1:len] * log(fredcs39(theta[1],theta[2],theta[3],c(8:(7+len)))))
2007 Mar 28
1
warnings on adapt
Hi all I was wondering if someone could help me. I have to estimate some parameters, so I am using the function nlm. Inside this function I have to integrate, hence I am using the function adapt. I don't understand why it is giving the following warnings: At the beginning: Warning: a final empty element has been omitted the part of the args list of 'c' being evaluated was:
1997 Nov 21
2
R-alpha: nlm and gradients
At present the documentation for nlm refers the reader to Dennis and Schnabel for details on the algorithms. It also states that the function is liable to change. Can anyone tell me if the current version of nlm uses only function values or if it can use gradients and Hessians when they are available? I would like to get an idea of how difficult it would be to port the development versions of
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
1999 Sep 29
1
nlm recursion problem
Hi I am trying to use nlm with an additional call to nlm within the function but after the first pass, the parameters to the outer call are being passed to the inner call. The inner call is a very trivial problem. ie: test.outer<-function(param.outer){ slope<-nlm(test.inner,param.inner) ... loglikelihood<-sum(...) return(-loglikelihood) } and nlm(test.outer,param.outer) on the
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 <-
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 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 ############
2012 Oct 19
2
likelihood function involving integration, error in nlm
Dear R users, I am trying to find the mle that involves integration. I am using the following code and get an error when I use the nlm function d<-matrix(c(1,1,0,0,0,0,0,0,2,1,0,0,1,1,0,1,2,2,1,0),nrow=10,ncol=2) h<-matrix(runif(20,0,1),10) integ<-matrix(c(0),nrow=10, ncol=2) ll<-function(p){ for (k in 1:2){ for(s in 1:10){ integrand<-function(x)
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)
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
1997 Jun 06
1
R-beta: nlm
I am trying to use the function "nlm" to find the mle. I want to use a generic function for the likelihood which would require me to use both the parameters and the data as arguments. But nlm requires the function to have only the parameters as arguments for this function (see example below). > testfun <- function(x,y) sum((x-y)^2) # x - parameters, y - data >
2011 Aug 24
1
problema de selección de valores iniciales en nlm
Hola a todos, Necesito estimar dos parametros utilizando la función nlm; fit<-nlm(hood2par,c(x01[i],x02[j]),iterlim=300, catch=x[,c(3,4,5)],sp=.5) donde hood2par es una logística modificada. Pero en mi caso, la convergencia de nlm depende de los valores iniciales de dichos parámetros. Para buscar dichos valores iniciales de manera automática, genero dos vectores de valores iniciales
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)))
2003 Sep 01
3
error message in nlm()
Hi all, I have been trying the nlm function but received an error message which reads: Error in nlm(intensities ~ f, c(epsilon.spec.start, epsilon.unspec.start, : invalid function value in 'nlm' optimizer The message is generated somewhere in the compiled part, apparently within the function static void fcn(int n, const double x[], double *f, function_info *state) where a jump
2004 Oct 11
1
Puzzled on nlm
Dear R People: Here is a function to minimized: >mfun1 function(x,a) { x[1] <- a[1]*x[2] + a[3] - a[2]*(a[1]-a[2])*a[3] x[2] <- a[1]*x[1] - a[2]*a[3] return(x) } Here is my first try: >nlm(mfun1,c(1,1)) Error in f(x, ...) : Argument "a" is missing, with no default > >nlm(mfun1,c(1,1),a=c(0.8,0.5,1)) Error in nlm(mfun1, c(1, 1), a = c(0.8, 0.5, 1)) :
2009 Feb 19
2
Source code for nlm()
Hi, Where can I find the source code for nlm()? I dowloaded the R2.8.1.tar.gz file and looked at all the .c and .f files, but couldn't find either nlm.c or nlm.f There is an nlm.r file, but that is not useful. Thanks for any help, Ravi. ---------------------------------------------------------------------------- ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging
2008 Oct 30
0
a nlm() question
Dear R listers, I have a very annoying problem using nlm(). I want to find the minimizer of my target function, if written in \LaTeX is f(\mu1,\mu2,\sigma1,\sigma2) = \sum_i^n( w_ig_t(z_i) ), where g_t(z) is a pdf of bivariate normal distribution and z_i is my samples. I cannot get the estimation result generated by nlm(), and I got the following errors " Error in