Learn R Programming

StepSignalMargiLike (version 2.6.0)

prior.norm.C: prior.norm.C

Description

This function computes the Norm-C prior proposed in Du, Kao and Kou (2015), which is used under conjugate normal assumption. The variance \(\sigma^2\) is assumed to be drawn from an inverse Gamma distribution with shape parameter \(\nu0\) and scale parameter \(\sigma0^2\), while mean is assumed to be drawn from a normal distribution with mean \(\mu0\) and variance \(\sigma^2/\kappa0\).

Usage

prior.norm.C(data.x)

Arguments

data.x

Observed data in vector form where each element represents a single observation.

Value

Vector for prior parameters in the order of (\(\mu0, \kappa0, \nu0, \sigma0^2\))

Details

See Manual.pdf in "data" folder.

References

Chao Du, Chu-Lan Michael Kao and S. C. Kou (2015), "Stepwise Signal Extraction via Marginal Likelihood". Forthcoming in Journal of American Statistical Association.

Examples

Run this code
# NOT RUN {
library(StepSignalMargiLike)

n <- 5
data.x <- rnorm(n, 1, 1)
data.x <- c(data.x, rnorm(n, 10,1))
data.x <- c(data.x, rnorm(n, 2,1))
data.x <- c(data.x, rnorm(n, 10,1))
data.x <- c(data.x, rnorm(n, 1,1))

prior.norm.C(data.x)
# }

Run the code above in your browser using DataLab