MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

error message and speed

  • To: mathgroup at smc.vnet.net
  • Subject: [mg8792] error message and speed
  • From: "H.J. Wang" <hungjen at umich.edu>
  • Date: Thu, 25 Sep 1997 12:26:27 -0400
  • Organization: University of Michigan
  • Sender: owner-wri-mathgroup at wolfram.com

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}];
=================================


  • Prev by Date: FindRoot
  • Next by Date: Re: Sound Recording
  • Previous by thread: FindRoot
  • Next by thread: Re: error message and speed