ParaMonte Fortran 2.0.0 Parallel Monte Carlo and Machine Learning LibrarySee the latest version documentation.
pm_sampleAffinity Module Reference

This module contains classes and procedures for affine transformation of multivariate samples. More...

## Data Types

interface  getAffinity
Generate and return an affine-transformation of the input sample of shape (1:ndim) or (1:ndim, 1:nsam) or (1:nsam, 1:ndim) based on the specified values for the translation tlate and tranformations tform along the specified axis dim.
More...

interface  setAffinity
Return an affine-transformation of the input sample of shape (1:ndim) or (1:ndim, 1:nsam) or (1:nsam, 1:ndim) based on the specified values for the translation tlate and tranformations tform along the specified axis dim.
More...

## Variables

character(*, SK), parameter MODULE_NAME = "@pm_sampleAffinity"

## Detailed Description

This module contains classes and procedures for affine transformation of multivariate samples.

In Euclidean geometry, an affine transformation or affinity (from the Latin, affinis, connected with) is a geometric transformation that preserves lines and parallelism, but not necessarily Euclidean distances and angles.

## Definition

If $$X$$ is the point set of an affine space, then every affine transformation on $$X$$ can be represented as the composition of a linear transformation on $$X$$ and a translation of $$X$$.

An affine map is the composition of two functions: a translation and a linear map.
Ordinary vector algebra uses matrix multiplication to represent linear maps, and vector addition to represent translations.
Formally, in the finite-dimensional case, if the linear map is represented as a multiplication by an invertible matrix $$A$$ and the translation as the addition of a vector $$\mathbf{b}$$, an affine map $$f$$ acting on a vector $$\mathbf{x}$$ can be represented as,

$$\mathbf{y} = f(\mathbf{x}) = A\mathbf{x} + \mathbf{b} ~.$$

## Augmented matrix representation

Using an augmented matrix and an augmented vector, it is possible to represent both the translation and the linear map using a single matrix multiplication.
The technique requires that all vectors be augmented with a 1 at the end, and all matrices be augmented with an extra row of zeros at the bottom, an extra column—the translation vector—to the right, and a 1 in the lower right corner.
If $$A$$ is a matrix,

$$\begin{bmatrix} \mathbf{y} \\ 1 \end{bmatrix} = \left[ \begin{array}{ccc|c} &A&&\mathbf{b} \\ 0&\cdots&0&1 \end{array} \right] \begin{bmatrix} \mathbf{x} \\ 1 \end{bmatrix}$$

is equivalent to the following

$$\mathbf{y} = A\mathbf{x} + \mathbf{b} ~.$$

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
affine transformation
Test:
test_pm_sampleAffinity

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.

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, Monday 4:00 AM, August 23, 2021, Dallas, TX

## ◆ MODULE_NAME

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

Definition at line 109 of file pm_sampleAffinity.F90.