Learn R Programming

OOmisc (version 1.2)

nll: Function to calculate negative log-likelihood (NLL)

Description

Calculates NLL value of a given set of predicted success probabilities and observed (binary) values

Usage

nll(fit, y)

Arguments

fit
a vector or matrix which includes the predicted success probabilities
y
a vector or matrix which includes the observed binary values

Value

Returns a numeric value of the NLL estimate

Examples

Run this code
fit<-runif(100)
y<-rbinom(100,1,0.5)
nll(fit,y)

Run the code above in your browser using DataLab