checkupdate.matrixroot: Checks whether the matrix square root is correct

View source: R/fsst.R

checkupdate.matrixrootR Documentation

Checks whether the matrix square root is correct

Description

This function is used to check whether the matrix square root is correct. This is done by checking whether the Frobenius norm is smaller than the tolerance level, i.e., when A is the give matrix, B is the matrix square root obtained from the given sqrtm.method function, and ε is the tolerance level, the FSST test checks whether ||A - BB||_F < ε. If this does not hold, the FSST test will use the sqrtm function from the expm package to obtain the matrix square root.

Usage

checkupdate.matrixroot(mat, mat.name, sqrtm.method, sqrtm.tol)

Arguments

mat

The matrix that we wish to obtain the matrix square root.

mat.name

The name of the matrix for mat.

sqrtm.method

The method used to obtain the matrix square root in the fsst procedure. This has to be a function that takes one argument that accepts a square matrix of size k x k and returns a square matrix of size k x k, where k can be the length of the β(P) vector, or the beta.obs component of the lpinfer object.

sqrtm.tol

The absolute tolerance used to check whether the matrix square root is correct. This is done by checking whether the Frobenius norm is smaller than the tolerance level, i.e., when A is the give matrix, B is the matrix square root obtained from the given sqrtm.method function, and ε is the tolerance level, the FSST test checks whether ||A - BB||_F < ε. If this does not hold, the FSST test will use the sqrtm function from the expm package to obtain the matrix square root.

Value

Returns the matrix square root.

mat.sqrt

The matrix square root.


conroylau/lpinfer documentation built on Oct. 23, 2022, 9:21 a.m.