[gnumeric] fn-stat: introduce OWENT.



commit d7a0c86ec0e35765b57ad48893860876d7590f1c
Author: Morten Welinder <terra gnome org>
Date:   Fri Apr 5 13:08:14 2013 -0400

    fn-stat: introduce OWENT.
    
    We had the code; this just exposes the function to users.

 NEWS                          |    3 +-
 doc/C/func.defs               |   50 +++++++++++++-
 doc/C/functions.xml           |  150 ++++++++++++++++++++++++++++++++++++++++-
 plugins/fn-stat/functions.c   |   23 ++++++
 plugins/fn-stat/plugin.xml.in |   19 +++---
 5 files changed, 231 insertions(+), 14 deletions(-)
---
diff --git a/NEWS b/NEWS
index 94f7ba0..2b696a2 100644
--- a/NEWS
+++ b/NEWS
@@ -22,7 +22,8 @@ Morten:
        * Make it easier to see what sheet is selected.  [#659317]
        * Implement R.PST, R.QST, and R.QSNORM.
        * Fix dependency tabulation.
-       * FIx problems with R.PSNORM.  [#697293]
+       * Fix problems with R.PSNORM.  [#697293]
+       * New function OWENT.
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.1
diff --git a/doc/C/func.defs b/doc/C/func.defs
index d87e182..a295076 100644
--- a/doc/C/func.defs
+++ b/doc/C/func.defs
@@ -4866,6 +4866,14 @@ If the data set does not contain any duplicates this function returns a #N/A err
 @SEEALSO=NORMDIST,NORMINV,NORMSDIST,STANDARDIZE,ZTEST
 
 @CATEGORY=Statistics
+ FUNCTION=OWENT
+ SHORTDESC=Owen's T function
+ SYNTAX=OWENT(h,a)
+ ARGUMENTDESCRIPTION=@{h}: number
+ {a}: number
+ SEEALSO=R PSNORM,R.PST
+
+ CATEGORY=Statistics
 @FUNCTION=PARETO
 @SHORTDESC=probability density function of the Pareto distribution
 @SYNTAX=PARETO(x,a,b)
@@ -5108,7 +5116,7 @@ If the data set does not contain any duplicates this function returns a #N/A err
 @{scale}: the scale parameter of the distribution
 @{give_log}: if true, log of the result will be returned instead
 @DESCRIPTION=This function returns the probability density function of the skew-normal distribution.
- SEEALSO=R PSNORM
+ SEEALSO=R PSNORM,R.QSNORM
 
 @CATEGORY=Statistics
 @FUNCTION=R.DST
@@ -5119,6 +5127,7 @@ If the data set does not contain any duplicates this function returns a #N/A err
 @{shape}: the shape parameter of the distribution
 @{give_log}: if true, log of the result will be returned instead
 @DESCRIPTION=This function returns the probability density function of the skew-t distribution.
+ SEEALSO=R PST,R.QST
 
 @CATEGORY=Statistics
 @FUNCTION=R.DT
@@ -5306,7 +5315,19 @@ If the data set does not contain any duplicates this function returns a #N/A err
 @{lower_tail}: if true (the default), the lower tail of the distribution is considered
 @{log_p}: if true, log of the probability is used
 @DESCRIPTION=This function returns the cumulative distribution function of the skew-normal distribution.
- SEEALSO=R DSNORM
+ SEEALSO=R DSNORM,R.QSNORM
+
+ CATEGORY=Statistics
+ FUNCTION=R PST
+ SHORTDESC=cumulative distribution function of the skew-t distribution
+ SYNTAX=R PST(x,n,shape,lower_tail,log_p)
+ ARGUMENTDESCRIPTION=@{x}: observation
+ {n}: the number of degrees of freedom of the distribution
+ {shape}: the shape parameter of the distribution
+ {lower_tail}: if true (the default), the lower tail of the distribution is considered
+ {log_p}: if true, log of the probability is used
+ DESCRIPTION=This function returns the cumulative distribution function of the skew-t distribution.
+ SEEALSO=R DST,R.QST
 
 @CATEGORY=Statistics
 @FUNCTION=R.PT
@@ -5486,6 +5507,31 @@ If the data set does not contain any duplicates this function returns a #N/A err
 @SEEALSO=R.DPOIS,R.PPOIS
 
 @CATEGORY=Statistics
+ FUNCTION=R QSNORM
+ SHORTDESC=probability quantile function of the skew-normal distribution
+ SYNTAX=R QSNORM(p,shape,location,scale,lower_tail,log_p)
+ ARGUMENTDESCRIPTION=@{p}: probability
+ {shape}: the shape parameter of the distribution
+ {location}: the location parameter of the distribution
+ {scale}: the scale parameter of the distribution
+ {lower_tail}: if true (the default), the lower tail of the distribution is considered
+ {log_p}: if true, log of the probability is used
+ DESCRIPTION=This function returns the probability quantile function, i.e., the inverse of the cumulative 
distribution function, of the skew-normal distribution.
+ SEEALSO=R DSNORM,R.PSNORM
+
+ CATEGORY=Statistics
+ FUNCTION=R QST
+ SHORTDESC=probability quantile function of the skew-t distribution
+ SYNTAX=R QST(p,n,shape,lower_tail,log_p)
+ ARGUMENTDESCRIPTION=@{p}: probability
+ {n}: the number of degrees of freedom of the distribution
+ {shape}: the shape parameter of the distribution
+ {lower_tail}: if true (the default), the lower tail of the distribution is considered
+ {log_p}: if true, log of the probability is used
+ DESCRIPTION=This function returns the probability quantile function, i.e., the inverse of the cumulative 
distribution function, of the skew-t distribution.
+ SEEALSO=R DST,R.PST
+
+ CATEGORY=Statistics
 @FUNCTION=R.QT
 @SHORTDESC=probability quantile function of the Student t distribution
 @SYNTAX=R.QT(p,n,lower_tail,log_p)
diff --git a/doc/C/functions.xml b/doc/C/functions.xml
index a91144e..3737fa8 100644
--- a/doc/C/functions.xml
+++ b/doc/C/functions.xml
@@ -16844,6 +16844,35 @@
       </para>
       </refsect1>
     </refentry>
+    <refentry id="gnumeric-function-OWENT">
+      <refmeta>
+        <refentrytitle>
+          <function>OWENT</function>
+        </refentrytitle>
+      </refmeta>
+      <refnamediv>
+        <refname>
+          <function>OWENT</function>
+        </refname>
+        <refpurpose>
+        Owen's T function
+      </refpurpose>
+      </refnamediv>
+      <refsynopsisdiv>
+        <synopsis><function>OWENT</function>(<parameter>h</parameter>,<parameter>a</parameter>)</synopsis>
+      </refsynopsisdiv>
+      <refsect1>
+        <title>Arguments</title>
+        <para><parameter>h</parameter>: number</para>
+        <para><parameter>a</parameter>: number</para>
+      </refsect1>
+      <refsect1>
+        <title>See also</title>
+        <para><link linkend="gnumeric-function-R.PSNORM"><function>R.PSNORM</function></link>,
+        <link linkend="gnumeric-function-R.PST"><function>R.PST</function></link>.
+      </para>
+      </refsect1>
+    </refentry>
     <refentry id="gnumeric-function-PARETO">
       <refmeta>
         <refentrytitle>
@@ -17665,7 +17694,8 @@
       </refsect1>
       <refsect1>
         <title>See also</title>
-        <para><link linkend="gnumeric-function-R.PSNORM"><function>R.PSNORM</function></link>.
+        <para><link linkend="gnumeric-function-R.PSNORM"><function>R.PSNORM</function></link>,
+        <link linkend="gnumeric-function-R.QSNORM"><function>R.QSNORM</function></link>.
       </para>
       </refsect1>
     </refentry>
@@ -17697,6 +17727,12 @@
         <title>Description</title>
         <para>This function returns the probability density function of the skew-t distribution.</para>
       </refsect1>
+      <refsect1>
+        <title>See also</title>
+        <para><link linkend="gnumeric-function-R.PST"><function>R.PST</function></link>,
+        <link linkend="gnumeric-function-R.QST"><function>R.QST</function></link>.
+      </para>
+      </refsect1>
     </refentry>
     <refentry id="gnumeric-function-R.DT">
       <refmeta>
@@ -18268,7 +18304,44 @@
       </refsect1>
       <refsect1>
         <title>See also</title>
-        <para><link linkend="gnumeric-function-R.DSNORM"><function>R.DSNORM</function></link>.
+        <para><link linkend="gnumeric-function-R.DSNORM"><function>R.DSNORM</function></link>,
+        <link linkend="gnumeric-function-R.QSNORM"><function>R.QSNORM</function></link>.
+      </para>
+      </refsect1>
+    </refentry>
+    <refentry id="gnumeric-function-R.PST">
+      <refmeta>
+        <refentrytitle>
+          <function>R.PST</function>
+        </refentrytitle>
+      </refmeta>
+      <refnamediv>
+        <refname>
+          <function>R.PST</function>
+        </refname>
+        <refpurpose>
+        cumulative distribution function of the skew-t distribution
+      </refpurpose>
+      </refnamediv>
+      <refsynopsisdiv>
+        
<synopsis><function>R.PST</function>(<parameter>x</parameter>,<parameter>n</parameter>,<parameter>shape</parameter>,<parameter>lower_tail</parameter>,<parameter>log_p</parameter>)</synopsis>
+      </refsynopsisdiv>
+      <refsect1>
+        <title>Arguments</title>
+        <para><parameter>x</parameter>: observation</para>
+        <para><parameter>n</parameter>: the number of degrees of freedom of the distribution</para>
+        <para><parameter>shape</parameter>: the shape parameter of the distribution</para>
+        <para><parameter>lower_tail</parameter>: if true (the default), the lower tail of the distribution 
is considered</para>
+        <para><parameter>log_p</parameter>: if true, log of the probability is used</para>
+      </refsect1>
+      <refsect1>
+        <title>Description</title>
+        <para>This function returns the cumulative distribution function of the skew-t distribution.</para>
+      </refsect1>
+      <refsect1>
+        <title>See also</title>
+        <para><link linkend="gnumeric-function-R.DST"><function>R.DST</function></link>,
+        <link linkend="gnumeric-function-R.QST"><function>R.QST</function></link>.
       </para>
       </refsect1>
     </refentry>
@@ -18812,6 +18885,79 @@
       </para>
       </refsect1>
     </refentry>
+    <refentry id="gnumeric-function-R.QSNORM">
+      <refmeta>
+        <refentrytitle>
+          <function>R.QSNORM</function>
+        </refentrytitle>
+      </refmeta>
+      <refnamediv>
+        <refname>
+          <function>R.QSNORM</function>
+        </refname>
+        <refpurpose>
+        probability quantile function of the skew-normal distribution
+      </refpurpose>
+      </refnamediv>
+      <refsynopsisdiv>
+        
<synopsis><function>R.QSNORM</function>(<parameter>p</parameter>,<parameter>shape</parameter>,<parameter>location</parameter>,<parameter>scale</parameter>,<parameter>lower_tail</parameter>,<parameter>log_p</parameter>)</synopsis>
+      </refsynopsisdiv>
+      <refsect1>
+        <title>Arguments</title>
+        <para><parameter>p</parameter>: probability</para>
+        <para><parameter>shape</parameter>: the shape parameter of the distribution</para>
+        <para><parameter>location</parameter>: the location parameter of the distribution</para>
+        <para><parameter>scale</parameter>: the scale parameter of the distribution</para>
+        <para><parameter>lower_tail</parameter>: if true (the default), the lower tail of the distribution 
is considered</para>
+        <para><parameter>log_p</parameter>: if true, log of the probability is used</para>
+      </refsect1>
+      <refsect1>
+        <title>Description</title>
+        <para>This function returns the probability quantile function, i.e., the inverse of the cumulative 
distribution function, of the skew-normal distribution.</para>
+      </refsect1>
+      <refsect1>
+        <title>See also</title>
+        <para><link linkend="gnumeric-function-R.DSNORM"><function>R.DSNORM</function></link>,
+        <link linkend="gnumeric-function-R.PSNORM"><function>R.PSNORM</function></link>.
+      </para>
+      </refsect1>
+    </refentry>
+    <refentry id="gnumeric-function-R.QST">
+      <refmeta>
+        <refentrytitle>
+          <function>R.QST</function>
+        </refentrytitle>
+      </refmeta>
+      <refnamediv>
+        <refname>
+          <function>R.QST</function>
+        </refname>
+        <refpurpose>
+        probability quantile function of the skew-t distribution
+      </refpurpose>
+      </refnamediv>
+      <refsynopsisdiv>
+        
<synopsis><function>R.QST</function>(<parameter>p</parameter>,<parameter>n</parameter>,<parameter>shape</parameter>,<parameter>lower_tail</parameter>,<parameter>log_p</parameter>)</synopsis>
+      </refsynopsisdiv>
+      <refsect1>
+        <title>Arguments</title>
+        <para><parameter>p</parameter>: probability</para>
+        <para><parameter>n</parameter>: the number of degrees of freedom of the distribution</para>
+        <para><parameter>shape</parameter>: the shape parameter of the distribution</para>
+        <para><parameter>lower_tail</parameter>: if true (the default), the lower tail of the distribution 
is considered</para>
+        <para><parameter>log_p</parameter>: if true, log of the probability is used</para>
+      </refsect1>
+      <refsect1>
+        <title>Description</title>
+        <para>This function returns the probability quantile function, i.e., the inverse of the cumulative 
distribution function, of the skew-t distribution.</para>
+      </refsect1>
+      <refsect1>
+        <title>See also</title>
+        <para><link linkend="gnumeric-function-R.DST"><function>R.DST</function></link>,
+        <link linkend="gnumeric-function-R.PST"><function>R.PST</function></link>.
+      </para>
+      </refsect1>
+    </refentry>
     <refentry id="gnumeric-function-R.QT">
       <refmeta>
         <refentrytitle>
diff --git a/plugins/fn-stat/functions.c b/plugins/fn-stat/functions.c
index d3a50ea..4b69ca0 100644
--- a/plugins/fn-stat/functions.c
+++ b/plugins/fn-stat/functions.c
@@ -487,6 +487,26 @@ gnumeric_normsinv (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 
 /***************************************************************************/
 
+static GnmFuncHelp const help_owent[] = {
+       { GNM_FUNC_HELP_NAME, F_("OWENT:Owen's T function")},
+       { GNM_FUNC_HELP_ARG, F_("h:number")},
+       { GNM_FUNC_HELP_ARG, F_("a:number")},
+       { GNM_FUNC_HELP_EXAMPLES, "=OWENT(0.1,11)" },
+       { GNM_FUNC_HELP_SEEALSO, "R.PSNORM,R.PST"},
+       { GNM_FUNC_HELP_END }
+};
+
+static GnmValue *
+gnumeric_owent (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
+{
+        gnm_float h = value_get_as_float (argv[0]);
+        gnm_float a = value_get_as_float (argv[1]);
+
+       return value_new_float (gnm_owent (h, a));
+}
+
+/***************************************************************************/
+
 static GnmFuncHelp const help_lognormdist[] = {
        { GNM_FUNC_HELP_NAME, F_("LOGNORMDIST:cumulative distribution function of the lognormal 
distribution")},
        { GNM_FUNC_HELP_ARG, F_("x:number")},
@@ -5143,6 +5163,9 @@ GnmFuncDescriptor const stat_functions[] = {
        { "normsinv",     "f",
          help_normsinv, gnumeric_normsinv, NULL, NULL, NULL,
          GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_COMPLETE, GNM_FUNC_TEST_STATUS_BASIC },
+       { "owent",    "ff",
+         help_owent, gnumeric_owent, NULL, NULL, NULL,
+         GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_UNIQUE_TO_GNUMERIC, GNM_FUNC_TEST_STATUS_NO_TESTSUITE },
         { "pearson",      "AA",
          help_pearson, gnumeric_pearson, NULL, NULL, NULL,
          GNM_FUNC_SIMPLE, GNM_FUNC_IMPL_STATUS_COMPLETE, GNM_FUNC_TEST_STATUS_BASIC },
diff --git a/plugins/fn-stat/plugin.xml.in b/plugins/fn-stat/plugin.xml.in
index b8b1f5f..c66c023 100644
--- a/plugins/fn-stat/plugin.xml.in
+++ b/plugins/fn-stat/plugin.xml.in
@@ -25,20 +25,17 @@
                                <function name="chiinv"/>
                                <function name="chitest"/>
                                <function name="confidence"/>
+                               <function name="correl"/>
                                <function name="count"/>
                                <function name="counta"/>
-                               <function name="critbinom"/>
-                               <function name="cronbach"/>
-                               <function name="correl"/>
                                <function name="covar"/>
                                <function name="covariance.s"/>
+                               <function name="critbinom"/>
+                               <function name="cronbach"/>
                                <function name="cvmtest"/>
                                <function name="devsq"/>
-                               <function name="exppowdist"/>
-                               <function name="permut"/>
-                               <function name="permutationa"/>
-                               <function name="poisson"/>
                                <function name="expondist"/>
+                               <function name="exppowdist"/>
                                <function name="fdist"/>
                                <function name="finv"/>
                                <function name="fisher"/>
@@ -48,8 +45,8 @@
                                <function name="ftest"/>
                                <function name="gammadist"/>
                                <function name="gammainv"/>
-                               <function name="geomean"/>
                                <function name="geomdist"/>
+                               <function name="geomean"/>
                                <function name="growth"/>
                                <function name="harmean"/>
                                <function name="hypgeomdist"/>
@@ -79,10 +76,14 @@
                                <function name="norminv"/>
                                <function name="normsdist"/>
                                <function name="normsinv"/>
+                               <function name="owent"/>
                                <function name="pareto"/>
+                               <function name="pearson"/>
                                <function name="percentile"/>
                                <function name="percentrank"/>
-                               <function name="pearson"/>
+                               <function name="permut"/>
+                               <function name="permutationa"/>
+                               <function name="poisson"/>
                                <function name="prob"/>
                                <function name="quartile"/>
                                <function name="rank"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]