Loglikelihood of the bivariate distribution of (Y,X)
Description
Computation of the loglikelihood function of the bivariate distribution (Y,X). The loglikelihood is reparametrized with the parameter of interest ψ, corresponding to the quantity R, and the nuisance parameter λ.
Usage
1  loglik(ydat, xdat, lambda, psi, distr = "exp")

Arguments
ydat 
data vector of the sample measurements from Y. 
xdat 
data vector of the sample measurements from X. 
lambda 
nuisance parameter vector, λ. Values can be determined from the reparameterisation of the original parameters
of the bivariate distribution chosen in 
psi 
scalar parameter of interest, ψ, for the probability R. Value can be determined from the reparameterisation
of the original parameters of the bivariate distribution chosen in 
distr 
character string specifying the type of distribution assumed for X_1 and X_2. Possible choices for 
Details
For further information on the random variables Y and X, see help on Prob
.
Reparameterisation in order to determine ψ and λ depends on the assumed distribution.
Here the following relashonships have been used:
 Exponential models:

ψ= α / (α + β) and λ = α + β, with Y ~ exp(α) and X ~ exp(β);
 Gaussian models with equal variances:

ψ = Φ (μ_2  μ_1) / √{2 σ^2} and λ = (λ_1, λ_2) = ( μ_1 / √{2 σ^2}, √{2 σ^2} ), with Y ~ N(μ_1, σ^2) and X ~ N(μ_2, σ^2);
 Gaussian models with unequal variances:

ψ = Φ (μ_2  μ_1) / √{σ_1^2 + σ_2^2} and λ = (λ_1, λ_2, λ_3) = (μ_1, σ_1^2, σ_2^2), with Y ~ N(μ_1, σ_1^2) and X ~ N(μ_2, σ_2^2).
The Standard Normal cumulative distribution function is indicated with Φ.
Value
Value of the loglikelihood function computed in ψ=psi
and λ=lambda
.
Author(s)
Giuliana Cortese
References
Cortese G., Ventura L. (2013). Accurate higherorder likelihood inference on P(Y<X). Computational Statistics, 28:10351059.
See Also
MLEs
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13  # data from the first population
Y < rnorm(15, mean=5, sd=1)
# data from the second population
X < rnorm(10, mean=7, sd=1)
mu1 < 5
mu2 < 7
sigma < 1
# parameter of interest, the R probability
interest < pnorm((mu2mu1)/(sigma*sqrt(2)))
# nuisance parameters
nuisance < c(mu1/(sigma*sqrt(2)), sigma*sqrt(2))
# loglikelihood value
loglik(Y, X, nuisance, interest, "norm_EV")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.