please dont redirect as I dont read it
regularly Im
trying to solve a least-squares problem:
> min{(Ax+b)(Ax+b)} (1)
> whose explicit solution is:
> x = (A*A)^-1 * A * b (2)
> Matrix A has form, e.g.:
> 1 0 0 0 1
> -1 1 0 1 0
> 0 -1 1 -1 0
> 0 0 -1 0 -1
> i.e. it has exactly one pair of (1,-1) in each column.
There wont be
> any all-zero rows. As you can see, it may contain two or
more linearly
> dependent columns (two equal, two mutually negative, or
other
combination).
> Further, due to nature of the problem (Id skip the
physical background
> for now, I can repost if someones interested) condition
is
that
> size(x) >= size(b)-1
> The problem is that equation (2) has explicit solution
(A*A has
> inversion) only if
> size(x) = size(b)-1 = rank(A)
> However, I have to solve the problem in general manner,
i.e. I want
> to obtain one of optimal solutions. Rank deficiency of A
should be
> preferredly solved by minimizing square sum of x, i.e.
min{|x^2|},
> i.e. the task is to find such x that a) minimizes (1) and b)
has
> minimal sum(x*x).
> I plan to use Matlab as proving environment and
Fortran/Lapack for
> deployment (links to Fortran sources which solve that exact
problem are
> also welcome). I probably have to find QR decomposition of
AA (GEQRF),
> but Im lost at the moment what to do after that. I admit
my linear
> algebra is a little rusty...
> Theres an interesting example under
Matlabs help on QR
function,
> but its not directly applicable -- in my case,
(AA) is
(can be)
> singular.
> All suggestions/solutions are welcome. I suspect this is a
well-known
> --
> Jugoslav
> ___________
> www.geocities.com/jdujic
===
Subject: Re: A Least Squares Problem
|| Im trying to solve a least-squares problem:
||
|| min{(Ax+b)(Ax+b)} (1)
||
|| whose explicit solution is:
||
|| x = (A*A)^-1 * A * b (2)
||
|| The problem is that equation (2) has explicit solution
(A*A has
|| inversion) only if
|| size(x) = size(b)-1 = rank(A)
||
|| However, I have to solve the problem in general manner,
| An nxp matrix A can be factored into a product of 3 other
matrices :
| A=U*L*Vt (where t==transpose) where n for n data and p for
p parameters,
| using singular value decomposition SVD. U and V are data
and parameter
space
| eigenvectors and L a diagonal matrix containing at most r
non-zero
| eigenvalues of G with r<=p. So if
| x = (A*A)^-1 * A * b
| At*A=V*L^2*Ut*U*L*Vt=V*L^2*Vt ,since Ut*U=I
| and (At*A)^-1=V*L^-1*Ut and finally, since Vt*V=I
| The least square solution is given by
| x=V*L^-1*Ut*b
...
| SVD is the best way to decompose a matrix since it provides
extra
infomation
| about the resolution of the reconstruction (resolution
matrices etc...)
if r
|
| Im trying to solve a least-squares problem:
|
| min{(Ax+b)(Ax+b)} (1)
|
| whose explicit solution is:
|
| x = (A*A)^-1 * A * b (2)
| The problem is that equation (2) has explicit solution
(A*A has
| inversion) only if
| size(x) = size(b)-1 = rank(A)
|
| However, I have to solve the problem in general manner,
i.e. I want
| to obtain one of optimal solutions. Rank deficiency of A
should be
| preferredly solved by minimizing square sum of x, i.e.
min{|x^2|},
| i.e. the task is to find such x that a) minimizes (1) and b)
has
| minimal sum(x*x).
I appear to have found a practical solution. First, sorry,
equation (2)
should have read:
x = A * (A*A)^-1 * b
however, I get excellent results using instead
x = A * (A*A + e*I)^-1 * b
where e is a small constant (e.g. 0.001).
I should have mentioned that a very accurate result is not
required
(entire stuff is part of a larger algorithm which is
semi-discrete
and heuristic, so something like this is perfectly useful).
Id like
to know, however, what I am doing with this -- am I solving
something
like
min{(Ax+b)(Ax+b) + e||x||^2}
?
--
Jugoslav
___________
www.geocities.com/jdujic
===
Subject: Sinc Interpolation Question
I have a vector y with 8 elements and a corresponding 8 x 8
(diagonal)
covariance matrix Sy. I want to perform sinc interpolation on
y and
compute the corresponding covariance.
To sinc interpolate I perform:
y = [224.2944 224.4289 230.3499 239.9113 251.0483 259.5003
260.7612 250.3568];
F = fft(eye(8));
F2 = fft(eye(16));
zf = [0 0 0 0];
y_interp = F2 * circshift([zf; circshift(1/8 *
F * y, 4);
zf],8);
In the above I can replace the circshift function fftshift to
make it
easier to understand.
How do I go about computing the corrected covariance
Se_interp?
Should it be positive-definite?
===
Subject: Re: A Least Squares Problem
>| | please dont redirect as I dont read it
regularly>
Actually, sci.stat.math or sci.stat.consultwould be just as
good.
>Id like
>to know, however, what I am doing with this -- am I solving
something
>like
>min{(Ax+b)(Ax+b) + e||x||^2}
Find some references on ridge regression (dont have any off
the top of my
head, and my reference books are several miles away).
A look at Raos book (Linear Statistical Inference, Wiley)
might help you
in understanding the rank deficient case.
Other possibilities:
1) Use the SVD to determine the inverse. The usual deal there
is to assume
that the singular values near zero are equal to zero. In
exact arithmetic,
this procedure leads to the minimum L2 norm solution you are
looking for.
2) If A is large, try conjugate gradients. It can do
amazingly well on
problems of this sort.
--
My real email address is
mcintosh ##at## research ##dot## telcordia ##dot## com
===
Subject: Multivariate Adaptive Regression Splines (MARS)
Hi All,
I am using MARS 3.5 for scattered data points approximation
2D, 3D, 5D.
What
minimum number of data points is required to start build
approximation in
MARS?
--
rm -r /
Virginia Tech
===
Subject: Re: A Least Squares Problem
>please dont redirect as I dont read it
regularly>
>
>Im trying to solve a least-squares problem:
>
>min{(Ax+b)(Ax+b)} (1)
so Ax+b is a row for you? then: what is Ax ?
>
>whose explicit solution is:
>
>x = (A*A)^-1 * A * b (2)
>
>Matrix A has form, e.g.:
> 1 0 0 0 1
> -1 1 0 1 0
> 0 -1 1 -1 0
> 0 0 -1 0 -1
if this is A then x should have 5 and b 4 components
or otherwise your notation is faulty
for this A A*A is 5 times 5 and of rank 4 hence no inverse
exists.
snip
obviously you are interested in the minimum norm least
squares solution
of
norm(Ax+b,2) = min_x
the best way to compute this is via the svd (available in
matlab and
also in lapack)
it first computes (in the full -non economy version )
U , S and V which yield
A=USV
here U is unitary and has as much rows as A,
UU=UU=I
V is also unitary and has as much columns as A, abd
VV=VV=I
(so U and V are quadratic) and S has the same shape as A, but
has only
some
nonnegative elements along the diagonal, all other being zero
.
these elements are the singular values of A and their number
is the
rank of A.
now you compute the minimum norm least squares solution x as
x=V*S# *U*b
where
S# has the same shape as S (transpose of S) and along the
diagonal
the reciprocals of the nonzero singular values of A at the
positions
they
occur in S:
formally
(S#)(i,i) = 1/S(i,i) if S(i,i) not= 0, and =0 otherwise.
if you compute under roundoff, you must replace the decision
S(i,i) not=0 by S(i,i)>alpha>0 for some reasonable alpha
e.g.
alpha=100*eps*norm(A) in matlab notation.
you can get all his also from LAPACK and its derivatives (in
other
languages).
hth
peter
===
Subject: help needed for runaway ODE?
Hi All,
I am solving a robotic control problem, envolving coupled
nonlinear ODEs. I
found the solution to the ODEs using relaxation method from
the Numeric
Receipe in C for the two-point boundary value problem. But
after I changed
the relaxation method to Runge-Kutta method, using the
initial values
solved
by relaxation method, I got a runaway type of solution with
all solution
grow to very large numbers. I also tried the stiff solver in
the NRC, the
results were similar. I know my derivatives are correct in
Range-Kutta
because I computed derivative from the solution of relaxation
method and
they matched the derivatives from my Range-Kutta routine. But
the
derivatives were wrong when I computed it from the solution
of the
Range-Kutta method. Any suggestions from numeric gurus here?
I have been
struggling on this simple ODE problem for three weeks.
Everett
send your comments to everteq AT sbcglobal DOT net or post it
here. Many
===
Subject: Re: A Least Squares Problem
> | An nxp matrix A can be factored into a product of 3 other
matrices :
> | A=U*L*Vt (where t==transpose) where n for n data and p
for p
parameters,
> | using singular value decomposition SVD. U and V are data
and parameter
space
> | eigenvectors and L a diagonal matrix containing at most r
non-zero
> | eigenvalues of G with r<=p. So if
> | x = (A*A)^-1 * A * b
> | At*A=V*L^2*Ut*U*L*Vt=V*L^2*Vt ,since Ut*U=I
> | and (At*A)^-1=V*L^-1*Ut and finally, since Vt*V=I
> | The least square solution is given by
> | x=V*L^-1*Ut*b
> ...
> | SVD is the best way to decompose a matrix since it
provides extra
infomation
> | about the resolution of the reconstruction (resolution
matrices etc...)
> if r Remind you, the additional criterion for resolving rank
deficiency should
> be min{||x||}.
There is a little mistake in the solution above: If you don
not invert
L itself, which is not possible in the rank deficient case,
but invert only
all nonzero elements of L, you get the uniqe x with minimum
2-norm.
--
Dr. rer. nat. Uwe Schmitt http://www.procoders.net
schmitt@procoders.net A service to open source is a service to
mankind.
===
Subject: Re: help needed for runaway ODE?
> Hi All,
> I am solving a robotic control problem, envolving coupled
nonlinear ODEs.
I
> found the solution to the ODEs using relaxation method from
the Numeric
> Receipe in C for the two-point boundary value problem. But
after I
changed
> the relaxation method to Runge-Kutta method, using the
initial values
solved
> by relaxation method, I got a runaway type of solution with
all solution
> grow to very large numbers. I also tried the stiff solver
in the NRC, the
> results were similar. I know my derivatives are correct in
Range-Kutta
> because I computed derivative from the solution of
relaxation method and
> they matched the derivatives from my Range-Kutta routine.
But the
> derivatives were wrong when I computed it from the solution
of the
> Range-Kutta method. Any suggestions from numeric gurus
here? I have been
> struggling on this simple ODE problem for three weeks.
Its hard to make a substantive suggestion without seeing
the
exact
equations, but it sounds like a job for implicit or
semi-implicit
methods.
===
Subject: Re: =?iso-8859-1?Q?Bernstein=2DB=E9zier?=
coefficients?
boundary=------------2CF45486D96217C5826AF13D
-------------------------------------------------------------
--------
> I have to implement a specific algorithm.
> Just one question: if one talks about a Bernstein-B.8ezier
coefficient
> of a tensor-product surface one means a control point with
x,y,z
> -coordinates, right?
I dont know what specific classification of a
tensor product
surface you
refer to in your mail : a Generic B-Spline or a NURBS or a
Bezier
Surface (since you seem to
refer to Bernstein polynomials and Bezier Basis Functions in
your mail)
, and therefore,
Starting with a generic definition, of a Tensor-Product
Surface,
S(u,v) = B i* Pi(x,y,z)
where Bi is a generic Coefficient (a product of two curve
coefficients
for a surface)
and therefore:
[a] The Coefficient represents a term (of the polynomial
function)
that maps a point in R(3) space to
R(2) (or parametric) space. The point is the control point of
the
Tensor Product Surface for the specific u,v
value in the parametric space where u -> [a,b] and v->[c,d]
[b] A Point on the tensor-product surface and a Control Point
of the
tensor-product surface
are separate concepts and dont mean the same thing.
hope this solves the problem.
Anup R. Joshi
www.me.mtu.edu/~arjoshi
===
Subject: Re: A Least Squares Problem
Google that reference.
[38] S. M. Tan and C. Fox, Inverse Problems 453.707
classnotes, The
University of Auckland, Aucland, New Zealand., 2001.
What you are doing is referred to as regularized solution, or
damped
least
squares.
Read the first 3 chapters of the above reference, excellent
and very brief
reading on what you need to know when performing least
squares, or damped
(regularized) least squares.
Alien+
> An nxp matrix A can be factored into a product of 3 other
matrices :
> A=U*L*Vt (where t==transpose) where n for n data and p for
p parameters,
> using singular value decomposition SVD. U and V are data
and parameter
space
> eigenvectors and L a diagonal matrix containing at most r
non-zero
> eigenvalues of G with r<=p. So if
> x = (A*A)^-1 * A * b
> At*A=V*L^2*Ut*U*L*Vt=V*L^2*Vt ,since Ut*U=I
> and (At*A)^-1=V*L^-1*Ut and finally, since Vt*V=I
> The least square solution is given by
> x=V*L^-1*Ut*b
> SVDCMP.f from numerical receips in fortran, and svd(A) from
matlab give
> similar results.
> SVD is the best way to decompose a matrix since it provides
extra
infomation
> about the resolution of the reconstruction (resolution
matrices etc...)
> --
> ---FiLiP Louis---
> please dont redirect as I dont read it
regularly
> Im trying to solve a least-squares problem:
min{(Ax+b)(Ax+b)} (1)
whose explicit solution is:
x = (A*A)^-1 * A * b (2)
Matrix A has form, e.g.:
> 1 0 0 0 1
> -1 1 0 1 0
> 0 -1 1 -1 0
> 0 0 -1 0 -1
> i.e. it has exactly one pair of (1,-1) in each column.
There wont be
> any all-zero rows. As you can see, it may contain two or
more linearly
> dependent columns (two equal, two mutually negative, or
other
> combination).
> Further, due to nature of the problem (Id skip the
physical background
> for now, I can repost if someones interested) condition
is
that
> size(x) >= size(b)-1
The problem is that equation (2) has explicit solution (A*A
has
> inversion) only if
> size(x) = size(b)-1 = rank(A)
However, I have to solve the problem in general manner, i.e.
I want
> to obtain one of optimal solutions. Rank deficiency of A
should be
> preferredly solved by minimizing square sum of x, i.e.
min{|x^2|},
> i.e. the task is to find such x that a) minimizes (1) and b)
has
> minimal sum(x*x).
I plan to use Matlab as proving environment and
Fortran/Lapack for
> deployment (links to Fortran sources which solve that exact
problem are
> also welcome). I probably have to find QR decomposition of
AA (GEQRF),
> but Im lost at the moment what to do after that. I admit
my linear
> algebra is a little rusty...
Theres an interesting example under Matlabs
help on QR
function,
> but its not directly applicable -- in my case,
(AA) is
(can be)
> singular.
All suggestions/solutions are welcome. I suspect this is a
well-known
--
> Jugoslav
> ___________
> www.geocities.com/jdujic
===
Subject: Re: help needed for runaway ODE?
Hi Everett,
try my ODEs from http://www.delphipages.com/result.cfm?ID=3482
> Hi All,
>
> I am solving a robotic control problem, envolving coupled
nonlinear ODEs.
I
> found the solution to the ODEs using relaxation method from
the Numeric
> Receipe in C for the two-point boundary value problem. But
after I
changed
> the relaxation method to Runge-Kutta method, using the
initial values
solved
> by relaxation method, I got a runaway type of solution with
all solution
> grow to very large numbers. I also tried the stiff solver
in the NRC, the
> results were similar. I know my derivatives are correct in
Range-Kutta
> because I computed derivative from the solution of
relaxation method and
> they matched the derivatives from my Range-Kutta routine.
But the
> derivatives were wrong when I computed it from the solution
of the
> Range-Kutta method. Any suggestions from numeric gurus
here? I have been
> struggling on this simple ODE problem for three weeks.
>
>
> Everett
>
> send your comments to everteq AT sbcglobal DOT net or post
it here. Many
===
Subject: Discrete Chebyshev (or other orthogonal) polynomials.
For my research I want to find out more about discete
Chebyshev
polynomials of the first kind and their relation to Chebyshev
polynomials of the second kind.
In literature a lot of properties of the Chebyshev
polynomials and the
relations to other polynomials are known. But, afaik, all
these nice
propertie are derived under the assumption that we want to
approach a
continue function. I cannot find a list of properties in case
we want to
approach a discrete set of equidistant spaced points with
these
polynomials.
The description in Numerical Recipes for example also assumes
the the
function is known at all locations.
interesting words but nothing came out of it.
===
Subject: Help with adjustment to quadratic regression curve
algorithm
Im trying to understand/get an algorithm to work which
transforms a
quadratic regression curve to be unimodal using Bezier
control points. The
algorithm works out the transform.
Please understand that I am inexperienced in this field.
I can post the whole algorithm if its needed to put things in
context (its
not very long), but what Im particularly stuck on is this
equation:
m
Y0:=1/m SIGMA (Pi-(Y1)Si = (Y2)(Si)^2 )
i=1
where: m=number of points (Si,Pi),
Y1,Y2 are already transformed Ôouter points.
What does the = mean in (Pi-(Y1)Si = (Y2)(Si)^2 ) ?
The text states that:
this statement evaluates the best least squares estimate of
Y0 for the
parabola with new values of Y2 and Y1 resulting from the first
adjustment.
The second adjustment, a vertical translation of the
B.8ezier-reshaped
parabola, occurs only when and Y1 and Y2 have been altered.
In fact, Im not sure that the steps in the algorithm
Ive
done before this
equation are right either:(
So ANY help appreciated.
PS I have access to matlab
TIA
===
Subject: Re: Discrete Chebyshev (or other orthogonal)
polynomials.
HI,
did u take a look at - Conte/DeBoor: Elementary Numerical
Analysis, An
Algorithmic Approach- ?
I found it very useful, many times...
Ivano
Maurice ha scritto nel
messaggio
> For my research I want to find out more about discete
Chebyshev
> polynomials of the first kind and their relation to
Chebyshev
> polynomials of the second kind.
> In literature a lot of properties of the Chebyshev
polynomials and the
> relations to other polynomials are known. But, afaik, all
these nice
> propertie are derived under the assumption that we want to
approach a
> continue function. I cannot find a list of properties in
case we want to
> approach a discrete set of equidistant spaced points with
these
polynomials.
> The description in Numerical Recipes for example also
assumes the the
> function is known at all locations.
> interesting words but nothing came out of it.
===
Subject: Re: Discrete Chebyshev (or other orthogonal)
polynomials.
>
>
> For my research I want to find out more about discete
Chebyshev
> polynomials of the first kind and their relation to
Chebyshev
> polynomials of the second kind.
> In literature a lot of properties of the Chebyshev
polynomials and the
> relations to other polynomials are known. But, afaik, all
these nice
> propertie are derived under the assumption that we want to
approach a
> continue function. I cannot find a list of properties in
case we want to
> approach a discrete set of equidistant spaced points with
these
polynomials.
> The description in Numerical Recipes for example also
assumes the the
> function is known at all locations.
> interesting words but nothing came out of it.
>
Let me give you three references:
1. My class notes for a numerical analysis course: look on
http://www.phys.virginia.edu/classes/551.jvn.fall01/
You want Chapter 2, Representation of Functions.
2. Abramowitz & Stegun, Handbook of Mathematical Functions
(Dover PB)
3. Ralston, Introduction to Numerical Analysis
--
Julian V. Noble
Professor Emeritus of Physics
^^^^^^^^^^^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/
Science knows only one commandment: contribute to science.
-- Bertolt Brecht, Galileo.
===
Subject: Books On Generalized Reduced Gradient Algorithm?
Can any one recommend books or papers I can read that
describe how to
implement a Generalized Reduced Gradient Algorithm (such as
that used in
Excels Solver tool)? Source code implementing this
algorithm
would be
very useful as well.
-Vik
===
Subject: Re: Discrete Chebyshev (or other orthogonal)
polynomials.
>
>For my research I want to find out more about discete
Chebyshev
>polynomials of the first kind and their relation to Chebyshev
>polynomials of the second kind.
>In literature a lot of properties of the Chebyshev
polynomials and the
>relations to other polynomials are known. But, afaik, all
these nice
>propertie are derived under the assumption that we want to
approach a
>continue function. I cannot find a list of properties in case
we want to
>approach a discrete set of equidistant spaced points with
these
polynomials.
>The description in Numerical Recipes for example also
assumes the the
>function is known at all locations.
>interesting words but nothing came out of it.
>
>
discrete orthogonal for what scalar product? the chebyshev
polynomials of
degree <= m of the first kind are orthogonal
on the discrete set {x_k} = zeros of T_{m+1} with the
ordinary scalar
product.
for more information see
Chebyshev Polynomials
by J.C. Mason (University of Huddersfield, UK)
and D.C. Handscomb (lately of Oxford University)
Chapman & Hall / CRC Press, 2002, xiii+341 pp.
Hardback ISBN 0-8493-0355-9, $99.95
or
Pure and Applied Mathematics. New York: John Wiley & Sons,
Inc. xvi, 249
p. (1990)
hth
peter
===
Subject: Re: Books On Generalized Reduced Gradient Algorithm?
I believe this is actually Leon Lasdons GRG2 algorithm.
Some references are:
@misc{ fylstra98design,
author = D. Fylstra and L. Lasdon and A. Warren and J. Watson,
title = Design and use of the microsoft excel solvers,
text = D. Fylstra, L. Lasdon, A. Warren, and J. Watson,
Design and use
of the
microsoft excel solvers. To appear in Interfaces, 1998.,
year = 1998,
url = citeseer.nj.nec.com/fylstra98design.html }
L. S. Lasdon and A. D. Waren. Generalized reduced gradient
software for
linearly and nonlinearly constrained problems. In H. J.
Greenberg, editor,
Design and Implemetation of Optimization Software, pages
335---362. Sijthoff
and Noordhoff, Netherlands, 1978.
Lasdon L. S., Warren A. D., Jain A., and Ratner M. 1978.
Design and Testing
of a GRG Code for Nonlinear Optimization, ACM Trans.
Mathematical Software,
4: 3450.
-------------------------------------------------------------
---
Erwin Kalvelagen
erwin@gams.com, http://www.gams.com/~erwin
-------------------------------------------------------------
---
> Can any one recommend books or papers I can read that
describe how to
> implement a Generalized Reduced Gradient Algorithm (such as
that used in
> Excels Solver tool)? Source code implementing this
algorithm would be
> very useful as well.
> -Vik
===
Subject: Re: Discrete Chebyshev (or other orthogonal)
polynomials.
> 2. Abramowitz & Stegun, Handbook of Mathematical Functions
> (Dover PB)
Or download it for free.
http://jove.prohosting.com/~skripty/
===
Subject: skyline matrix solver
Please,
I need a skyline matrix solver algorithm. Where can I find
one?
Cpplayer
===
Subject: Re: Books On Generalized Reduced Gradient Algorithm?
>Can any one recommend books or papers I can read that
describe how to
>implement a Generalized Reduced Gradient Algorithm (such as
that used in
>Excels Solver tool)? Source code implementing this
algorithm would be
>very useful as well.
>
>
>-Vik
the textbook by
Avriel & Golany : mathematical programming for industrial
engineers
(marcel Decker publisher) contains a chapter on nonlinear
programming
written
by Lasdon and coworkers which gives very much details about
this.
source code is not on the net. this is in commercial (and
rather
expensive)
products.
hth
peter
===
Subject: Eignevector differentiation
Is it possible to differentiate the eigenvalues and
eigenvectors of a
square
symmetric matrix A with respect to any component of A?
I.e. if A has ith eigenvalue lambda_i and
ith eigenvector
v_i, what is :
d(lambda_i)/d(A_mn)
and what is :
d(v_i)/d(A_mn)
Mike Fairbank.
===
Subject: Re: Eignevector differentiation
> Is it possible to differentiate the eigenvalues and
eigenvectors of a
square
> symmetric matrix A with respect to any component of A?
>
> I.e. if A has ith eigenvalue lambda_i and
ith eigenvector
v_i, what is
:
>
> d(lambda_i)/d(A_mn)
>
> and what is :
>
> d(v_i)/d(A_mn)
Basically I think you can differentiate
the eigenvalues, provided they are not multiple. If they are
multiple,
things get
tricky.
The Implicit Value Theorem gives you the derivative for
non-multiple
eigenvalues,
if you plug the characteristic polynomial of the matrix.
===
Subject: Re: Discrete Chebyshev (or other orthogonal)
polynomials.
Distribution: inet
>
>>2. Abramowitz & Stegun, Handbook of Mathematical Functions
>> (Dover PB)
>
> Or download it for free.
> http://jove.prohosting.com/~skripty/
Any evidence that this book is out of copyright, and that
its now okay
to post it on the web?
Andrew
--
Andrew Ross
Industrial and Systems Engineering
Lehigh University, www.lehigh.edu/~inime/
Bethlehem, Pennsylvania, USA
remove all digits <=4 from my e-mail address to reply
===
Subject: Re: Eignevector differentiation
>
> Is it possible to differentiate the eigenvalues and
eigenvectors of a
square
> symmetric matrix A with respect to any component of A?
Yes, if (and only if) the eigenvalue is simple. But the
normalization
condition for the eigenvector must be specified.
Let A=A(t) depend on some parameter t (e.g. t=A_ik).
Then locally (assuming the eigenvalue is simple) there is a
solution of
A(t)x(t)=lam(t)x(t), x(t)^Tx(t)=1
by the implicit function theorem. Differentiate to get
A(t)x(t)+A(t)x(t)=lam(t)x(t)
+lam(t)x(t), x(t)^Tx(t)=0.
Rewrite this as a linear system for x(t) and
lam(t) an
solve by
Gaussian elimination. It is not difficult to prove that the
system
is nonsingular for a simple eigenvalue. The same approach
works for
other normalizations such as e^Tx(t)=1, where e is a unit
vector.
Arnold Neumaier
===
Subject: Re: Discrete Chebyshev (or other orthogonal)
polynomials.
>
>2. Abramowitz & Stegun, Handbook of Mathematical Functions
>> (Dover PB)
Or download it for free.
> http://jove.prohosting.com/~skripty/
>
> Any evidence that this book is out of copyright, and that
its now okay
> to post it on the web?
The Dover version might be copyright, but the hardback is a US
government publication, and hence (IIRC) not
copyright-protected.
Phil Hobbs
===
Subject: Re: Eignevector differentiation
Would that give me the derivatives of the eigenvectors as
well?
BTW I think I might have missed some relevant background to
my problem.
This may or may not make the solution to the above problem
clearer. Here
it
is:
I am investigating the least squares solution to the matrix
equation Ax=B.
This least squares solution is x=(AA)^-1AB.
I want to
differentiate x
with respect to A, i.e. find dx/dA_mn, but when
AA is close
to singular.
For this I need to know how (AA)^-1 changes with respect to
A. I already
have this answer when AA is not close to singular: then you
can just use
d((AA)^-1)/dA_mn
=-(AA)^-1.(d(AA)/d(A_mn)).(AA
)^-1
However as AA it is close to singular I should use the
Singular Value
Decompostion algorithm to invert AA. Instead of SVD, for
efficiency, I am
using an eigenvector finding algorithm since this gives the
same thing, I
think (i.e. when SVD algorithm is applied to
AA=UWV then W
always turns
out to be the diagonal matrix of eigenvalues of AA, and U=V
is the square
matrix of all the eigenvectors of AA). Thats
why I want to
differentiate
the eigenvectors and eigenvalues.
So once you have the SVD, you can invert AA easily as
VW^-1U while
neglecting any terms in W that were close to zero. So
shouldnt it be
possible to differentiate this SVD inversion, since it was
possible when
AA
wasnt nearly singular, and the SVD inverion algorithm is
clearly defined.
Hope that makes things more clear!
Mike Fairbank
> Is it possible to differentiate the eigenvalues and
eigenvectors of a
square
> symmetric matrix A with respect to any component of A?
I.e. if A has ith eigenvalue lambda_i and
ith eigenvector
v_i, what
is
:
d(lambda_i)/d(A_mn)
and what is :
d(v_i)/d(A_mn)
> Basically I think you can differentiate
> the eigenvalues, provided they are not multiple. If they
are multiple,
things get
> tricky.
> The Implicit Value Theorem gives you the derivative for
non-multiple
eigenvalues,
> if you plug the characteristic polynomial of the matrix.
===
Subject: Re: Eignevector differentiation
> Is it possible to differentiate the eigenvalues and
eigenvectors of a
square
> symmetric matrix A with respect to any component of A?
I.e. if A has ith eigenvalue lambda_i and
ith eigenvector
v_i, what is
:
d(lambda_i)/d(A_mn)
and what is :
d(v_i)/d(A_mn)
> Basically I think you can differentiate
> the eigenvalues, provided they are not multiple. If they are
multiple, things get tricky.
> The Implicit Value Theorem gives you the derivative for
non-multiple eigenvalues,
> if you plug the characteristic polynomial of the matrix.
The main trouble is that you do not get an eigenvector but the
whole straight line in its direction: every non-zero multiple
of
an eigenvector is again an eigenvector.
Normalization does narrow down the choices to two (mutually
opposite, with no clear decision procedure), which leads to
the
following implicit equation between A and v (where v is the
transpose of v):
A * v - v * v * A * v = 0 , v non-zero
with the side effect that v * A * v is the eigenvalue.
Implicit differentiation of v with respect to A is a mess.
If you are interested only in pure existence, or are not
afraid
of inverting and integrating to obtain derivatives, here is a
different philosophy:
The projector onto the eigenspace corresponding to an
eigenvalue
lambda is uniquely determined and has a formula due to Riesz:
E = (1/(2*pi*i)) * int[along C] (z*I - A)^(-1) dz
where the smooth curve C runs once around lambda and misses
all
other eigenvalues.
The rank of E equals the multiplicity of lambda.
Differentiation: To get the total differential of E applied to
an increment H in A, you differentiate the resolvent
(z*I-A)^(-1) with respect to H, and integrate. The result is
if H = dA then (abbreviating to avoid long formulas)
dE = (1/(2*pi*i)) * int[along C] W(z) dz
and W(z) = (z*I-A)^(-1) * H * (z*I-A)^(-1)
If the curve C is a circle, polar coordinates centered at
lambda
lead to the integration of a smooth periodic function over
full
period, so Trapezoidal Rule converges very fast.
The eigenvectors are recaptured as a basis of the range of E.
Another welcome property of Riesz formula is that it applies
to
a cluster of eigenvalues, yielding a basis of the invariant
subspace corresponding to that cluster, and also symmetry is
not
required. C can be a sum of simple curves, if convenient
(e.g.in
case of pairs of complex conjugate eigenvelues).
More detailed discussion is found in
H. Baumgaertel (or Baumgartel?)
Analytic perturbation theory for matrices and operators.
Birkhauser Verlag, Basel, 1985.
===
Subject: Percentile Estimation in a Monte Carlo Simulation
I am trying to estimate a fairly extreme percentile (99.7)
for a
distribution obtained from Monte Carlo simulation. I am
facing a
problem because of the instability of data at the extremes of
the
distribution, as in, if the percentile values are calculated
for
different simulation runs, they seem to jump around a lot. I
am
currently using the MATLAB prctile function to estimate the
percentile
and am limited to estimate it with 1000 iterations.
I would really appreciate if anybody can suggest me a better
algorithm
than what is being used in the prctile function, which can
provide a
closer estimate to the true percentile.
Uttam
===
Subject: SPSS.v12.0, SPSS.Web.Deployment.Framework.v2.4, -
new !
SPSS.v12.0, SPSS.Web.Deployment.Framework.v2.4, - new !
for more info please send email
===
Subject: poisson equation
I am trying to solve poisson equation:
diff(diff(u(y,z),y),y) + diff(diff(u(y,z),z),z) = 1
using separation of variables method.
The boundary conditions for the problem are:
u(1,z)=0
u(-1,z)=0
u(y,1)=0
u(y,-1)=0
can you please guide me to a good reference which will help
me in
solving this problem using separation of variables.
Do you know how to solve this equation using mathematica
===
Subject: Fourier transforms (coefficient calculation)...
For a few days now, I have tried a number of methods that are
supposed
to provide the a(k) and b(k) coefficients for a Fourier
series. These
methods are listed at the end of this post (in Java).
However, not
one of these methods seems to provide the correct coefficients
for the
following function;
f(x) = 2 - 2 * cos(x)
...I never see a Ô-2 or
Ô2 in the resulting generated
arrays. I get
a(0) = 4 which is correct, but there is no sign of a(1)
anywhere (when
the expression is changed to f(x) = 2 - 2 * sin(x), things
seem to
work).
Does someone have an algorithm that works for the above? I
have tried
all the Google searches (the source of the methods below),
but to no
avail. Please post some example code either in Java or C++ as
all the
Ôtry searching for ... suggestions seen in
other postings
have been
fruitless. In the meanwhile, perhaps the stuff below will be
of use to
someone.
Matthew
public static void computeFFT(double ar[], double ai[])
{
if (ar.length != ai.length)
{
System.err.println(array dimensions must
match);
}
else if (!isPowerOfTwo(ar.length))
{
System.err.println(array dimensions must be
multiple of 2);
}
else
{
computeFFT(1, ar.length, ar, ai);
if (ai[0] > EPSI)
{
System.err.println(imaginary part of
constant not zero);
}
}
}
public static void computeFFT(int sign, int n, double ar[],
double
ai[])
{
double scale = 2.0 / (double) n;
int i, j;
for (i = j = 0; i < n; ++i)
{
if (j >= i)
{
double tempr = ar[j] * scale;
double tempi = ai[j] * scale;
ar[j] = ar[i] * scale;
ai[j] = ai[i] * scale;
ar[i] = tempr;
ai[i] = tempi;
}
int m = n / 2;
while ((m >= 1) && (j >= m))
{
j -= m;
m /= 2;
}
j += m;
}
int mmax, istep;
for (mmax = 1, istep = 2 * mmax;
mmax < n;
mmax = istep, istep = 2 * mmax)
{
double delta = sign * Math.PI / (double) mmax;
for (int m = 0; m < mmax; ++m)
{
double w = m * delta;
double wr = Math.cos(w);
double wi = Math.sin(w);
for (i = m; i < n; i += istep)
{
j = i + mmax;
double tr = wr * ar[j] - wi *
ai[j];
double ti = wr * ai[j] + wi *
ar[j];
ar[j] = ar[i] - tr;
ai[j] = ai[i] - ti;
ar[i] += tr;
ai[i] += ti;
}
}
mmax = istep;
}
}
public static double[][] fft_1d(double[][] array)
{
double u_r, u_i, w_r, w_i, t_r, t_i;
int ln, nv2, k, l, le, le1, j, ip, i, n;
n = array.length;
ln = (int) (Math.log((double) n) / Math.log(2) + 0.5);
nv2 = n / 2;
j = 1;
for (i = 1; i < n; i++)
{
if (i < j)
{
t_r = array[i - 1][0];
t_i = array[i - 1][1];
array[i - 1][0] = array[j - 1][0];
array[i - 1][1] = array[j - 1][1];
array[j - 1][0] = t_r;
array[j - 1][1] = t_i;
}
k = nv2;
while (k < j)
{
j = j - k;
k = k / 2;
}
j = j + k;
}
for (l = 1; l <= ln; l++) /* loops thru stages */
{
le = (int) (Math.exp((double) l * Math.log(2)) +
0.5);
le1 = le / 2;
u_r = 1.0;
u_i = 0.0;
w_r = Math.cos(Math.PI / (double) le1);
w_i = -Math.sin(Math.PI / (double) le1);
for (j = 1;
j <= le1;
j++) /* loops thru 1/2 twiddle values per
stage */
{
for (i = j;
i <= n;
i += le) /* loops thru points per
1/2 twiddle */
{
ip = i + le1;
t_r = array[ip - 1][0] * u_r - u_i *
array[ip - 1][1];
t_i = array[ip - 1][1] * u_r + u_i *
array[ip - 1][0];
array[ip - 1][0] = array[i - 1][0] -
t_r;
array[ip - 1][1] = array[i - 1][1] -
t_i;
array[i - 1][0] = array[i - 1][0] +
t_r;
array[i - 1][1] = array[i - 1][1] +
t_i;
}
t_r = u_r * w_r - w_i * u_i;
u_i = w_r * u_i + w_i * u_r;
u_r = t_r;
}
}
return array;
}
public static void fft(double[][] array)
{
double u_r, u_i, w_r, w_i, t_r, t_i;
int ln, nv2, k, l, le, le1, j, ip, i, n;
n = array.length;
ln = (int) (Math.log((double) n) / Math.log(2) + 0.5);
nv2 = n / 2;
j = 1;
for (i = 1; i < n; i++)
{
if (i < j)
{
t_r = array[i - 1][0];
t_i = array[i - 1][1];
array[i - 1][0] = array[j - 1][0];
array[i - 1][1] = array[j - 1][1];
array[j - 1][0] = t_r;
array[j - 1][1] = t_i;
}
k = nv2;
while (k < j)
{
j = j - k;
k = k / 2;
}
j = j + k;
}
/* loops thru stages */
for (l = 1; l <= ln; l++)
{
le = (int) (Math.exp((double) l * Math.log(2)) +
0.5);
le1 = le / 2;
u_r = 1.0;
u_i = 0.0;
w_r = Math.cos(Math.PI / (double) le1);
w_i = -Math.sin(Math.PI / (double) le1);
/* loops thru 1/2 twiddle values per stage */
for (j = 1; j <= le1; j++)
{
/* loops thru points per 1/2 twiddle */
for (i = j; i <= n; i += le)
{
ip = i + le1;
t_r = array[ip - 1][0] * u_r - u_i *
array[ip - 1][1];
t_i = array[ip - 1][1] * u_r + u_i *
array[ip - 1][0];
array[ip - 1][0] = array[i - 1][0] -
t_r;
array[ip - 1][1] = array[i - 1][1] -
t_i;
array[i - 1][0] = array[i - 1][0] +
t_r;
array[i - 1][1] = array[i - 1][1] +
t_i;
}
t_r = u_r * w_r - w_i * u_i;
u_i = w_r * u_i + w_i * u_r;
u_r = t_r;
}
}
}
public static void newCompute(int sign, int n, double ar[],
double
ai[])
{
double scale = 2.0 / (double) n;
int i, j;
for (i = j = 0; i < n; ++i)
{
if (j >= i)
{
double tempr = ar[j] * scale;
double tempi = ai[j] * scale;
ar[j] = ar[i] * scale;
ai[j] = ai[i] * scale;
ar[i] = tempr;
ai[i] = tempi;
}
int m = n / 2;
while ((m >= 1) && (j >= m))
{
j -= m;
m /= 2;
}
j += m;
}
int mmax, istep;
for (mmax = 1, istep = 2 * mmax;
mmax < n;
mmax = istep, istep = 2 * mmax)
{
double delta = sign * Math.PI / (double) mmax;
for (int m = 0; m < mmax; ++m)
{
double w = m * delta;
double wr = Math.cos(w);
double wi = Math.sin(w);
for (i = m; i < n; i += istep)
{
j = i + mmax;
double tr = wr * ar[j] - wi *
ai[j];
double ti = wr * ai[j] + wi *
ar[j];
ar[j] = ar[i] - tr;
ai[j] = ai[i] - ti;
ar[i] += tr;
ai[i] += ti;
}
}
mmax = istep;
}
}
public static void otherCompute(int sign, int n, double ar[],
double
ai[])
{
double scale = 2.0 / (double) n;
int i, j;
for (i = j = 0; i < n; ++i)
{
if (j >= i)
{
double tempr = ar[j] * scale;
double tempi = ai[j] * scale;
ar[j] = ar[i] * scale;
ai[j] = ai[i] * scale;
ar[i] = tempr;
ai[i] = tempi;
}
int m = n / 2;
while ((m >= 1) && (j >= m))
{
j -= m;
m /= 2;
}
j += m;
}
int mmax, istep;
for (mmax = 1, istep = 2 * mmax;
mmax < n;
mmax = istep, istep = 2 * mmax)
{
double delta = sign * Math.PI / (double) mmax;
for (int m = 0; m < mmax; ++m)
{
double w = m * delta;
double wr = Math.cos(w);
double wi = Math.sin(w);
for (i = m; i < n; i += istep)
{
j = i + mmax;
double tr = wr * ar[j] - wi *
ai[j];
double ti = wr * ai[j] + wi *
ar[j];
ar[j] = ar[i] - tr;
ai[j] = ai[i] - ti;
ar[i] += tr;
ai[i] += ti;
}
}
mmax = istep;
}
}
public static Ret fourn(
double x_re[],
double x_im[],
int nn[],
int ndim,
int isign)
{
Ret ret = new Ret();
ßoat[] data = new ßoat[2 * nn[0]];
for (int i = 0; i < 2 * nn[0]; i = i + 2)
{
if (i < 2 * x_re.length && i < 2 * x_im.length)
{
data[i] = (ßoat) x_re[i / 2];
data[i + 1] = (ßoat) x_im[i / 2];
}
else
{
data[i] = 0;
data[i + 1] = 0;
}
}
//Replaces data by its ndim-dimensional discreate Fourier
transform,
//if isign is input as 1. nn[0..ndim-1] is an integer
array
containing
//the lengths of each dimension (number of complex values),
which
//MUST all be power of 2. data is a real array of
length twice
the
//product of these lengths, in which the data are stored as
in a
//multidimensional complex array: real and imaginary parts
of each
//element are in consecutive locations, and the right most
index of
//the array inreases most rapidly as one proceeds along
data. For a
//two-dimensionalbe array, this is equivalent to storing the
array
by
//rows. If isign is input as -1, data is replaced by its
inverse
//transform times the product of the lengths of all
dimensions.
int idim;
int i1, i2, i3, i2rev, i3rev, ip1, ip2, ip3, ifp1, ifp2;
int ibit, k1, k2, n, nprev, nrem, ntot;
ßoat tempr, tempi;
//Double precision for the trigonometric recurrences
double wtemp, wr, wpr, wpi, wi, theta;
//Compute total number of complex values
for (ntot = 1, idim = 0; idim < ndim; idim++)
ntot *= nn[idim];
nprev = 1;
for (idim = ndim - 1; idim >= 0; idim--)
{
n = nn[idim];
nrem = ntot / (n * nprev);
ip1 = nprev << 1;
ip2 = ip1 * n;
ip3 = ip2 * nrem;
i2rev = 1;
//This is the bit-reversal section of the routine.
for (i2 = 1; i2 <= ip2; i2 += ip1)
{
if (i2 < i2rev)
{
for (i1 = i2; i1 <= i2 + ip1 - 2; i1
+= 2)
{
for (i3 = i1; i3 <= ip3; i3
+= ip2)
{
i3rev = i2rev + i3 -
i2;
ßoat temp = data[i3
- 1];
data[i3 - 1] =
data[i3rev - 1];
data[i3rev - 1] =
temp;
temp = data[i3];
data[i3] =
data[i3rev];
data[i3rev] = temp;
}
}
}
ibit = ip2 > 1;
while (ibit >= ip1 && i2rev > ibit)
{
i2rev -= ibit;
ibit >= 1;
}
i2rev += ibit;
}
//Here begins the Danielson-Lanczos section of the
routine.
ifp1 = ip1;
while (ifp1 < ip2)
{
ifp2 = ifp1 << 1;
// Initialized for the trig. recurrence
theta = isign * 6.28318530717959 / (ifp2 /
ip1);
wtemp = Math.sin(0.5 * theta);
wpr = -2.0 * wtemp * wtemp;
wpi = Math.sin(theta);
wr = 1.0;
wi = 0.0;
for (i3 = 1; i3 <= ifp1; i3 += ip1)
{
for (i1 = i3; i1 <= i3 + ip1 - 2; i1
+= 2)
{
for (i2 = i1; i2 <= ip3; i2
+= ifp2)
{
//Danielson-Lanczos
formula:
k1 = i2;
k2 = k1 + ifp1;
tempr =
(ßoat) wr *
data[k2
-
1]
-
(ßoat) wi * data[k2];
tempi =
(ßoat) wr *
data[k2]
+
(ßoat) wi * data[k2
-
1];
data[k2 - 1] =
data[k1 - 1] - tempr;
data[k2] = data[k1]
- tempi;
data[k1 - 1] +=
tempr;
data[k1] += tempi;
}
}
//Trigonometric recurrence
wr = (wtemp = wr) * wpr - wi * wpi +
wr;
wi = wi * wpr + wtemp * wpi + wi;
}
ifp1 = ifp2;
}
nprev *= n;
}
ret.x_re = new double[data.length / 2];
ret.x_im = new double[data.length / 2];
for (int i = 0; i < data.length; i = i + 2)
{
ret.x_re[i / 2] = data[i];
ret.x_im[i / 2] = data[i + 1];
}
return ret;
}
public class Ret
{
public double[] x_re;
public double[] x_im;
}
===
Subject: Re: Fourier transforms (coefficient calculation)...
>Does someone have an algorithm that works for the above? I
have tried
>all the Google searches (the source of the methods below),
but to no
>avail. Please post some example code either in Java or C++
as all the
>try searching for ... suggestions seen in
other postings
have been
>fruitless. In the meanwhile, perhaps the stuff below will be
of use to
>someone.
This is off-topic in at least two ways here, but I feel nice
today, so
I tried (after making it compilable) your method number I
with the
following main function.
public static void main(String argv[])
{ final int size=8;
double ar[]=new double[size];
double ai[]=new double[size];
for(int i=0;i
>
> For a few days now, I have tried a number of methods that
are supposed
> to provide the a(k) and b(k) coefficients for a Fourier
series. These
> methods are listed at the end of this post (in Java).
However, not
> one of these methods seems to provide the correct
coefficients for the
> following function;
>
> f(x) = 2 - 2 * cos(x)
>
> ...I never see a Ô-2 or
Ô2 in the resulting generated
arrays. I get
> a(0) = 4 which is correct, but there is no sign of a(1)
anywhere (when
> the expression is changed to f(x) = 2 - 2 * sin(x), things
seem to
> work).
>
> Does someone have an algorithm that works for the above? I
have tried
> all the Google searches (the source of the methods below),
but to no
> avail. Please post some example code either in Java or C++
as all the
> Ôtry searching for ... suggestions seen in
other postings
have been
> fruitless. In the meanwhile, perhaps the stuff below will
be of use to
> someone.
>
This is Off Topic
in comp.lang.c comp.lang.c++ and probably comp.lang.java.
Try The Object-Oriented Numerics Page
http://www.oonumerics.org/oon/
GSL -- The GNU Scientific Library
http://sources.redhat.com/gsl/
Available C++ Libraries FAQ
http://www.faqs.org/faqs/C++-faq/libraries/part1/
===
Subject: Re: Computational Evolution without velocities
>* Gordon D. Pusch:
> Newtons laws (i.e. non-relativistic) one can neglect the
fact that the
> update formula
>
> x_new = x_old - Force DeltaTime / 2 Mass
>
> holds for any simulation and we do not need to take care of
velocities.
>> This equation is quite obviously wrong, [...]
>He may be talking about Stoermer-Verlet algorithms,
>which have update formulae that are indeed relatively
>simple and dont contain the velocity. Also, they are
>used for n-body problems and hard sphere ßuids and have
>other interesting properties (look up symplectic algorithms).
>x_new = 2 x_old - x_older + DeltaTime^2 Force / Mass +
O(DeltaTime^4)
>would be a correct formula. That is not far off from his
>version, and given that he heard it as folklore, it may
>well be it.
>(Of course, the velocity is not neglected here. It is
implicitly
>contained in the ODE of 2nd order that is discretized
directly.
>It could also be rewritten into two ODEs of 1st order and
discretized
>afterwards, which would lead to better known schemes like
Runge-Kutta.)
I suspect that you are right. And, after reading the thread
here I suspect that some folks who answered were a bit too
quick on the trigger.
First, the absence of a velocity (first derivative) term in
what
is really a second order differential equation is no problem.
There are several well-known methods for doing such
integrations
when the velocity is not needed.
There are several different Stoermer-Verlet algorithms. One
is given above by Mazzucco. The original and slightly
incorrect
formula given by the original poster is half of what is
usually
called velocity Verlet. There are a pair of coupled equations
x_{n+1} = x_n + hv_n + h^2 F(x_n) / 2 m
v_{n+1} = v_n + h [ F(x_{n+1} + F(x_n) ] / 2 m
where x is the coordinate, v the velocity, and F the force
evaluated at the given argument. Starting with x_0 and v_0
the first equation can be evaluated which allows for the
second to be evaluated since the needed coordinate is now
known. So this is NOT a predictor-corrector formula.
The set of equations is symplectic and while not of high
order, if the system is conservative and describle by a
Hamiltonian in which the kinetic energy depends only on
the velocities and the potential eneryg only on the
coordinates,
then the total energy will not deviate much from its
initial value. That is the deviation in the total energy
is bounded.
Since there is only once function evaluation per cycle
through the equations (after the first trip) this is a
fairly cheap integration method. It is, as the original
poster said, quite popular among those who do modelling
of galaxies and molecules.
There is a large literature on these equations and their
several cousins. A search on Verlet and symplectic
on Google turned up 528 responses, many of which are
quite good.
---- Paul J. Gans
===
Subject: Re: Eignevector differentiation
>
> Would that give me the derivatives of the eigenvectors as
well?
the procedure has already been explained by Arnold Neumaier;
but be
aware that you have to carry out the procedure for each
eigenvector. Since you might be only interested in the
dependency of
the solution vector x on A, you could apply the same method
to your
equation.
In order to find the dependency of all eigenvalues and
eigenvectors on
A, you could apply V.I. Arnolds Normal Form
for matrices,
which has
been outlined in his book on Geometric methods.
> However as AA it is close to singular I should use the
Singular Value
> Decompostion algorithm to invert AA. Instead of SVD, for
> efficiency, I am
I seriously doubt that that would improve performance! As far
as I
know SVD is much cheaper than finding the eigenvalues and
eigenvectors!
Another hint: In almost any textbook you will find the
recommendation
not to use AA, but perform the SVD directly to A.
Maybe you should also apply bifurcation theory to your
problem, since
at to the singularity you just dont have any continuous
dependence.
Also the SVD doesnt behave smoothly, when the singular
values cross
the threshold.
Alois
--
Alois Steindl, Tel.: +43 (1) 58801 / 32558
Inst. for Mechanics II, Fax.: +43 (1) 58801 / 32598
Vienna University of Technology,
A-1040 Wiedner Hauptstr. 8-10
===
Subject: Re: Percentile Estimation in a Monte Carlo Simulation
> I am trying to estimate a fairly extreme percentile (99.7)
for a
> distribution obtained from Monte Carlo simulation. I am
facing a
> problem because of the instability of data at the extremes
of the
> distribution, as in, if the percentile values are
calculated for
> different simulation runs, they seem to jump around a lot.
I am
> currently using the MATLAB prctile function to estimate the
percentile
> and am limited to estimate it with 1000 iterations.
> I would really appreciate if anybody can suggest me a better
algorithm
> than what is being used in the prctile function, which can
provide a
> closer estimate to the true percentile.
> Uttam
(i) You can work out roughly how many samples you would need
to get
reasonable accuracy. Treat the quantile as a fixed value and
the
number of samples exceeding this as a random variable ...
essentially
Binominal. The estimate of the probability is a scaled
version of
this, and hence you can get a formula for the standard
deviation of
the estimated probability as a function of sample size. To
get a
reasonable estimate of the probability when it is near 0.003,
you
might decide that you should estimate it to within plus or
minus
0.0001 .... following through with this will show you need a
very
large number of simulations.
(ii) To improve matters you will need to move away from
straightfoward
direct simulations and make use of some knowledge of the
structure of
whatever you are simulating. A number of general approaches
are
available ...
(a) Variance reduction techniques (qv). ( These are more often
suggested for problems of estimating mean values, but you
might fins
something useful under this heading). Examples are the use of
antithetic pseudo-random numbers and using control variables.
(b) Importance sampling (qv). You fix up the simulations to
generate
more of the extreme events and then downscale the estimated
frequency.
This can result in much improved estimates of the tails of a
distribution for the same number of simulations.
(c) Remove some of the random variation from the simulations.
For
example, if your final variable is generated from a
distribution
conditional on another random variable, you might remove this
step
(the generation of the final variable) and replace it with a
theoretical calculation based on the conditional distribution.
David Jones
===
Subject: Discrete Orthogonal Polynomials - II
A few days i ago i asked a question regarding discrete
Chebyshev
polynomials and the answers were usefull in the sense that it
triggered
me to rethink the problem.
The problem is as follows.
Ive a set of measurements sampled on a uniform (1D or 2D
-grid).
Through these values I want to estimate a function that
describes the
values I have.
Using the estimated function I can obtain a set of equations
that
contain certain parameters Im interested in.
The problem lies in the parameterization of the function. I
Know it is a
fairly smooth function so I can parameterize the function in
terms of a
Taylor series. Instead of a Taylor-series I can also
parameterize it as
a orthogonal polynomial,for example a Chebyshev polyn. But in
order to
do this correctly and to be able to use al nice properties of
the
Chebyshev polynomials I need sampled points on a
Chebyshev-grid. This
is non-uniform and for each order of the Chebychev polynomial
different.
But in literature (Mostly Image Processing) I see examples in
which they
apply Chebychev polynomials on a uniform grid, an image for
example. And
they use the scalar-product rules but now using the uniform
sampled points.
Now are my questions
1 Is this allowed? (I think the answer is no).
2 Can I overcome the grid-problem for the Chebyshev
polynomials?
3 There are a lot of other discrete orthogonal polynomials, is
there one in which I can directly use the points sampled on
the
uniform grid?
Maurice
===
Subject: quadrature
Could somebody help me to answer the following question: Let
$fcolon[0,infty)to[0,infty)$. What do I have to assume in
order to
obtain the convergence of the square quadrature for $f$? Id
be
grateful for any help. Peter
===
Subject: Re: poisson equation
> I am trying to solve poisson equation:
> diff(diff(u(y,z),y),y) + diff(diff(u(y,z),z),z) = 1
> using separation of variables method.
> The boundary conditions for the problem are:
> u(1,z)=0
> u(-1,z)=0
> u(y,1)=0
> u(y,-1)=0
> can you please guide me to a good reference which will help
me in
> solving this problem using separation of variables.
> Do you know how to solve this equation using mathematica
You cannot solve nonhomogeneous equations with separation of
variables.
Try
instead an eigenvector expansion, e.g.,
u(y,z)=Sum_{mn}A_{mn}cos[(2m-1)pi y/2]cos[(2n-1)pi z/2].
Substitute this equation into your PDE, and solve for
coefficients A_{mn}.
See any standard book on Fourier series solution of PDEs.
===
Subject: Re: quadrature
>
> Could somebody help me to answer the following question: Let
> $fcolon[0,infty)to[0,infty)$. What do I have to assume in
order
to
> obtain the convergence of the square quadrature for $f$?
Id be
> grateful for any help. Peter
I presume you are asking what conditions must f(x) satisfy in
order that
the
(improper) integral --LaTeX format, sorry--
int_0^infty {dxleft| {ßeft( x right)} right|^2 }
be finite.
Obviously, assuming f(x) has no singularities other than 0
and infty,
you want |f|^2 to be integrable at x = 0, and also it should
fall off
rapidly enough for large x as to be integrable there also.
Since this sounds like a homework problem, I will content
myself with
hints:
What is the condition on c < 0 for x^c to give a finite
integral
near x = 0?
What is the condition on c < 0 for x^c to yield a finite
integral
as x -> infty ?
How can I translate these bounds to conditions on |f(x)| ?
--
Julian V. Noble
Professor Emeritus of Physics
^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/
Science knows only one commandment: contribute to science.
-- Bertolt Brecht, Galileo.
===
Subject: Re: Discrete Chebyshev (or other orthogonal)
polynomials.
>
>>2. Abramowitz & Stegun, Handbook of Mathematical Functions
>> (Dover PB)
Or download it for free.
> http://jove.prohosting.com/~skripty/
Any evidence that this book is out of copyright, and that
its now okay
> to post it on the web?
>
> The Dover version might be copyright, but the hardback is a
US
> government publication, and hence (IIRC) not
copyright-protected.
>
>
> Phil Hobbs
Quite right. However, keep in mind that by the time you print
out this
immense
book, you will have spent a lot more than the Dover PB will
run you. I
dont
know if the US Printing Office still puts out a hardcover
version.
--
Julian V. Noble
Professor Emeritus of Physics
^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/
Science knows only one commandment: contribute to science.
-- Bertolt Brecht, Galileo.
===
Subject: Re: Discrete Orthogonal Polynomials - II
>
>
> A few days i ago i asked a question regarding discrete
Chebyshev
> polynomials and the answers were usefull in the sense that
it triggered
> me to rethink the problem.
> The problem is as follows.
> Ive a set of measurements sampled on a uniform (1D or 2D
-grid).
> Through these values I want to estimate a function that
describes the
> values I have.
> Using the estimated function I can obtain a set of
equations that
> contain certain parameters Im interested in.
> The problem lies in the parameterization of the function. I
Know it is a
> fairly smooth function so I can parameterize the function
in terms of a
> Taylor series. Instead of a Taylor-series I can also
parameterize it as
> a orthogonal polynomial,for example a Chebyshev polyn. But
in order to
> do this correctly and to be able to use al nice properties
of the
> Chebyshev polynomials I need sampled points on a
Chebyshev-grid. This
> is non-uniform and for each order of the Chebychev
polynomial different.
> But in literature (Mostly Image Processing) I see examples
in which they
> apply Chebychev polynomials on a uniform grid, an image for
example. And
> they use the scalar-product rules but now using the uniform
sampled
points.
> Now are my questions
> 1 Is this allowed? (I think the answer is no).
> 2 Can I overcome the grid-problem for the Chebyshev
polynomials?
> 3 There are a lot of other discrete orthogonal polynomials,
is
> there one in which I can directly use the points sampled on
the
> uniform grid?
>
> Maurice
You evidently havent looked at my class notes. Let me
STRONGLY suggest you
do--they should answer all your questions, including what to
do if the
grid or the weights (in the inner product) are non-uniform.
(In that case
you
can still define and use orthogonal polynomials. They are
called Gram poly-
nomials and are by far the best way to do high-order linear
least-squares
fits.
--
Julian V. Noble
Professor Emeritus of Physics
^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/
Science knows only one commandment: contribute to science.
-- Bertolt Brecht, Galileo.
===
Subject: Re: Information about Wavelet Analysis
> I am looking for information (book name internet source)
about Wavelet
analysis.
Try http://www.ondelette.com/
HTH
===
Subject: Re: poisson equation
>
> I am trying to solve poisson equation:
>
> diff(diff(u(y,z),y),y) + diff(diff(u(y,z),z),z) = 1
>
> using separation of variables method.
>
> The boundary conditions for the problem are:
>
> u(1,z)=0
> u(-1,z)=0
> u(y,1)=0
> u(y,-1)=0
>
> can you please guide me to a good reference which will help
me in
> solving this problem using separation of variables.
>
> Do you know how to solve this equation using mathematica
Try Mathews & Walker, Mathematical Methods of Physics for an
accessible introduction.
--
Julian V. Noble
Professor Emeritus of Physics
^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/
Science knows only one commandment: contribute to science.
-- Bertolt Brecht, Galileo.
===
Subject: Re: Books On Generalized Reduced Gradient Algorithm?
-Vik
===
Subject: [newbie] detecting singularity in matrices
The criterion SAS-IML uses for dectecting singular matrices
(in
functions meant for solving linear equations) is that, while
reducing
the orginal matrix to a triangular/diagonal form, all
elements less
than 100 x machine epsilon x A
(where A is largest element of the input matrix in absolute
value)
are zeroed.
What is the reason for this criterion? And why is the
constant 100
chosen?
gc
===
Subject: Re: Discrete Chebyshev (or other orthogonal)
polynomials.
>
> For my research I want to find out more about discete
Chebyshev
> polynomials of the first kind and their relation to
Chebyshev
> polynomials of the second kind.
> In literature a lot of properties of the Chebyshev
polynomials and the
> relations to other polynomials are known. But, afaik, all
these nice
> propertie are derived under the assumption that we want to
approach a
> continue function. I cannot find a list of properties in
case we want to
> approach a discrete set of equidistant spaced points with
these
polynomials.
> The description in Numerical Recipes for example also
assumes the the
> function is known at all locations.
> interesting words but nothing came out of it.
>
Regarding discrete orthogonal polynomials , see the monograph
[1] A.F. NIKIFOROV , S.K. SUSLOV , V.B. UVAROV ,
,, Classical Polynomials of a Discrete Variable ,
Springer Series in Computational Physics , Springer-Verlag
,1991.
In this book there are a lot of interesting facts about the
case when
the ,,mesh is uniform, that is when we suppose that points are
equidistant.
There are also many references regarding applications, for
instance in
Physics.
For general properties of (continuous) Chebychev polynomials,
see
[2] Theodore J. RIVLIN , ,,The Chebyshev Polynomials , Wiley -
Interscience , 1974 .
===
Subject: Czy ktos wie jak sie tworzy diagramy krat???
Pozdrawiam
Justyna
===
Subject: positive definite ?=> diagonally dominant?
Can positive definite results in diagonally dominant? Are
there any
===
Subject: Re: positive definite ?=> diagonally dominant?
> Can positive definite results in diagonally dominant? Are
there any
Linear finite elements on a Poisson problem gives diagonally
dominant pd
matrices; higher order elements are still pd but not
diagonally
dominant.
V.
===
Subject: positive definite matrix
Is the diagonal element of a positive definite matrix the
bigest one
comparing with others in the same roe? that is, is a_{ii} >=
|a_{ij}|?
===
Subject: Re: positive definite matrix
>
> Is the diagonal element of a positive definite matrix the
bigest one
> comparing with others in the same roe? that is, is a_{ii}
>= |a_{ij}|?
Not in general, A=[1 2;2 4].
Yes for Hermitian matrices with constant diagonal, since the
determinant of every principal 2x2 minor is nonnegative.
Arnold Neumaier
===
Subject: Re: positive definite matrix
> Is the diagonal element of a positive definite matrix the
bigest one
> comparing with others in the same roe? that is, is a_{ii}
>= |a_{ij}|?
Take the matrix A=
(2 3)
(0 2)
This is positive definite, since
(x,y)*A*(x,y)^T=2*(x+3y/4)^2+7y^2/8>0