1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> 2 3<!--Converted with LaTeX2HTML 2018.3 (Released July 19, 2018) --> 4<HTML lang="EN"> 5<HEAD> 6<TITLE>compute_statistics*</TITLE> 7<META NAME="description" CONTENT="compute_statistics*"> 8<META NAME="keywords" CONTENT="subroutines"> 9<META NAME="resource-type" CONTENT="document"> 10<META NAME="distribution" CONTENT="global"> 11 12<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 13<META NAME="viewport" CONTENT="width=device-width, initial-scale=1.0"> 14<META NAME="Generator" CONTENT="LaTeX2HTML v2018.3"> 15 <link rel='apple-touch-icon' sizes='180x180' href='images/favicons/apple-touch-icon.png?v=2017'> 16 <link rel='icon' type='image/png' sizes='32x32' href='images/favicons/favicon-32x32.png?v=2017'> 17 <link rel='icon' type='image/png' sizes='16x16' href='images/favicons/favicon-16x16.png?v=2017'> 18 <link rel='manifest' href='images/favicons/manifest.json?v=2017'> 19 <link rel='mask-icon' href='images/favicons/safari-pinned-tab.svg?v=2017' color='#5bbad5'> 20 <link rel='shortcut icon' href='images/favicons/favicon.ico?v=2017'> 21 <meta name='apple-mobile-web-app-title' content='HEALPix'> 22 <meta name='application-name' content='HEALPix'> 23 <meta name='msapplication-config' content='images/favicons/browserconfig.xml?v=2017'> 24 <meta name='theme-color' content='#ffffff'> 25 26<LINK REL="STYLESHEET" HREF="subroutines.css"> 27 28<LINK REL="next" HREF="sub_concatnl.htm"> 29<LINK REL="previous" HREF="sub_complex_fft.htm"> 30<LINK REL="next" HREF="sub_concatnl.htm"> 31</HEAD> 32 33<body text="#000000" bgcolor="#FFFFFA"> 34 35<DIV CLASS="navigation"><!--Navigation Panel--> 36<A 37 HREF="sub_complex_fft.htm"> 38<IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A> 39<A 40 HREF="sub_HEALPix_F90_subroutines.htm"> 41<IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A> 42<A 43 HREF="sub_concatnl.htm"> 44<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A> 45<A ID="tex2html330" 46 HREF="sub_TABLE_CONTENTS.htm"> 47<IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A> 48<BR> 49<B> Previous:</B> <A 50 HREF="sub_complex_fft.htm">complex_fft</A> 51 52<B>Up:</B> <A 53 HREF="sub_HEALPix_F90_subroutines.htm">HEALPix/F90 subroutines</A> 54 55<B> Next:</B> <A 56 HREF="sub_concatnl.htm">concatnl</A> 57<B> Top:</B> <a href="main.htm">Main Page</a></DIV> 58<!--End of Navigation Panel--> 59 60<H1><A ID="SECTION1900"></A> 61<A ID="sub:compute_statistics"></A> 62<BR> 63 64</H1> 65 66<P> 67 68<P> 69<b><font size=+6><FONT COLOR="#CC0000">compute_statistics*</FONT></font></b><hr> 70<H3>This routine computes the min, max, absolute deviation and first four order moment of a data set</H3> 71Location in HEALPix directory tree: <a href="https://sourceforge.net/p/healpix/code/1005/tree/trunk/src/f90/mod/statistics.f90"><b>src/f90/mod/statistics.f90</b></a> 72 73<P> 74<hr><h1>FORMAT </h1><blockquote><h3>call <FONT COLOR="#CC0000">compute_statistics*</FONT>( 75<A HREF="#sub:compute_statistics:data">data</A>,<A HREF="#sub:compute_statistics:stats">stats</A><i><font color="#224422">[, <A HREF="#sub:compute_statistics:badval">badval</A>]</font></i> 76)</h3></blockquote> 77Arguments appearing in <i><font color="#224422">italic</font></i> are 78optional. 79 80<P> 81<hr><H1>ARGUMENTS</H1> 82 83<TABLE CELLPADDING=3 BORDER="1"> 84<TR><TH ALIGN="LEFT" VALIGN="TOP" WIDTH=150><SPAN CLASS="textbf">name & dimensionality</SPAN></TH> 85<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=25><SPAN CLASS="textbf">kind</SPAN></TH> 86<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=25><SPAN CLASS="textbf">in/out</SPAN></TH> 87<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=250><SPAN CLASS="textbf">description</SPAN></TH> 88</TR> 89<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150> </TD> 90<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25> </TD> 91<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25> </TD> 92<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250> </TD> 93</TR> 94<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150> 95data<A ID="sub:compute_statistics:data"></A>(:)</TD> 96<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>SP/ DP</TD> 97<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>IN</TD> 98<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>data set <SPAN CLASS="MATH">{x<SUB><i>i</i></SUB>}</SPAN></TD> 99</TR> 100<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>stats<A ID="sub:compute_statistics:stats"></A></TD> 101<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>tstats</TD> 102<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>OUT</TD> 103<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>structure containing the statistics of the 104 data. The respective fields (stats%<EM>field</EM>) are:</TD> 105</TR> 106<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>ntot</TD> 107<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>I8B</TD> 108<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>-</TD> 109<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>total number of data points</TD> 110</TR> 111<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>nvalid</TD> 112<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>I8B</TD> 113<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>-</TD> 114<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>number <SPAN CLASS="MATH"><I>n</I></SPAN> of valid data points</TD> 115</TR> 116<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>mind, maxd</TD> 117<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>DP</TD> 118<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>-</TD> 119<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>minimum and maximum valid data</TD> 120</TR> 121<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>average</TD> 122<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>DP</TD> 123<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>-</TD> 124<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>average of valid points <!-- MATH 125 $m= \sum_i x_i / n$ 126 --> 127<SPAN CLASS="MATH"><IMG STYLE="height: 2.33ex; vertical-align: -0.68ex; " SRC="sub_img91.png" 128 ALT="$m= \sum_i x_i / n$"></SPAN></TD> 129</TR> 130<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>absdev</TD> 131<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>DP</TD> 132<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>-</TD> 133<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>absolute deviation <!-- MATH 134 $a= \sum_i|x_i-m|/n$ 135 --> 136<SPAN CLASS="MATH"><IMG STYLE="height: 2.33ex; vertical-align: -0.68ex; " SRC="sub_img92.png" 137 ALT="$a= \sum_i\vert x_i-m\vert/n$"></SPAN></TD> 138</TR> 139<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>var</TD> 140<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>DP</TD> 141<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>-</TD> 142<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>variance <!-- MATH 143 $\sigma^2 = \sum(x_i-m)^2/ (n-1)$ 144 --> 145<SPAN CLASS="MATH"><IMG STYLE="height: 2.45ex; vertical-align: -0.68ex; " SRC="sub_img93.png" 146 ALT="$\sigma^2 = \sum(x_i-m)^2/ (n-1)$"></SPAN></TD> 147</TR> 148<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>rms</TD> 149<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>DP</TD> 150<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>-</TD> 151<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>standard deviation <SPAN CLASS="MATH"><IMG STYLE="height: 1.11ex; vertical-align: -0.10ex; " SRC="sub_img94.png" 152 ALT="$\sigma$"></SPAN></TD> 153</TR> 154<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>skew</TD> 155<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>DP</TD> 156<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>-</TD> 157<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>skewness factor <!-- MATH 158 $s = \sum(x_i-m)^3 / (n\sigma^3)$ 159 --> 160<SPAN CLASS="MATH"><IMG STYLE="height: 2.45ex; vertical-align: -0.68ex; " SRC="sub_img95.png" 161 ALT="$s = \sum(x_i-m)^3 / (n\sigma^3)$"></SPAN></TD> 162</TR> 163<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150>kurt</TD> 164<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>DP</TD> 165<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>-</TD> 166<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>kurtosis factor <!-- MATH 167 $k = \sum(x_i-m)^4 / (n\sigma^4) - 3$ 168 --> 169<SPAN CLASS="MATH"><IMG STYLE="height: 2.45ex; vertical-align: -0.68ex; " SRC="sub_img96.png" 170 ALT="$k = \sum(x_i-m)^4 / (n\sigma^4) - 3$"></SPAN></TD> 171</TR> 172<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150> </TD> 173<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25> </TD> 174<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25> </TD> 175<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250> </TD> 176</TR> 177<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=150><i><font color="#224422">badval<A ID="sub:compute_statistics:badval"></A></font></i> (OPTIONAL)</TD> 178<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>SP/ DP</TD> 179<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>IN</TD> 180<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=250>sentinel value given to bad data points. Data points with this 181 value will be ignored during calculation of the statistics. If 182 not set, all points will be considered. <B>Do not set to 0!</B>.</TD> 183</TR> 184</TABLE> 185 186<P> 187<HR><H1>EXAMPLE:</H1> 188<tt>use statistics, only: compute_statistics, print_statistics, tstats 189<BR> 190type(tstats) :: stats 191<BR>... 192<BR> 193compute_statistics(map, stats) 194<BR> 195print*,stats%average, stats%rms 196<BR> 197print_statistics(stats) 198<BR></tt> 199<blockquote> 200Computes the statistics of <TT>map</TT>, prints its average and <EM>rms</EM> and 201prints the whole list of statistical measures. 202</blockquote> 203 204<P> 205<hr><H1>RELATED ROUTINES</H1><h3>This section lists the routines related to <b><FONT COLOR="#CC0000">compute_statistics*</FONT></b></h3> 206 207 <DL COMPACT><DT> 208<B><A HREF="sub_median.htm#sub:median">median</A></B> 209<DD>routine to compute median of a data set 210 </DL> 211 212<P> 213 214<P> 215 216 217<P> 218 219<P> 220 221<DIV CLASS="navigation"><HR> 222<!--Navigation Panel--> 223<A 224 HREF="sub_complex_fft.htm"> 225<IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A> 226<A 227 HREF="sub_HEALPix_F90_subroutines.htm"> 228<IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A> 229<A 230 HREF="sub_concatnl.htm"> 231<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A> 232<A ID="tex2html330" 233 HREF="sub_TABLE_CONTENTS.htm"> 234<IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A> 235<BR> 236<B> Previous:</B> <A 237 HREF="sub_complex_fft.htm">complex_fft</A> 238 239<B>Up:</B> <A 240 HREF="sub_HEALPix_F90_subroutines.htm">HEALPix/F90 subroutines</A> 241 242<B> Next:</B> <A 243 HREF="sub_concatnl.htm">concatnl</A> 244<B> Top:</B> <a href="main.htm">Main Page</a></DIV> 245<!--End of Navigation Panel--> 246<ADDRESS> 247Version 3.50, 2018-12-10 248</ADDRESS> 249</BODY> 250</HTML> 251