StatsDIPTest

Hi,
I would like to apply the StatsDIPTest on my membrane potential values, different waves. I can get the V_Value but somehow I've problem to run the simulation to get the critical value.
Thanks,
Hello Marti,

It is difficult to give you a specific answer when you describe the problem as "somehow". I assume from your question that you have tried the function provided in the documentation, i.e., that you copied the code, pasted it in your procedure window and executed the function. For example, suppose you want to find the critical values for an alpha of 0.05 and suppose your data consisted of 100 points. You can get the critical value by executing:

print getCriticalValue(100,0.05)

This should be fairly straightforward. Please let us know if the difficulties were elsewhere.

A.G.
WaveMetrics, Inc.
Hi,
Thanks. Yes I did exactly in the way as you described I copied the code in the procedure window.
Now I tried with your example and it works.
1) The only difference is,that in my case that my sample size is 929031 so I changed in the code N=1000000 and
for(i=0;i<1000000;i+=1)
but the software freeze...

2) When I tried to execute the function previously I used the data browser, selected the required wave and pressed the Execute Cmd but the code didn't worked in that way.

thanks,

quote=Igor]Hello Marti,

It is difficult to give you a specific answer when you describe the problem as "somehow". I assume from your question that you have tried the function provided in the documentation, i.e., that you copied the code, pasted it in your procedure window and executed the function. For example, suppose you want to find the critical values for an alpha of 0.05 and suppose your data consisted of 100 points. You can get the critical value by executing:

print getCriticalValue(100,0.05)

This should be fairly straightforward. Please let us know if the difficulties were elsewhere.

A.G.
WaveMetrics, Inc.[/quote]
Marti wrote:

Thanks. Yes I did exactly in the way as you described I copied the code in the procedure window.
Now I tried with your example and it works.
1) The only difference is,that in my case that my sample size is 929031 so I changed in the code N=1000000 and
for(i=0;i<1000000;i+=1)
but the software freeze...


I think you missed the entire point of using the function. You should not be editing the code of the function -- you should only change the parameters that you are passing it. Specifically replace the 100 of my example with 929031. Your command would look like:

print getCriticalValue(929031,0.05)

and will probably take about two weeks to execute because you have a very large number of points in your wave. Although this may not be ideal, I would recommend trying the following:
Function getCriticalValueSz(sampleSize,alpha,simSize)
Variable sampleSize,alpha,simSize
   
    Make/O/N=(simSize)  dipResults
    multithread dipResults=getDipTrial(sampleSize)
    Histogram/P/B=4 dipResults               
    Wave W_Histogram
    Integrate/METH=1 W_Histogram/D=W_INT     
    Findlevel/Q  W_int,(1-alpha)             
    return V_LevelX
End

ThreadSafe Function getDipTrial(sampleSize)
    Variable sampleSize
   
    Make/FREE/O/N=(sampleSize) dataWave=enoise(100)
    StatsDipTest dataWave
    return V_Value
End


Now to get an idea about execution time you should start with 100 and increase to get better approximation of the critical value:
Print getCriticalValueSz(929031,0.05,100)  // I get   0.000568077


Quote:

2) When I tried to execute the function previously I used the data browser, selected the required wave and pressed the Execute Cmd but the code didn't worked in that way.

I'm not sure why you are trying to use the Data Browser here. Simply execute the command on the command line as I outlined above.

A.G.