loglik | R Documentation |
Computation of the log-likelihood function of the bivariate distribution (Y,X). The log-likelihood is reparametrized with the parameter of interest ψ, corresponding to the quantity R, and the nuisance parameter λ.
loglik(ydat, xdat, lambda, psi, distr = "exp")
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 |
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:
ψ= α / (α + β) and λ = α + β, with Y ~ exp(α) and X ~ exp(β);
ψ = Φ (μ_2 - μ_1) / √{2 σ^2} and λ = (λ_1, λ_2) = ( μ_1 / √{2 σ^2}, √{2 σ^2} ), with Y ~ N(μ_1, σ^2) and X ~ N(μ_2, σ^2);
ψ = Φ (μ_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 of the log-likelihood function computed in ψ=psi
and λ=lambda
.
Giuliana Cortese
Cortese G., Ventura L. (2013). Accurate higher-order likelihood inference on P(Y<X). Computational Statistics, 28:1035-1059.
MLEs
# 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((mu2-mu1)/(sigma*sqrt(2))) # nuisance parameters nuisance <- c(mu1/(sigma*sqrt(2)), sigma*sqrt(2)) # log-likelihood value loglik(Y, X, nuisance, interest, "norm_EV")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.