log_dhurdle1d_pms: Calculates the mean log probability of a vector of i.i.d. 1-d...

Description Usage Arguments Details Value Examples

View source: R/zero_dist.R

Description

Calculates the mean log probability of a vector of i.i.d. 1-d Hurdle random variables under the pms parametrization.

Usage

1
log_dhurdle1d_pms(V, Y, p, mu, sigmasq)

Arguments

V

A logical vector, indicating if each entry in Y is non-zero, i.e. V = (Y != 0).

Y

A numerical vector of i.i.d. 1-d Hurdle random variables.

p

A number, the p parameter.

mu

A number, the mu parameter.

sigmasq

A number, the sigmasq parameter.

Details

The log probability of a sample y from the 1-d Hurdle model with pms parametrization with respect to the sum of the Lebesgue measure and a point mass at 0 is log(1-p) if it is equal to 0, or log(p)-(y-mu)^2/2/sigmasq otherwise. The function calculates the mean of log probabilities over a vector of i.i.d samples.

Value

A number, the mean log probability.

Examples

1
2
y <- rhurdle1d_pms(n=100, log_odds=1.2, mu=2.3, sigmasq=3.4)
log_dhurdle1d_pms(y != 0, y, p=exp(1.2)/(exp(1.2)+1), mu=2.3, sigmasq=3.4)

sqyu/ZiDAG documentation built on Jan. 19, 2021, 4:11 p.m.