Learn R Programming

CircNNTSR (version 2.0)

nntsloglik: NNTS log-likelihood function

Description

Computes the log-likelihood function with NNTS density for data

Usage

nntsloglik(data, cpars = 1/sqrt(2 * pi), M = 0)

Arguments

data
vector with observed angles in radians.
cpars
vector of complex numbers of dimension M+1. The first element is a real and positive number. The sum of the SQUARED moduli of the c parameters must be equal to 1/(2*pi).
M
number of components in the NNTS

Value

  • The function gives negative of the value of the log-likelihood function for the data

References

Fernandez-Duran, J.J. (2004). Circular Distributions Based on Nonnegative Trigonometric Sums, Biometrics, 60(2), 499-503.

Examples

Run this code
a<-c(runif(10,3*pi/2,2*pi-0.00000001),runif(10,pi/2,pi-0.00000001))
est<-nntsmanifoldnewtonestimation(a,2)
ccoef<-est$cestimates[,2]
nntsloglik(a,ccoef,2)

Run the code above in your browser using DataLab