search for: hessian

Displaying 20 results from an estimated 549 matches for "hessian".

2007 Mar 20
2
Problems about Derivaties
...t;stats") it is possible to evaluate the second derivative, but I do not know how I can get the (analytical) expression of this derivative. For example: Suppose that I have a function of this form: f(x,y)=x^3+y^3+(x^2)*(y^2). With "deriv3" I can evaluate the first derivative and the hessian matrix, as follows: > d<-deriv3(~x^3+y^3+(x^2)*(y^2),c("x","y")) > d[[1]] { .expr4 <- x^2 .expr5 <- y^2 .expr9 <- 2 * x .expr15 <- 2 * y .value <- x^3 + y^3 + .expr4 * .expr5 .grad <- array(0, c(length(.value), 2), list(NULL, c("x", "y&...
2011 Sep 02
5
Hessian Matrix Issue
Dear All, I am running a simulation to obtain coverage probability of Wald type confidence intervals for my parameter d in a function of two parameters (mu,d). I am optimizing it using "optim" method "L-BFGS-B" to obtain MLE. As, I want to invert the Hessian matrix to get Standard errors of the two parameter estimates. However, my Hessian matrix at times becomes non-invertible that is it is no more positive definite and I get the following error msg: "Error in solve.default(ac$hessian) : system is computationally singular: reciprocal condition nu...
2012 Nov 15
1
hessian fails for box-constrained problems when close to boundary?
Hi I am trying to recover the hessian of a problem optimised with box-constraints. The problem is that in some cases, my estimates are very close to the boundary, which will make optim(..., hessian=TRUE) or optimHessian() fail, as they do not follow the box-constraints, and hence estimate the function in the unfeasible parameter space....
2009 Apr 29
2
Optim and hessian
Hi, my name is Marcel R. Lopes. My problem is, I made a code to calculate the estimates of a Cox model with random effects. Used to optimize the R command for this. The estimates were calculated correctly, but the Hessian matrix does not have good values. The same thing was done in SAS and gave good results for the Hessian Matrix. Where is the problem in R? As the Hessian is calculated?. How could I solve this problem?. I would be grateful if you could help me .... [[alternative HTML version deleted]]
2003 Feb 10
1
Zero rows/cols in the hessian matrix
Dear R experts! I try to minimize a function with external C fitting function. I get the hessian matrix. Here it is: [,1] [,2] [,3] [,4] [1,] 1.8816631 0 0.8859803 0 [2,] 0.0000000 0 0.0000000 0 [3,] 0.8859803 0 0.4859983 0 [4,] 0.0000000 0 0.0000000 0 Second and fourth rows/columns have zero values only. That's OK, because that ones relat...
2017 Feb 09
3
Ancient C /Fortran code linpack error
In my package 'glmmML' I'm using old C code and linpack in the optimizing procedure. Specifically, one part of the code looks like this: F77_CALL(dpoco)(*hessian, &bdim, &bdim, &rcond, work, info); if (*info == 0){ F77_CALL(dpodi)(*hessian, &bdim, &bdim, det, &job); ........ This usually works OK, but with an ill-conditioned data set (from a user of glmmML) it happened that the hessian was all nan. However, d...
2006 Mar 21
1
Hessian from optim()
Hello! Looking on how people use optim to get MLE I also noticed that one can use returned Hessian to get corresponding standard errors i.e. something like result <- optim(<< snip >>, hessian=T) result$par # point estimates vc <- solve(result$hessian) # var-cov matrix se <- sqrt(diag(vc)) # standard errors What is actually Hessian representing here?...
2012 Jul 25
3
zeroinfl problem: cannot get standard errors, hessian has NaN
Hi! I have three models. In the first model, everything is fine. However, in the second and third models, I have NA's for standard errors: The hessians also have NaN's (same for m2 and m3). What should I do about it? It there a way to obtain the hessian without transforming my variables? I will greatly appreciate your help! -- View this message in context: http://r.789695.n4.nabble.com/zeroinfl-problem-cannot-get-standard-errors-hessia...
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", s...
2008 Jun 24
1
Hessian in box-constraint problem - concern OPTIM function
Hello all useRs, I am using the OPTIM function with particular interest in the method L-BFGS-B, because it is a box-constraint method. I have interest in the errors estimates too. I make: s.e. <- sqrt( diag( solve( optim(...,method='L-BFGS-B', hessian=TRUE)$hessian ))) but in help say: "Note that this is the Hessian of the unconstrained problem even if the box constraints are active." My doubts is: How to obtain a authentic hessian for a box-constraint problem? How I should make a interpretation of this result (concern the hessia...
2003 Oct 17
2
nlm, hessian, and derivatives in obj function?
I've been working on a new package and I have a few questions regarding the behaviour of the nlm function. I've been (for better or worse) using the nlm function to fit a linear model without suppling the hessian or gradient attributes in the objective function. I'm curious as to why the nlm requires 31 iterations (for the linear model), and then it doesn't work when I try to add the derivative information. I know using nlm for a linear model isn't the "optimal" method, but I would lik...
2008 Sep 12
1
Error in solve.default(Hessian) : system is computationally singular
Hello everyone, I'm trying to estimate the parameters of the returns series attached using the GARCH code below, but I get the following error message: Error in solve.default(Hessian) : system is computationally singular: reciprocal condition number = 0 Error in diag(solve(Hessian)) : error in evaluating the argument 'x' in selecting a method for function 'diag' Can anyone help me with this? I don't understand what the problem is. Many thanks, Desisl...
2001 Apr 09
4
fastest R platform
...%*% x) } ####################################################################### REML.b.D.u <- function(b, D.u, y, x, z) { TT <- matrix(0, n.random, n.random); for(i in 1:30) { obj <- sample.u(b, D.u, x, y, z); b <- b - solve(obj$Hessian, obj$score); D.u <- obj$uu; yy <- glmm.sample.y(x, z, b, D.u); #this is the sampling stage obj <- mle.b(b, D.u, yy, x, z); #given D.u, solves for the mle of b TT <- TT*(1-1/i) + obj$uu.diff/i; D.u <- D.u + T...
2017 Feb 09
3
Ancient C /Fortran code linpack error
...gt; > On 9 Feb 2017, at 16:00, G?ran Brostr?m <goran.brostrom at umu.se> wrote: > > > > In my package 'glmmML' I'm using old C code and linpack in the optimizing procedure. Specifically, one part of the code looks like this: > > > > F77_CALL(dpoco)(*hessian, &bdim, &bdim, &rcond, work, info); > > if (*info == 0){ > > F77_CALL(dpodi)(*hessian, &bdim, &bdim, det, &job); > > ........ > > > > This usually works OK, but with an ill-conditioned data set (from a user of glmmML) it happen...
2019 Feb 19
1
mle (stat4) crashing due to singular Hessian in covariance matrix calculation
Hi, R developers. when running mle inside a loop I found a nasty behavior. From time to time, my model had a degenerate minimum and the loop just crashed. I tracked it down to "vcov <- if (length(coef)) solve(oout$hessian)" line, being the hessian singular. Note that the minimum reached was good, it just did not make sense to calculate the covariance matrix as the inverse of a singular Hessian. In my case i am just interested on the value of the log-likelihood. For my application, I patched it easily in a l...
2006 Feb 01
1
output hessian matrix in constrOptim
Hi, Is there any way to get the hessian matrix from the "constrOptim" function without supplying gradient function? Thanks. --------------------------------- Bring words and photos together (easily) with [[alternative HTML version deleted]]
2009 Feb 08
1
Hessian?
I am new to 'R' and also new to the concept of a 'Hessian' with non-linear optimization. I would like to avoid going through all of the reference articles given with ?optim as access to a library is not handy. Would someone be able to elighten me on what is in the Hessian matrix if 'hessian = TRUE' with optim? The documentation indicates that...
2005 Dec 04
1
Understanding nonlinear optimization and Rosenbrock's banana valley function?
...a parabola in x[2] with a unique minimum at x[2]=x[1]=1. Over the range (-1, 2)x(-1,1), it looks like a long, curved, deep, narrow banana-shaped valley. It is a known hard problem in nonlinear regression, but these difficulties don't affect "nlm" or "nlminb" until the hessian is provided analytically (with R 2.2.0 under Windows XP): nlm(banana, c(-1.2, 1)) # found the minimum in 23 iterations nlminb(c(-1.2, 1), banana)# found the min in 35 iterations Dbanana <- function(x){ c(-400*x[1]*(x[2] - x[1]^2) - 2*(1-x[1]), 200*(x[2] - x[1]^2)) } banana1 <- func...
2010 Nov 17
1
Please, help me with 'mattern' variogram
...in many combination of parameter to make Matern variogram to work, but I can't find the available one. I'm near to be crazy. I tiped: A?o2003Selg.lf<-likfit(A?o2003Selg,cov.model="matern",ini.cov.pars=c(1.5,14),kappa=2.5,fix.kappa=FALSE,nugget=0.08,lambda=0.008,fix.lambda=FALSE,hessian=TRUE) the hessian shows: $hessian [,1] [,2] [,3] [,4] [1,] 9.139986 -8.562736e+00 41.648355 -3.801615 [2,] -8.562736 3.351952e+159 -147.279881 -7.083089 [3,] 41.648355 -1.472799e+02 347.493191 -7.509035 [4,] -3.801615 -7.083089e+00 -7.509035 90.681917...
2017 Feb 10
1
Ancient C /Fortran code linpack error
...16:00, G?ran Brostr?m <goran.brostrom at umu.se> wrote: >>>> >>>> In my package 'glmmML' I'm using old C code and linpack in the optimizing procedure. Specifically, one part of the code looks like this: >>>> >>>> F77_CALL(dpoco)(*hessian, &bdim, &bdim, &rcond, work, info); >>>> if (*info == 0){ >>>> F77_CALL(dpodi)(*hessian, &bdim, &bdim, det, &job); >>>> ........ >>>> >>>> This usually works OK, but with an ill-conditioned data set (...