bpr_likelihood: BPR log likelihood function

Description Usage Arguments Value Mathematical formula See Also Examples

Description

bpr_likelihood evaluates the Binomial distributed Probit regression log likelihood function for a given set of coefficients, observations and a design matrix.

Usage

1
bpr_likelihood(w, H, data, is_NLL = FALSE)

Arguments

w

A vector of parameters (i.e. coefficients of the basis functions)

H

The L x M matrix design matrix, where L is the number of observations and M the number of basis functions.

data

An L x 2 matrix containing in the 1st column the total number of trials and in the 2nd the number of successes. Each row corresponds to each row of the design matrix.

is_NLL

Logical, indicating if the Negative Log Likelihood should be returned.

Value

the log likelihood

Mathematical formula

The Binomial distributed Probit regression log likelihood function is computed by the following formula:

log p(y | f, w) = ∑_{l=1}^{L} log Binom(m_{l} | t_{l}, Φ(w^{t}h(x_{l})))

where h(x_l) are the basis functions.

See Also

bpr_gradient, design_matrix

Examples

1
2
3
4
5
6
7
obj <- polynomial.object(M=2)
obs <- c(0,.2,.5, 0.6)
des_mat <- design_matrix(obj, obs)
H <- des_mat$H
w <- c(.1,.1,.1)
data <- matrix(c(10,12,15,7,9,8), ncol=2)
lik <- bpr_likelihood(w, H, data)

andreaskapou/mpgex documentation built on May 12, 2019, 3:33 a.m.