distdata |

Save a matrix containing distribution plot data computed from the matrix.

Saves the data used to display the kernel regression, nearest neighbor regression, or empirical quantile-quantile plot to the workfile.

Syntax

matrix_name.distdata(dtype=dist_type, dist_options) matrix_name_pattern

saves the distribution plot data specified by dist_type where dist_type must be one of the following keywords:

kernfit | Kernel regression (default). |

nnfit | Nearest neighbor (local) regression. |

empqq | Empirical quantile-quantile plot. |

The matrix_name_pattern is used to define a naming pattern for the output matrices; if the pattern is “NAME”, the resulting matrices will be named “NAME01”, “NAME02”, … and so on, using the next available name.

Options

For the first two types (“kernfit” and “nnfit”), dist_options are any of the distribution type-specific options described in
“Kernfit Options” and
“Nnfit Options”, respectively. The empirical quantile-quantile plot type (“empqq”) takes the options described in
qqplot under
“Empirical Options”.

Note that the graph display specific options such as “fill,” “nofill,” “leg,” and “noline” are not relevant for this procedure.

In addition, you may use the “mult” option to specify multiple series handling

mult = mat_type | Multiple series or column handling: where mat_type may be: “pairs” or “p” - pairs, “mat” or “m” - scatterplot matrix, “lower” or “l” - lower triangular matrix. |

and the “prompt” option to force the dialog display

prompt | Force the dialog to appear from within a program. |

Examples

If MAT1 is a matrix with four columns,

mat1.distdata(mult=first, dtype=kernel, k=e, ngrid=100) m

then creates three matrices, M01, M02 and M03, where the M01 contains the kernel fit (with an Epanechnikov kernel and 100 grid points) of the second column of MAT1 on the first column, M02 contains the fit of the first column on the third column, and M03 contains the kernel fit of column 1 on column 4.

mat1.distdata(mult=pairs, dtype=local, b=0.3, d=1, neval=100, s) n

creates two matrices, N1 and N2, where N1 contains the nearest neighbor fit of column 1 on column 2 computed using a bandwidth of 0.3 and polynomial degree of 1, 100 evaluation points and symmetric neighbors, and N2 contains the data for the nearest neighbor fit of column 3 on column 4.

If we extract a new matrix MAT2 containing first three columns of MAT1, the commands

matrix mat2 = mat1.@col(@range(1, 3))

mat2.distdata(mult=all, dtype=empqq, q=r) mat

creates 3 matrices; MAT01, MAT02, and MAT03, where MAT01 contains the empirical quantile-quantile for columns 1 and 2, computed using the rankit quantile method, MAT02 contains the qq-plot data for columns 1 and 3, and MAT03 contains the qq-plot data for columns 2 and 3.

Cross-references

For a description of distribution graphs and quantile-quantile graphs, see
“Auxiliary Graph Types”.

See also
qqplot and
“Auxiliary Spec”.