likinvbat: Likelihood of the inverse Batschelet distribution

Description Usage Arguments Value Functions Examples

View source: R/InvBatschelet.R

Description

Two functions to obtain the inverse Batschelet likelihood of a set parameters, given a data set of angles.

Usage

1
2
3
likinvbat(x, mu, kp, lam, weights = rep(1, length(x)), log = TRUE)

likfuninvbat(x, weights = rep(1, length(x)), log = TRUE)

Arguments

x

A set of angles in radians.

mu

A mean direction, in radians.

kp

Numeric, > 0,the concentration parameter.

lam

The shape parameter (peakedness), -1 < lam < 1.

weights

A vector of length length(x), which gives importance weights to be used for x.

log

If TRUE (the default), the log-likelihood is used.

Value

likinvbat returns a value, the likelihood given the data and parameters. likfuninvbat returns a function of mu, kp and lam, which can be evaluated later for a given set of parameters.

Functions

Examples

1
2
3
4
5
6
7
8
9
vm_data <- circglmbayes::rvmc(10, 1, 5)
llfun <- likfuninvbat(vm_data)

# log-likelihood value of true parameters.
llfun(mu = 1, kp = 5, lam = 0)

# Plot the conditional log-likelihood.
kp_conditional_ll <- Vectorize(function(x) llfun(mu = 1, kp = x, lam = 0))
curve(kp_conditional_ll, 0, 20)

keesmulder/flexcircmix documentation built on May 29, 2019, 3:02 a.m.