f2_gaussian_vector: Derives the inverse of the gradient vector.

Description Usage Arguments Value Examples

View source: R/f2_gaussian_vector.R

Description

Computes the inverse of the gradient vector for the gaussian model. Typically done to find the set of tangency points that yield the same gradient as an initial set of gradients used for an envelope positioned at the posterior mode for a specific dispersion.

Usage

1
f2_gaussian_vector(b, y, x, mu, P, alpha, wt)

Arguments

b

A matrix storing a set of vectors for which the negative log-likelihood is to be evaluated.

y

For glm: logical values indicating whether the response vector and model matrix used in the fitting process should be returned as components of the returned value.

For glm.fit: x is a design matrix of dimension n * p, and y is a vector of observations of length n.

x

For glm: logical values indicating whether the response vector and model matrix used in the fitting process should be returned as components of the returned value.

For glm.fit: x is a design matrix of dimension n * p, and y is a vector of observations of length n.

mu

Prior mean

P

Prior Precision matrix

alpha

offset vector

wt

weighting vector

Value

Refer to Nygren and Nygren (2006) for details. The first set of items refers to Example 2 in section 3.1. All except the last item in this list of returned items has a number of rows equaling the number of components of the grid and a number of columns equaling the number of coefficients in the model. All quantities refer to the respective coefficient for each of the components of the grid.

Down

The lower bounds for the interval to be evaluated. Either negative infinity or a real number.

Up

The upper bounds for the interval to be evaluated. Either positive infinity or a real number.

lglt

The log of the density between negative infinity and the upper bound

lgrt

The log of the density between the lower bound and infinity

lgct

The log of the density between the lower and upper bounds

logU

The one of the 3 above that is relevant for the component of the grid

logP

A two column matrix, the first of which holds sum of logU across the components. The second column is 0 and is later populated by the Set_logP function

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## ----dobson-------------------------------------------------------------------
## Dobson (1990) Page 93: Randomized Controlled Trial :
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)

## Prior mean vector 
mu<-matrix(0,5)           
mu[1,1]=log(mean(counts)) 
## Prior standard deviation and Variance
mysd<-1           
V=((mysd)^2)*diag(5)  
## Call to glmb
glmb.D93<-glmb(n=1000,counts ~ outcome + treatment,
               family = poisson(),pfamily=dNormal(mu=mu,Sigma=V))
## ----glmb extractAIC-------------------------------------------------------------
extractAIC(glmb.D93)

knygren/glmbayes documentation built on Sept. 4, 2020, 4:39 p.m.