Message Boards Message Boards

0
|
4106 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Fixing a FindRoot error - what does it mean?

Hi everyone,

I do hope someone will be able to help me.  I have some density function of which I want to calculate some percentage points for arbitrary parameters.  I want to do this in Mathematica - with using the function "FindRoot".  It does however give me the following error:

"FindRoot::nlnum: "The function value {False} is not a list of numbers with dimensions {1} at {z} = {1.`}."

I don't even know where to start to look for a solution!  The code that I am using have been used by myself before, but only know it is giving me a problem.  Any thoughts?  Code attached in the Mathematica .nb file.

What the program is supposed to do:

There is a defined density funciton, called WGen.  It is a univariate function of z, with 5 parameters (n1, n2, r, rho, th1 and th2).

This density function's integral up to some point z is then calculated to "mimic" its distribution function (CDF).
Then, the function "h" is defined as the CDF minus the critical point - and this function is then solved for = 0 (effectively solving CDF = p).  I wish to get the value of z which will result in the CDF being equal to p.

Thanks guys, I'll really appreciate any constructive thoughts.  I'm not that well aquainted with Mathematica so I'm also still learning.
Attachments:
POSTED BY: Johan Ferreira
The reason for the error is that h[10, 12, 2, 0.5, 3, 5, 0.01, z] (where z does not have a numerical value) returns a ConditionalExpression. Try something like
In[8]:= cdf[n1_, n2_, r_, rho_, th1_, th2_, z_] :=
   Integrate[WGen[n1, n2, r, rho, th1, th2, t], {t, 0, z}, Assumptions -> z > 0]

In[9]:= FindRoot[h[10, 12, 2, 0.5, 3, 5, 0.01, z] == 0, {z, 1}]

Out[9]= {z -> 0.178494}
POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract