Learn R Programming

cmpp (version 0.0.1)

compute_log_f_gradient_rcpp: Compute the Gradient of the Log-Likelihood Function Generalized odds rate (GOR)

Description

This function computes the gradient of the log-likelihood function for the parametric model (GOR Approach).

Value

A numeric vector representing the gradient of the log-likelihood.

Arguments

Params

A numeric vector of parameters.

Examples

Run this code
library(cmpp)
features <- matrix(rnorm(300, 1, 2), nrow = 100, ncol = 3)
set.seed(1984)
delta1 <- sample(c(0, 1), 100, replace = TRUE)
delta2 <- 1 - delta1
x <- rexp(100, rate = 1/3)
Initialize(features, x, delta1, delta2, h = 1e-5)
params <- rep(0.001, 2 * (ncol(features) + 3))
gradient <- compute_log_f_gradient_rcpp(params)
print(gradient)

Run the code above in your browser using DataLab