Learn R Programming

nspmix (version 2.0-0)

logd: Log-density and its derivative values

Description

A generic method to compute the log-density values and possibly their first derivatives with respec to theta and beta.

Usage

logd(x, beta, pt, which)

Value

ld

a matrix, storing the log-density values for each (x[i], beta, pt[j], or NULL if not asked for.

db

a matrix, storing the log-density derivatives wrt beta for each (x[i], beta, pt[j], or NULL if not asked for.

dt

a matrix, storing the log-density derivatives wrt theta for each (x[i], beta, pt[j], or NULL if not asked for.

Arguments

x

an object of a class for data.

beta

instrumental parameter in a semiparametric mixture.

pt

a vector of values for the mixing variable theta.

which

an integer vector of length 3, indicating if, respectively, the log-density values, the derivatives wrt beta and the derivatives wrt theta are to be computed and returned if being 1 (TRUE).

Author

Yong Wang <yongwang@auckland.ac.nz>