ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_sampleWeight Module Reference

This module contains the types, classes, and procedures relevant to weights of random samples. More...

Data Types

type  aweight_type
 This is a concrete derived type whose instances are exclusively used to signify the aweight type of sample weights.
More...
 
type  fweight_type
 This is a concrete derived type whose instances are exclusively used to signify the fweight type of sample weights.
More...
 
interface  getReweight
 Generate and return a reweighting of the input weight vector, such that the sequence represented by output reweight is the refined (skipped by the amount skip) version of the sequence represented by the input weight.
More...
 
type  rweight_type
 This is a concrete derived type whose instances are exclusively used to signify the rweight type of sample weights.
More...
 
interface  setReweight
 Generate and return a reweighting of the input weight vector, such that the sequence represented by output reweight is the refined (skipped by the amount skip) version of the sequence represented by the input weight.
More...
 
type  weight_type
 This is an abstract derived type for constructing concrete derived types to distinguish various procedure signatures that require different sample weights (e.g., fweight, aweight, rweight, ...).
More...
 

Variables

character(*, SK), parameter MODULE_NAME = "@pm_sampleWeight"
 
type(aweight_type), parameter aweight = aweight_type()
 This is a scalar parameter object of type aweight_type that is exclusively used to signify the Symmetric class of a given matrix within an interface of a procedure of the ParaMonte library.
More...
 
type(fweight_type), parameter fweight = fweight_type()
 This is a scalar parameter object of type fweight_type that is exclusively used to signify the Symmetric class of a given matrix within an interface of a procedure of the ParaMonte library.
More...
 
type(rweight_type), parameter rweight = rweight_type()
 This is a scalar parameter object of type rweight_type that is exclusively used to signify the Symmetric class of a given matrix within an interface of a procedure of the ParaMonte library.
More...
 

Detailed Description

This module contains the types, classes, and procedures relevant to weights of random samples.

Within the world of statistics, particularly, traditional frequentist statistics, there is absolute confusion on what types of weights exist and what their implications are.

The most relevant definitions, which are also currently used in the ParaMonte library, are the following,

  1. Frequency weights, also known as frequency, count, or repeat weights, represent the number of duplications of each observation in a sample.
    Therefore, the frequency weights are expected to be integers or whole numbers.
  2. Reliability weights represent a measure of the reliability of each observation in a sample.
    Reliability weights are frequently normalized, but not necessarily.

There are also other definitions of weight which special use cases, for example:

  1. Analytic or precision weights, also known as analytic weight, inverse variance weight, or regression weight, are weights that are inversely proportional to the variance of an observation.
    Typically, the observations represent averages and the weights are the number of elements that gave rise to the average.
    These weights are calculated by taking the inverse of the sampling fraction. See also
    1. Inverse-variance weighting.
    2. Gatz, Donald F., and Luther Smith (1995), The standard error of a weighted mean concentration—I. Bootstrapping vs other methods.
Note
A weighted sample has an effective sample size (ESS) that is smaller than the actual number of observations in the sample,

\begin{equation} \mathrm{ESS} = \frac{ \big( \sum_{i = 1}^{N} w_i \big)^2 }{ \sum_{i = 1}^{N} w_i^2 } ~, \end{equation}

If the weights \(w_i\) are normalized such that \(\sum_{i = 1}^{N} w_i = N\), then,

\begin{equation} \mathrm{ESS} = \frac{ N }{ 1 + \mathrm{VAR}(w) } ~, \end{equation}

where \(\mathrm{VAR}(w)\) represents the variance of the weights.
Therefore, the effective sample size is impacted by both the sample size \(N\) and the amount of variability in weights.
See also
pm_sampling
pm_sampleACT
pm_sampleCCF
pm_sampleCor
pm_sampleCov
pm_sampleConv
pm_sampleECDF
pm_sampleMean
pm_sampleNorm
pm_sampleQuan
pm_sampleScale
pm_sampleShift
pm_sampleWeight
pm_sampleAffinity
pm_sampleVar
Stata documentation
Wikipedia
Types of weights


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Fatemeh Bagheri, Thursday 12:45 AM, August 20, 2021, Dallas, TX

Variable Documentation

◆ aweight

type(aweight_type), parameter pm_sampleWeight::aweight = aweight_type()

This is a scalar parameter object of type aweight_type that is exclusively used to signify the Symmetric class of a given matrix within an interface of a procedure of the ParaMonte library.

Precision (or Analytic) weights are weights that are inversely proportional to the variance of an observation.
The variance of the \(i\)th observation is assumed to be \(\sigma^2/w_i\).
Typically, the observations represent averages and the weights are the number of elements that gave rise to the average.
For example usage, see the documentation of the target procedure requiring this object.

See also
aweight
fweight
rweight
weight_type
aweight_type
fweight_type
rweight_type


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

Definition at line 175 of file pm_sampleWeight.F90.

◆ fweight

type(fweight_type), parameter pm_sampleWeight::fweight = fweight_type()

This is a scalar parameter object of type fweight_type that is exclusively used to signify the Symmetric class of a given matrix within an interface of a procedure of the ParaMonte library.

Frequency weights, represent the number of duplications of each observation in the sample.
For example usage, see the documentation of the target procedure requiring this object.

See also
aweight
fweight
rweight
weight_type
aweight_type
fweight_type
rweight_type


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

Definition at line 233 of file pm_sampleWeight.F90.

◆ MODULE_NAME

character(*, SK), parameter pm_sampleWeight::MODULE_NAME = "@pm_sampleWeight"

Definition at line 90 of file pm_sampleWeight.F90.

◆ rweight

type(rweight_type), parameter pm_sampleWeight::rweight = rweight_type()

This is a scalar parameter object of type rweight_type that is exclusively used to signify the Symmetric class of a given matrix within an interface of a procedure of the ParaMonte library.

For example usage, see the documentation of the target procedure requiring this object.

See also
aweight
fweight
rweight
weight_type
aweight_type
fweight_type
rweight_type


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

Definition at line 290 of file pm_sampleWeight.F90.