Approximate BIC calculation

Share:

Description

Calculate approximate BIC for a given distribution and number of free parameters in the model.

Usage

1
ApproxBIC(Y, fit.x, fit.y, n)

Arguments

Y

input data vector, distribution of which is estimated.

fit.x

x coordinates of the fitted probability density function for Y

fit.y

y coordinates of the fitted probability density function for Y

n

number of parameters in the model

Details

This function is a follow-up of MCMC fitting of a complicated distribution. fit.x and fit.y come from the fitting of Dirichlet process prior on sAGP or CCF distributions.

Value

numeric, BIC score.

Author(s)

Bo Li

Examples

1
2
3
4
5
6
7
data(mcmc)
data(prior)
library(DPpackage)
Y=c(rnorm(40,0.4,0.05),rnorm(40,0.8,0.05))
vv=which(Y>0.05&Y<1)
fit=DPdensity(Y,status=TRUE,mcmc=mcmc,prior=prior)
BIC=ApproxBIC(Y,fit$x1,fit$dens,length(prior))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.