A Function to Calculate Log-likelihood of the Historical Data, Given Array-valued Parameters, for Normal Population
A Function to Calculate Log-likelihood of the Historical Data, Given Array-valued Parameters, for Normal Population
The function returns a matrix of class "npp", each element is a log-likelihood of the historical data. It is an intermediate step to calculate the "normalizing constant" C(δ) in the normalized power prior, for the purpose of providing a flexible implementation. Users can specify their own likelihood function of the same class following this structure.
loglikNormD0(D0, thetalist, ntheta =2)
Arguments
D0: a vector of each observation in historical data.
thetalist: a list of parameter values. The number of elements is equal to ntheta. Each element is a matrix. The sample should come from the posterior of the powered likelihood for historical data, with each column corresponds to a distinct value of the power parameter δ
(the corresponding power parameter increases from left to right). The number of rows is the number of Monte Carlo samples for each δ fixed. The number of columns is the number of selected knots (number of distinct δ).
ntheta: a positive integer indicating number of parameters to be estimated in the model.
Returns
A numeric matrix of log-likelihood, for the historical data given the matrix(or array)-valued parameters.