logd: Log-density and its derivative values

View source: R/cnm.R

logdR Documentation

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)

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).

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.

Author(s)

Yong Wang <yongwang@auckland.ac.nz>


nspmix documentation built on June 8, 2025, 12:29 p.m.

Related to logd in nspmix...