varhat {genscore}R Documentation

Asymptotic variance (times n) of the estimator for mu or sigmasq for the univariate normal on a general domain assuming the other parameter is known.

Description

Asymptotic variance (times n) of the estimator for mu or sigmasq for the univariate normal on a general domain assuming the other parameter is known.

Usage

varhat(mu, sigmasq, mode, param1, param2, est_mu, domain, tol = 1e-10)

Arguments

mu

A number, the true mu parameter.

sigmasq

A number, the true sigmasq parameter.

mode

A string, the class of the h function.

param1

A number, the first parameter to the h function.

param2

A number, the second parameter (may be optional depending on mode) to the h function.

est_mu

A boolean. If TRUE, returns the asymptotic variance of muhat assuming sigmasq is known; if FALSE, returns the asymptotic variance of sigmasqhat assuming mu is known.

domain

A list returned from make_domain() that represents the domain.

tol

A positive number, tolerance for numerical integration. Defaults to 1e-10.

Details

The estimates may be off from the empirical variance, or may even be Inf or NaN if "mode" is one of "cosh", "exp", and "sinh") as the functions grow too fast. If est_mu == TRUE, the function numerically calculates

E\left[\sigma^2 h^2(X)+\sigma^4 {h'}^2(X)\right]/E^2[h(X)],

and if est_mu == FALSE, the function numerically calculates

E\left[\left(2\sigma^6h^2(X)+\sigma^8{h'}^2(X)\right)(X-\mu)^2\right]/E^2\left[h(X)(X-\mu)^2\right],

where E is the expectation over the true distribution TN(\mu,\sigma) of X.

Value

A number, the asymptotic variance.

Examples

varhat(0, 1, "min_log_pow", 1, 1, TRUE, make_domain("R+", 1))
varhat(0.5, 4, "min_pow", 1, 1, TRUE, make_domain("R+", 1))

[Package genscore version 1.0.2.2 Index]