Stata 15 help for mf_trace_AVBV

Title

[M-5] trace_AVBV() -- Obtain trace of a special-purpose matrix

Syntax

real scalar trace_AVBV(real matrix A, real matrix B, real vector v)

Description

trace_AVBV(A, B, v) returns trace((A*diag(v))*(B*diag(v))), calculated efficiently, where A and B are symmetric matrices with zeros on their diagonals.

trace_AVBV() is an undocumented function.

Remarks

This calculation arises in certain spatial statistical calculations.

Conformability

trace_AVBV(A, B, v): A: n x n B: n x n v: n x 1

Diagnostics

trace_AVBV(A, B, v) assumes, but does not check, that A and B are symmetric with zeros on their diagonals.

trace_AVBV(A, B, v) aborts with error if A, B, or v is a view.

Source code

Function is built in.


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index