Displaying 20 results from an estimated 2000 matches similar to: "NaN as a parameter in NLMINB optimization"
2009 May 06
2
NLMINB() produces NaN!
I am having the same problem as one Rebecca Sela(see bellow).
On 21/12/2007 12:07 AM, Rebecca Sela wrote:
>* I am trying to optimize a likelihood function using NLMINB. After running without a problem for quite a few iterations (enough that my intermediate output extends further than I can scroll back), it tries a vector of parameter values NaN. This has happened with multiple Monte Carlo
2009 Jun 25
2
Problems with subsets in NLME
I am trying to estimate models with subsets using the NLME package. However, I am getting an error in the case below (among others):
> subset <- c(rep(TRUE, 107), FALSE)
> fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1, subset=subset)
Error in xj[i] : invalid subscript type 'closure'
> fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1,
2007 Oct 01
4
Disentagling formulas
I am writing a program in which I would like to take in a formula, change the response (Y) variable into something else, and then pass the formula, with the new Y variable to another function. That is, I am starting with
formula <- Y~X1+X2+X3
and I'd like to do something like
Y <- formula$Y
newY <- f(Y)
lm(newY~X1+X2+X3)
So far, it seems that my
2008 Jun 14
1
"False convergence" in LME
I tried to use LME (on a fairly large dataset, so I am not including it), and I got this error message:
Error in lme.formula(formula(paste(c(toString(TargetName), "as.factor(nodeInd)"), :
nlminb problem, convergence error code = 1
message = false convergence (8)
Is there any way to get more information or to get the potentially wrong estimates from LME?
(Also, the page in the
2009 Jul 08
2
\dQuote in packages
I am in the process of submitting a package to CRAN. R CMD check ran successfully on the package on my local computer, using R version 2.1.1. However, on the computers for CRAN (with version 2.10.0), the following errors occurred:
Warning in parse_Rd("./man/predict.Rd", encoding = "unknown") :
./man/predict.Rd:28: unknown macro '\dquote'
*** error on file
2009 May 13
3
Checking a (new) package - examples require other package functions
I am creating an R package. I ran R CMD check on the package, and everything passed until it tried to run the examples. Then, the result was:
* checking examples ... ERROR
Running examples in REEMtree-Ex.R failed.
The error most likely occurred in:
> ### * AutoCorrelationLRtest
>
> flush(stderr()); flush(stdout())
>
> ### Name: AutoCorrelationLRtest
> ### Title: Test for
2008 Jun 07
2
Predicting a single observatio using LME
When I use a model fit with LME, I get an error if I try to use "predict" with a dataset consisting of a single line.
For example, using this data:
> simpledata
Y t D ID
1 -1.464740870 1 0 1
2 1.222911373 2 0 1
3 -0.605996798 3 0 1
4 0.155692707 4 0 1
5 3.849619772 1 0 2
6 4.289213902 2 0 2
7 2.369407737 3 0 2
8 2.249052533 4 0 2
9 0.920044316 1
2008 Jan 29
0
NLMINB convergence codes
According to the R documentation for NLMINB, the returned value of convergence is 0 for successful convergence. When I got another code (1), I looked up the PDF that linked from the documentation (http://netlib.bell-labs.com/cm/cs/cstr/153.pdf), which said that a return code under 3 was impossible.
Is there other documentation that gives the correct meanings of the NLMINB convergence codes in
2012 Jul 04
2
About nlminb function
Hello
I want to use the nlminb function but I have the objective function like
characters. I can summarize the problem using the first example in the
nlminb documentation.
x <- rnbinom(100, mu = 10, size = 10)
hdev <- function(par) -sum(dnbinom(x, mu = par[1], size = par[2], log =
TRUE))
nlminb(c(9, 12), objective=hdev)
With the last instructions we obtain appropriate results. If I have
2012 Sep 26
2
non-differentiable evaluation points in nlminb(), follow-up of PR#15052
This is a follow-up question for PR#15052
<http://bugs.r-project.org/bugzilla3/show_bug.cgi?id=15052>
There is another thing I would like to discuss wrt how nlminb() should
proceed with NAs. The question is: What would be a successful way to
deal with an evaluation point of the objective function where the
gradient and the hessian are not well defined?
If the gradient and the hessian both
2008 Dec 03
1
nlminb: names of parameter vector not passed to objective function
Dear R developers,
I tried to use nlminb instead of optim for a current problem (fitting
parameters of a differential equation model). The PORT algorithm
converged much better than any of optim's methods and the identified
parameters are plausible. However, it took me a while before spotting
the reason of a technical problem that nlminb, in contrast to optim,
does not pass names of the
2012 Oct 10
1
"optim" and "nlminb"
#optim package
estimate<-optim(init.par,Linn,hessian=TRUE, method=c("L-BFGS-B"),control =
list(trace=1,abstol=0.001),lower=c(0,0,0,0,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf,-Inf),upper=c(1,1,1,1,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf))
#nlminb package
estimate<-nlminb(init.par,Linn,gr=NULL,hessian=TRUE,control =
2006 Jul 23
1
How to pass eval.max from lme() to nlminb?
Dear R community,
I'm fitting a complex mixed-effects model that requires numerous
iterations and function evaluations. I note that nlminb accepts a
list of control parameters, including eval.max. Is there a way to
change the default eval.max value for nlminb when it is being called
from lme?
Thanks for any thoughts,
Andrew
--
Andrew Robinson
Department of Mathematics and Statistics
2010 Dec 07
1
Using nlminb for maximum likelihood estimation
I'm trying to estimate the parameters for GARCH(1,1) process.
Here's my code:
loglikelihood <-function(theta) {
h=((r[1]-theta[1])^2)
p=0
for (t in 2:length(r)) {
h=c(h,theta[2]+theta[3]*((r[t-1]-theta[1])^2)+theta[4]*h[t-1])
p=c(p,dnorm(r[t],theta[1],sqrt(h[t]),log=TRUE))
}
-sum(p)
}
Then I use nlminb to minimize the function loglikelihood:
nlminb(
2011 Jan 21
3
nlminb doesn't converge and produce a warning
Hi Everybody,
My problem is that nlminb doesn't converge, in minimising a logLikelihood
function, with 31*6 parameters(2 weibull parameters+29 regressors repeated 6
times).
I use nlminb like this :
res1<-nlminb(vect, V, lower=c(rep(0.01, 12), rep(0.01, 3), rep(-Inf, n-15)),
upper=c(rep(Inf, 12), rep(0.99, 3), rep(Inf, n-15)), control =
list(maxit=1000) )
and that's the result :
2011 Aug 16
2
Calibrating the risk free interest rate using nlminb
Dear R-users
I am trying to find a value for the risk free rate minimizing the difference
between a BS call value with impl. volatilities minus the market price of a
call (assuming this is just the average bid ask price)
Here is my data:
http://r.789695.n4.nabble.com/file/n3747509/S%26P_500_calls%2C_jan-jun_2010.csv
S%26P_500_calls%2C_jan-jun_2010.csv
S0 <- 1136.03
q <- 0.02145608
S0
2010 Jul 10
1
Not nice behaviour of nlminb (windows 32 bit, version, 2.11.1)
I won't add to the quite long discussion about the vagaries of nlminb, but will note that
over a long period of software work in this optimization area I've found a number of
programs and packages that do strange things when the objective is a function of a single
parameter. Some methods quite explicitly throw an error when n<2. It seems nlminb does
not, but that does not mean that
2006 Apr 20
2
nlminb( ) : one compartment open PK model
All,
I have been able to successfully use the optim( ) function with
"L-BFGS-B" to find reasonable parameters for a one-compartment
open pharmacokinetic model. My loss function in this case was
squared error, and I made no assumptions about the distribution
of the plasma values. The model appeared to fit pretty well.
Out of curiosity, I decided to try to use nlminb( ) applied to
a
2010 Mar 24
1
vcov.nlminb
Hello all,
I am trying to get the variance-covariance (VCOV) matrix of the
parameter estimates produced from the nlminb minimizing function, using
vcov.nlminb, but it seems to have been expunged from the MASS library.
The hessian from nlminb is also producing NaNs, although the estimates
seems to be right, so I can't VCOV that way either. I also tried using
the vcov function after minimizing
2012 Nov 22
1
Optimizing nested function with nlminb()
I am trying to optimize custom likelyhood with nlminb()
Arguments h and f are meant to be fixed.
example.R:
compute.hyper.log.likelyhood <- function(a, h, f) {
a1 <- a[1]
a2 <- a[2]
l <- 0.0
for (j in 1:length(f)) {
l <- l + lbeta(a1 + f[j], a2 + h - f[j]) - lbeta(a1, a2)
}
return(l)
}
compute.optimal.hyper.params <- function(start, limits, h_, f_) {
result