loglik {ProbYX} | R Documentation |
Computation of the log-likelihood function of the bivariate distribution (Y,X).
The log-likelihood is reparametrized with the parameter of interest \psi
, corresponding to the quantity R,
and the nuisance parameter \lambda
.
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, |
psi |
scalar parameter of interest, |
distr |
character string specifying the type of distribution assumed for |
For further information on the random variables Y and X, see help on Prob
.
Reparameterisation in order to determine \psi
and \lambda
depends on the assumed distribution.
Here the following relashonships have been used:
\psi= \frac{\alpha}{(\alpha + \beta)}
and \lambda = \alpha + \beta
,
with Y \sim e^{\alpha}
and X \sim e^{\beta}
;
\psi = \Phi \left( \frac{\mu_2-\mu_1}{\sqrt{2 \sigma^2}} \right)
and
\lambda = (\lambda_1,\lambda_2) = ( \frac{\mu_1}{\sqrt{2 \sigma^2}}, \sqrt{2 \sigma^2} )
,
with
Y \sim N(\mu_1, \sigma^2)
and X \sim N(\mu_2, \sigma^2)
;
\psi = \Phi \left( \frac{\mu_2-\mu_1}{\sqrt{\sigma_1^2 + \sigma_2^2}} \right)
and
\lambda = (\lambda_1, \lambda_2, \lambda_3) = (\mu_1, \sigma_1^2, \sigma_2^2)
, with
Y \sim N(\mu_1, \sigma_1^2)
and X \sim N(\mu_2, \sigma_2^2)
.
The Standard Normal cumulative distribution function is indicated with \Phi
.
Value of the log-likelihood function computed in \psi=
psi
and \lambda=
lambda
.
Giuliana Cortese
Cortese G., Ventura L. (2013). Accurate higher-order likelihood inference on P(Y<X)
. Computational Statistics, 28:1035-1059.
# 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")