help mata somdtransf-------------------------------------------------------------------------------

Title

somdtransf() -- Transformations used by somersd

Syntax

void_somdtransf(transf,theta,zeta[,dzeta])where

transf:string scalartheta:real matrixzeta:real matrixdzeta:real matrix

DescriptionThis function is used by

somersdto perform the transformations specified by thetransf()option and described in the filesomersd.pdf, which is distributed with thesomersdpackage.

somdtransf(transf,theta,zeta,dzeta)inputs a string scalar intransf, which specifies one of the transformations used by thetransf()option ofsomersd, and a matrixtheta, containing values for Somers'Dor Kendall's tau-a. It outputs a matrixzeta, with the same dimensions astheta, containing the transformed values, and, optionally, a matrixdzeta, with the same dimensions, containing the derivatives of the transformed values with respect to the untransformed values. Eitherzetaordzeta, but not both, may be the same matrix astheta, which is then overwritten. Some transformations, or their derivatives, are undefined for untransformed values of 1 and -1 and may be too large to be calculated at values close to 1 or -1. In these cases,tidottree()uses a maximum valuethetamax, slightly less than one, and sets the transformed values and their derivatives to the transformed value and derivative forthetamaxfor untransformed values fromthetamaxto 1 and sets the transformed values and their derivatives to the transformed value and derivative for-thetamaxfor untransformed values from -1 to-thetamax. The value ofthetamaxdepends on the transformation specified by the string scalartransf. If the untransformed value is greater than 1, or less than -1, then the transformed value and its derivative are set to missing. If the string scalartransfcontains a value other than one of the transformation names recognized by thetransf()option ofsomersd, then all the transformed values and their derivatives are set to missing.

RemarksThe value of the maximum untransformed value

thetamaxdepends on the value oftransf, which specifies a transformation recognized by thetransf()option ofsomersd. The recognized values, and corresponding maximum untransformed values, are as follows:

transfthetamaxiden1z0.999999999999999asin0.999999999999999rho1zrho0.99999999c1These values ensure that any value of Somers' D or Kendall's tau-a from -1 to 1 will have a nonmissing transformed value and derivative. These values will not be strictly correct for untransformed values of magnitude greater than

thetamax. However, confidence intervals generated bysomersdfor such untransformed values should probably not be taken seriously, because these confidence intervals are calculated by the infinitesimal jackknife method and work by the Central Limit Theorem, which does not work well for such extreme population values of Somers'Dand Kendall's tau-a. The formulas for all these transformations, and for their derivatives and inverses, are given in the manualsomersd.pdf, distributed with thesomersdpackage.

Conformability

_somdtransf(transf,theta,zeta,dzeta):transf: 1x1theta:M x Nzeta:M x Ndzeta:M x N

Diagnostics

_somdtransf(transf,theta,zeta,dzeta)returns missing values ofzetaanddzetafor values ofthetagreater than 1, or less than -1, or for unrecognized values oftransf.

Source code_somdtransf.mata

AuthorRoger Newson, Imperial College London, UK. Email: r.newson@imperial.ac.uk

Also seeManual:

[M-0] introOnline:

mata,somersd(if installed)