stat_mom Module

Routines to calculate statistical moments, and some utilities


Uses

  • module~~stat_mom~~UsesGraph module~stat_mom stat_mom data_arch data_arch module~stat_mom->data_arch sort_arrays sort_arrays module~stat_mom->sort_arrays

Used by

  • module~~stat_mom~~UsedByGraph module~stat_mom stat_mom module~abbott abbott module~abbott->module~stat_mom module~anisotropy anisotropy module~anisotropy->module~stat_mom module~filter filter module~anisotropy->module~filter module~asfc asfc module~asfc->module~stat_mom module~filter->module~stat_mom module~morpho morpho module~morpho->module~stat_mom program~test_morpho test_morpho program~test_morpho->module~stat_mom program~test_morpho->module~morpho program~test_stat test_stat program~test_stat->module~stat_mom module~grad_curv grad_curv module~grad_curv->module~filter program~test_abbott test_abbott program~test_abbott->module~abbott program~test_anisotropy test_anisotropy program~test_anisotropy->module~anisotropy program~test_asfc test_asfc program~test_asfc->module~asfc program~test_smooth test_smooth program~test_smooth->module~filter program~test_grad_curv test_grad_curv program~test_grad_curv->module~grad_curv

Derived Types

type, public ::  moment_stat

statistical moments

Components

Type Visibility Attributes Name Initial
real(kind=R8), public :: Kk

sixth moment

real(kind=R8), public :: Ku

kurtosis

real(kind=R8), public :: Sk

skewness

real(kind=R8), public :: Ss

fifth moment

real(kind=R8), public :: mu

mean

real(kind=R8), public :: si

standard deviation

real(kind=R8), public :: va

variance


Functions

public function random_normal()

Arguments

None

Return Value real(kind=r8)

Note

Adapted from the following fortran 77 code algorithm 712, collected algorithms from acm. this work published in transactions on mathematical software, vol. 18, no. 4, december, 1992, pp. 434-435.

  • The function random_normal() returns a normally distributed pseudo-random number with zero mean and unit variance.
  • The algorithm uses the ratio of uniforms method of a.j. kinderman and j.f. monahan augmented with quadratic bounding curves.

    Author:

    • Alan Miller
    • csiro division of mathematical & information sciences
    • private bag 10, clayton south mdc
    • clayton 3169, victoria, australia

public function rnorm() result(fn_val)

Generate a random normal deviate using the polar method.

Read more…

Arguments

None

Return Value real(kind=R8)

public function rnorm_vec(n, mu, sigma) result(variates)

Vector of reals that follow a normal law

Read more…

Arguments

Type IntentOptional Attributes Name
integer(kind=I4), intent(in) :: n

vector size

real(kind=R8), intent(in), optional :: mu

distribution mean

real(kind=R8), intent(in), optional :: sigma

distribution std

Return Value real(kind=R8), dimension(1:n)

output vector


Subroutines

public subroutine calc_median(tab, mask, md)

Function to calculate the median value of a series.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(:) :: tab

series 1D array

logical(kind=I4), intent(in), optional, dimension(:) :: mask

mask

real(kind=R8), intent(out) :: md

result: series median value

public subroutine calc_moments(tab, mask, mx, nb_mom)

Function to calculate the statistical moments of an array with mask, of shape dim. 1 or 2

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(..) :: tab

1D or 2D array

logical(kind=I4), intent(in), optional, dimension(..) :: mask

1D or 2D mask

type(moment_stat), intent(out) :: mx

moment_stat result

integer(kind=I4), intent(in) :: nb_mom

number of desired moments

private subroutine calc_moments_1D(tab, mask, mx, nb_mom)

Function to calculate the statistical moments of a 1D array with mask, see calc_moments

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(:) :: tab

1D array

logical(kind=I4), intent(in), optional, dimension(:) :: mask

1D mask

type(moment_stat), intent(out) :: mx

moment_stat result

integer(kind=I4), intent(in) :: nb_mom

number of desired moments

public subroutine scramble(tab, lg)

scramble a vector of reals

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(inout), dimension(1:lg) :: tab
integer(kind=i4), intent(in) :: lg