rl_importance: Fitting restricted likelihood model using importance sampling...

Description Usage Arguments Value Author(s)

View source: R/rl_import.R

Description

Full model:

b~N(μ_0, Σ_0), σ^2~IG(α, β), y~N(Xb, σ^2)

For the restricted likelihood, conditioning is done on a pair of location and scale statistics T(y) = (b(y), s(y)). statistic is a function of X, y and outputing the p+1-dimensional vector T(y) with the p location statistics (for b) and 1 scale statistic. Instrumental (importance) distributions are normal. For beta, a multivariate normal centererd at the estimate of beta with covariance cov_b. For sigma^2, a truncated normal with mean (before truncation) of the estimate of σ^2 with sd scale.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
rl_importance(
  y,
  X,
  statistic,
  mu0,
  Sigma0,
  alpha,
  beta,
  cov_b,
  scale,
  smooth = 1,
  N,
  Nins
)

Arguments

y

vector of data

X

a matrix or data frame containing the explanatory variables. The matrix should include a vector of 1's if intercept is desired.

statistic

character name of a function computing the location and scale statistic. See details for specification of this function.

alpha

prior shape and scale for sigma^2

beta

prior shape and scale for sigma^2

cov_b

positive definite pxp matrix defining the covariance for the normal instrumental distribution on b. Importance sample weights should be examined to evaluate the appropriatness of this choice.

scale

numeric, sd for the truncated normal instrumental distribution for σ^2. Importance sample weights should be examined to evaluate the appropriatness of this choice.

smooth

scalar or vector of length 2 that will scale the initial bandwidth computed by hpi.

N

number of samples of the statistics to use for the kernel density estimation

Nins

number of samples from the instrumental distribution

Value

list with elements impSamps, w, fit. These are the Nins by length(beta)+1 matrix of importance samples, the corresponding weights, and the observed statistic.

Author(s)

John R. Lewis lewis.865@osu.edu


jrlewi/brlm documentation built on March 17, 2021, 1:10 a.m.