Re: strange behavior of quad ?
- From: John D'Errico <woodchips@xxxxxxxxxxxxxxxx>
- Date: Mon, 24 Apr 2006 19:56:49 GMT
In article <e2j8kh$4rc$1@xxxxxxxxxxxxxxxxxxxxxxxxx>, "Gg" <nc-schuetes@xxxxxxxxxxxxx> wrote:
Dear All,
I am trying to do some analysis involving lognormal (and other)
distributions which often involves indefinite integrals (i.e. integrals with
limits -inf and/or +inf).
I was trying to do this like
quadl(@(x)(lognpdf(x,1,2)),lowlim, hilim)
(snip example)
Question:
- Is it fair to say that the implementation of quad and quadl is somewhat
crummy, since it gives us wrong answers without warning ?
- Is there a better way to compute those indefinite integrals ? Especially
considering the fact that I know beforehand that all integrals will
converge.
Note that it might be possible to come up with more or less ingenious ways
to "preprocess" the integrals, so that quad or quadl might work. But
generally my integrands will be more complicated than logn. In addition I
would like to program something generic, which does not require intelligent
intervention.
Thank you for any hints and help
gg
Congratulations! This is the millionth time your question
has been asked! You win an all expenses paid virtual tour
of the internet.
No, quad is not crummy because it does not succeed. Quad
is an adaptive (numerical) quadrature rule. Any such rule
can be caused to fail by someone who chooses their functions
artfully. Numerical computation is sometimes more of a craft
than a science. The craft is in how to make a computational
tool provide the correct answers rapidly while working in
floating point arithmetic.
HTH,
John D'Errico
--
The best material model of a cat is another, or preferably the same, cat.
A. Rosenblueth, Philosophy of Science, 1945
Those who can't laugh at themselves leave the job to others.
Anonymous
.
- References:
- strange behavior of quad ?
- From: Gg
- strange behavior of quad ?
- Prev by Date: Re: Matlab R14 7.1 and 2006a 7.2 both crash at filter() command
- Next by Date: How to find information about a signal in simulink
- Previous by thread: strange behavior of quad ?
- Next by thread: Re: strange behavior of quad ?
- Index(es):
Relevant Pages
|
Loading