Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: error message and speed
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
H.J. Wang

Posts: 12
Registered: 12/7/04
error message and speed
Posted: Sep 25, 1997 1:11 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I have two questions about Mma 3.0 and its comparison with
V.2.2.2, and I'd appreciate very much if someone can give me a hint
of what's going on. (operating system: Win95)

The first question is that when I evaluated the following in
Mma 3.0 with the two lines in the same cell and next to each other, I
got a warning message that doesn't make sense.

===============================================
In[1]:=
<<Statistics`ContinuousDistributions`;
ldist = LogNormalDistribution[m,s];

LogNormalDistribution::"shdw":
Symbol LogNormalDistribution appears in multiple contexts
{Statistics`ContinuousDistributions`, Global`};
definitions in context
Statistics`ContinuousDistributions` may shadow or
be shadowed by other definitions.
=================================================

As a consequence the statistical properties of LogNormal are not
available, and functions such as PDF[ldist,W] does not return the
density function. This erroneous behavior does not happen when the
two lines are separated into two individual cells.

WHY DOES THIS HAPPEN?

My second question is about the speed. I evaluated the
following
commands in Mma 3.0 and 2.2.2, and found 3.0 is very, very slow in
evaluating the last function involving an integral. Indeed, it took
Mma 3.0 85.14 seconds to finish while took only 2.294 seconds for
V.2.2.2. Since I use this type of functions frequently, I'd like to
know why this happens and how to improve it.

Thanks in advance!

H.J. Wang

==========================
<<Statistics`ContinuousDistributions`;

ldist = LogNormalDistribution[m,s];

logpdf[W_] = PDF[ldist, W];

A1 = (e + b (1+r) - (1-ei) Y2 )/(1+c);

U[X_,L_] = Log[X] - ua L^ub;

funEU[e_,b_,r_,c_,i_,rho_,n1_,n2_,ei_,w_,m_,s_,Integrate_]=
Integrate[ U[ W (1-c)+ei Y2,n2] logpdf[W], {W,0,e}];
=================================





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.