Choose Language Hide Translation Bar
olithun
New Contributor

Calculating roots of a function

Hi everyone,

How do I calculate the roots of a  function in JSL for confidence intervals?

I have a special case, where I need to calculate confidence Intervals which aren't implemented in JMP.

Using the Wilks theorem, I want to calculate confidence intervalls by calculating the roots of the following function:

 

f(x)=-2log(Likelihood(x|Data))-ChiSquare Quantile( 1-alpha, 1).

Where x is a real number and the Data is a univariate sample

 

Is there any build in JSL function I can use? Or at least something similar?

I couldn`t find anything on the web or in the scripting index.

 

I would really appreciate some suggestions.

Thanks in advance

 

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Calculating roots of a function

See Help about the Minimize() function. Your expression is Abs( -2log(Likelihood(x|Data))-ChiSquare Quantile( 1-alpha, 1) ). This numerical optimization should be able to solve for the roots. The easiest way would be to use a Script Editor. Select File > New > Script. Right-click and select Show Embedded Log. This way the result of the function call will be shown in the same window.

Learn it once, use it forever!

View solution in original post

2 REPLIES 2
Highlighted

Re: Calculating roots of a function

See Help about the Minimize() function. Your expression is Abs( -2log(Likelihood(x|Data))-ChiSquare Quantile( 1-alpha, 1) ). This numerical optimization should be able to solve for the roots. The easiest way would be to use a Script Editor. Select File > New > Script. Right-click and select Show Embedded Log. This way the result of the function call will be shown in the same window.

Learn it once, use it forever!

View solution in original post

Highlighted
olithun
New Contributor

Re: Calculating roots of a function

Thanks for the answer,

the Minimize function seems to be seems to be a little unstable in extreme situations.

However, your tip gave me a good starting point to come up with a solution.

 

 

0 Kudos