Displaying 20 results from an estimated 3000 matches similar to: "unexpected behavior of <<- in nlm (lazy?)"
2009 Jun 29
0
new version of package deSolve on CRAN
Dear R users,
an improved version of package deSolve (version 1.3) is now available on
CRAN. deSolve, the successor of R package odesolve, is a package to
solve initial value problems (IVP) of:
- ordinary differential equations (ODE),
- differential algebraic equations (DAE) and
- partial differential equations (PDE).
The implementation includes stiff integration routines based on the
ODEPACK
2009 Jun 29
0
new version of package deSolve on CRAN
Dear R users,
an improved version of package deSolve (version 1.3) is now available on
CRAN. deSolve, the successor of R package odesolve, is a package to
solve initial value problems (IVP) of:
- ordinary differential equations (ODE),
- differential algebraic equations (DAE) and
- partial differential equations (PDE).
The implementation includes stiff integration routines based on the
ODEPACK
2017 Jun 21
0
customizing color key with plot3D
Karline,
Thank you for your help. I discovered that in addition to including clim, I needed to omit breaks. This code uses one of your other examples as a starting point and works as intended:
persp3D(z = volcano, zlim = c(-60, 200), phi = 20,
colkey = list(length = 0.2, width = 0.4, shift = 0.15,
cex.axis = 0.8, cex.clab = 0.85), lighting = TRUE, lphi = 90,
clab =
2005 Nov 14
1
(no subject)
Hi,
I am trying to solve a model that consists of rather stiff ODEs in R.
I use the package ODEsolve (lsoda) to solve these ODEs.
To speed up the integration, the jacobian is also specified.
Basically, the model is a one-dimensional advection-diffusion problem,
and thus the jacobian is a tridiagonal matrix.
The size of this jacobian is 100*100.
In the original package
2004 Feb 19
1
Obtaining SE from the hessian matrix
Dear R experts,
In R-intro, under the 'Nonlinear least squares and maximum likelihood
models' there are ttwo examples considered how to use 'nlm' function.
In 'Least squares' the Standard Errors obtained as follows:
After the fitting, out$minimum is the SSE, and out$estimates are the
least squares estimates of the parameters. To obtain the approximate
standard
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 <-
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
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
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
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 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 ############
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> </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"
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)
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
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