Displaying 20 results from an estimated 1200 matches similar to: "Optim function & Hessian matrix"
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?
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 related
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 this is a numerically
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
2008 May 12
1
hessian in constrained optimization (constrOptim)
Dear helpers,
I am using the function "constrOptim" to estimate a model with ML with an
inequality constraint using the option method='Nelder-Mead'.
When I specify the option: hessian = TRUE I obtain the response:
Error in f(theta, ...) : unused argument(s) (hessian = TRUE)
I guess the function "constrOptim" does not allow this argument which, on
the other hand, is
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
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
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
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
2006 Nov 01
2
Hessian matrix
Dear all R users,
Is there any way to calculate hessian matrix of a given function at any
given point?
Regards
[[alternative HTML version deleted]]
2007 Oct 04
1
hessian matrix in arima
Hi,
I am working or arima.
I think arima uses non-linear optimisation for parameter optimisation. The
standard error for parameters are computed from hessian matrix. When I use
arima model, how can I see the finial hessian got from non-linear
optimisation (BFGS for example).
Any help is appreciated.
Many thanks.
Di
[[alternative HTML version deleted]]
2004 Apr 02
0
Hessian in constrOptim
Dear R-users,
In the function constrOptim there is an option to get an approximation
to the hessian of the surrogate function R at MLE by declaring
hessian=TRUE in the calls to the function optim. I would like to ask
if it is advisable to get an approximate hessian for the funcrion f as
follows:
f''(theta)=R''(theta|theta_k)-B''(theta)
where
2007 May 29
1
Estimate Fisher Information by Hessian from OPTIM
Dear All,
I am trying to find MLE by using "OPTIM" function.
Difficult in differentiating some parameter in my objective function, I
would like to use the returned hessian matrix to yield an estimate of
Fisher's Information matrix.
My question: Since the hessian is calculated by numerical differentiate, is
it a reliable estimate? Otherwise I would have to do a lot of work to
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",
2011 Jul 11
0
Zero Columns/Rows in Hessian Matrix
Hello R users,
I am trying to get the Std. errors of some estimators using the optim
function. But when computing them using sqrt(diag(solve(ans$hessian))) I
get an error that says... Lapack routine dgesv: system is exactly singular.
Or sometimes I also get that system is computationally singular. When I
check the Hessian matrix it has at least one column&row of mostly zeros. My
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:
2007 Feb 16
1
optim() and resultant hessian
R users;
A question about optimization within R.
I've been using both optim() and nlminb() to estimate parameters and all
seems to be working fine. For context (but without getting into specifics -
sorry), I'm working with a problem that is known to have correlated
parameters, and parameter estimation can be difficult. I have a question on
optim() - I'm using
2009 Nov 02
1
need help in using Hessian matrix
Hi
I need to find the Hessian matrix for a complicated function from a certain
kind of data but i keep getting this error
Error in f1 - f2 : non-numeric argument to binary operator
the data is given by
U<-runif(n)
Us<-sort(U)
tau1<- 2
F1tau<- pgamma((tau1/theta1),shape,1)
N1<-sum(Us<F1tau)
X1<- Us[1:N1]
2011 Dec 29
0
problem of "constrOptim.nl", no hessian and convergence values
Dear Helper,
I used "constrOptim.nl" and got the value of par. The estimations looks good
even if the number of iterations is only 16. But the values of hessian and
convergence are both "NULL".
I tested the objective function and gradient function by "optim" and didn't
see any problem there. With these functions, "optim" gives the convergence
value