pdff: Getting the pdf of some distribution

Description Usage Arguments Value Examples

View source: R/pdff.R

Description

Getting the pdf of some distribution, where the Const is ignored for MCMC method.

Usage

1
2
3
4
5
6
7
pdff(type = c("norm", "mixnorm"), ...)

## S3 method for class 'norm'
pdff(type, mu = 0, A = 1)

## S3 method for class 'mixnorm'
pdff(type, p, mu1, mu2, A1, A2)

Arguments

type

Type of the distribution one wants to get. c("norm", "mixnorm") is provided.

...

Additional arguments for type.

mu, A

Parameters for normal distribution, mu being the mean vecter while A being the covariance matrix

p, m1, mu2, A1, A2

Parameters for mixture normal distribution. The pdf can be written as p*pdf1 + (1-p)*pdf2

Value

The pdf of 'type'.

Examples

1
2
3
4
5
6
7
8
9
# norm --------------------------------------------------------------------
f <- pdff("norm")
# mixnorm -----------------------------------------------------------------
p <- 0.5
mu1 <- c(0, 0)
mu2 <- c(6, 6)
A1 <- matrix(c(1, 0.1, 0.1, 1), nrow = 2)
A2 <- matrix(c(1, -0.1, -0.1, 1), nrow = 2)
g <- pdff("mixnorm", p, mu1, mu2, A1, A2)

hjy78/mcmcn documentation built on Jan. 1, 2020, 1:03 p.m.