Displaying 20 results from an estimated 4000 matches similar to: "Checking if a matrix exists/is defined"
2011 Nov 30
1
How can I pick a matrix from a function? (Out Product of Gradient)
Hi all,
I would like to use optim() to estimate the equation by the log-likelihood
function and gradient function which I had written. I try to use OPG(Out
Product of Gradient) to calculate the Hessian matrix since sometime Hessian
matrix is difficult to calculate. Thus I want to pick the Gradient matrix
from the gradient function.
Moreover, could R show the process of calculation on gradient
2001 Apr 09
4
fastest R platform
Hello, everyone! I picked up R several months ago and have adopted it
as my choice for statistical programming. Coming from a Java
background, I can honestly say that R is not only free, it is better
tha S-plus: the lexical scope in R makes it very simple to simulate
Java's object model. For this, I encourage everyone to read the artcle:
Robert Gentleman and Ross Ihaka (2000) "Lexical
2009 Apr 21
4
My surprising experience in trying out REvolution's R
I care a lot about R's speed. So I decided to give REvolution's R
(http://revolution-computing.com/) a try, which bills itself as an
optimized R. Note that I used the free version.
My machine is a Intel core 2 duo under Windows XP professional. The code
I run is in the end of this post.
First, the regular R 1.9. It takes 2 minutes and 6 seconds, CPU usage
50%
Next, REvolution's R.
2003 Jun 02
1
Help with factorized argument in solve.QP
Hi
I'm having problems getting the "factorized" argument in solve.QP (part
of the quadprog library) to work as expected. The helpfile states that
when the factorized argument is set to TRUE, then the function requires
the inverse of a square-root factor of the Hessian instead of the
Hessian itself. That is, when factorized=TRUE, the Dmat argument should
be a matrix R^(-1), such
2008 Dec 27
1
indexed expression
Hello expeRts,
I need generate symbolize the autocovariances matrix of a Gaussian
ARMA(1,1), for derivate it and evaluate.
I try this codes, but whitout sucess
vacv<-NULL
vacv[1]<-1-2*phi*theta-theta^2
vacv[2]<-(1-phi*theta)*(phi-theta)
vacv[3:n]<-acv[2]*(phi^(1:(n-2)))
facv<-list()
for(i in 1:2)
2011 Oct 27
2
help with parallel processing code
Hello R gurus,
I have the code below for which i need help and pointers to make it run in
parallel on a dual core win7 computer with R 2.13.x, using foreach,
iterators,doMC.
library(scatterplot3d) # Loads 3D library.
library(fields)
library(MASS)
library(ROCR)
library(verification)
library(caret)
library(gregmisc)
##simulated data
d=replicate(9, rnorm(40)+10)
2005 May 03
1
maximization help :
Given a vector : pvec=(p1,p2,.... p J) with sum(pvec)=1, all the
elements are non-negative, that is, they are probabilities
a matrix A ( N* J ), with the elements alpha(ij) are 0 or 1
I want to MAXIMIZE THE RESULT
RESULT= product( i=1, to N [ sum ( alpha(ij)* pj , j =1,to J
) ] )
thus, I need to get pvec. how should I do ?
for example
2010 May 10
2
Robust SE & Heteroskedasticity-consistent estimation
Hi,
I'm using maxlik with functions specified (L, his gradient & hessian).
Now I would like determine some robust standard errors of my estimators.
So I 'm try to use vcovHC, or hccm or robcov for example
but in use one of them with my result of maxlik, I've a the following
error message :
Erreur dans terms.default(object) : no terms component
Is there some attributes
2007 Mar 20
2
Problems about Derivaties
Dear participants to the list,
this is my problem: I want to obtain an expression that represents the second
derivative of one function.
With "deriv3" (package "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:
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.
As a simple example (my problem is more complex though,
2017 Jun 08
1
Matrix multiplication
OK Thanks. Your response made me think. Here (the last line) is what I need:
set.seed(76543211)
w<-1:10; w
a<-matrix(rpois(20,2),nrow=10); a
t(w*a)%*%a
On 6/8/2017 12:09 PM, Jeff Newmiller wrote:
> Is this a question? You seem to have three possible calculations, have already implemented two of them (?) and it is unclear (to me) what you think the right answer for any of them is
2005 Dec 04
1
Understanding nonlinear optimization and Rosenbrock's banana valley function?
GENERAL REFERENCE ON NONLINEAR OPTIMIZATION?
What are your favorite references on nonlinear optimization? I like
Bates and Watts (1988) Nonlinear Regression Analysis and Its
Applications (Wiley), especially for its key insights regarding
parameter effects vs. intrinsic curvature. Before I spent time and
money on several of the refences cited on the help pages for "optim",
2010 Nov 17
1
Please, help me with 'mattern' variogram
Hi, R-folks:
I have been tryin 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]
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
2017 Feb 10
1
Ancient C /Fortran code linpack error
> On 10 Feb 2017, at 14:53, G?ran Brostr?m <goran.brostrom at umu.se> wrote:
>
> Thanks to all who answered my third question. I learned something, but:
>
> On 2017-02-09 17:44, Martin Maechler wrote:
>>
>>>> On 9 Feb 2017, at 16:00, G?ran Brostr?m <goran.brostrom at umu.se> wrote:
>>>>
>>>> In my package 'glmmML'
2017 Feb 09
3
Ancient C /Fortran code linpack error
> > 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){
> >
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
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
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?
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