Re: error using 'betainc' function

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Feb 06 2012 - 07:13:55 MST

The errors are telling you that you have bad input values.
The betainc documentation:
   http://www.ncl.ucar.edu/Document/Functions/Built-in/betainc.shtml
states that the 1st argument must be between (0,1). The other
arguments must be > 0.0

Use print statements. EG
   print("df1="+df1)
   print("tval1="+tval1)
   print("df1/(df1+tval1^2)="+df1/(df1+tval1^2))

On 2/3/12 4:35 PM, liuliuna wrote:
> Hi,
>
> I want to do significance test about my regression results.
>
> But when I used the function 'betainc', some error happened.
>
> My codes:
> ;****************************************
> ;student t probability shaded 0.05
> ;***************************************8
> tval1 = onedtond(rec1@tval,dimsizes(rec1))
> df1 = onedtond(rec1@nptxy,dimsizes(rec1))/11-1
> b1 = tval1
> b1=0.5
>
> prob1 = betainc(df1/(df1+tval1^2),df1/2.0,b1)
> copy_VarMeta(sst(0,:,:),prob1)
>
> tval2 = onedtond(rec2@tval,dimsizes(rec2))
> df2 = onedtond(rec2@nptxy,dimsizes(rec2))/11-1
> b2 = tval2
> b2=0.5
> prob2 = betainc(df2/(df2+tval2^2),df2/2.0,b2)
> copy_VarMeta(sst(0,:,:),prob2)
>
> The errors:
> ==>SLATEC/NCL: DBETAI: P AND/OR Q IS LE ZERO: NERR= 2 : LEVEL= 2
> ==>SLATEC/NCL: DLBETA: BOTH ARGUMENTS MUST BE GT ZERO: NERR= 1 : LEVEL= 2
> ==>SLATEC/NCL: DGAMMA: X IS 0: NERR= 4 : LEVEL= 2
>
> Anyone know how to solve it?
>
> Thanks.
>
> Edith
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Feb 6 07:14:06 2012

This archive was generated by hypermail 2.1.8 : Mon Feb 06 2012 - 14:24:56 MST