Re: 'inv' command works and 'det' returns inf for the same matrix
- From: "Arvind Iyer" <aiyer@xxxxxxxxxxx>
- Date: Thu, 16 Oct 2008 16:54:01 +0000 (UTC)
In my current application, the matrix is a covariance matrix appearing in the log likelihood function of a Gaussian process regression(GPR) model (the objective function of an optimization problem).
The expression requires me to have values of both the determinant and the inverse of the covariance matrix.
With my matrix, I can get the inverse but not the determinant (which is returned as inf)...and hence am not able to evaluate my objective function.
What is the way out to get a value of the determinant for such an application? Will some svd-based formulation help?
"Steven Lord" <slord@xxxxxxxxxxxxx> wrote in message <gd7qti$ocs$1@xxxxxxxxxxxxxxxxxx>...
"Arvind Iyer" <aiyer@xxxxxxxxxxx> wrote in message
news:gd7pk1$72a$1@xxxxxxxxxxxxxxxxxxxxx
For a 274x274 matrix, I get an inverse with finite elements when I use the
'inv' command.
However when I use the 'det' command with the same matrix, MATLAB returns
a value of inf.
What does such an output mean?
Nothing, really.
A = 2*eye(1025);
det(A)
cond(A)
A is very well conditioned, but the determinant is Inf.
n = 1e6; A = [n n;n n+1e-6];
det(A)
cond(A)
The determinant of A is a little over 1, but the matrix is very poorly
conditioned.
Is 'det' the best way to calculate matrix determinants in MATLAB? What are
other fool-proof ways using linear-algebra tricks?
What's your application? Why are you trying to compute the determinant?
There may be a way to accomplish your goal without actually computing the
determinant or using INV to compute the inverse.
--
Steve Lord
slord@xxxxxxxxxxxxx
.
- References:
- 'inv' command works and 'det' returns inf for the same matrix
- From: Arvind Iyer
- Re: 'inv' command works and 'det' returns inf for the same matrix
- From: Steven Lord
- 'inv' command works and 'det' returns inf for the same matrix
- Prev by Date: Re: Find the minimum
- Next by Date: Re: Find the minimum
- Previous by thread: Re: 'inv' command works and 'det' returns inf for the same matrix
- Next by thread: Find the minimum
- Index(es):
Relevant Pages
|