Description Usage Arguments Details Author(s)
powLawOrd
calculates the mean (h). powLawOrdSigma
calculates the noise (sigma, or sig for short). powLawOrdNegLogLikVect
calculates a vector of the negative log-likelihoods. powLawOrdNegLogLik
calculates the negative log-likelihood (sum of powLawOrdNegLogLikVect
). fitPowLawOrd
returns the maximum likelihood fit. simPowLawOrd
creates simulated data.
1 | powLawOrd(x, th_v, transformVar = F)
|
x |
Vector of independent variable observations |
th_v |
Vector of parameters with ordering [rho,tau_1,...,tau_M,s,kappa] |
transformVar |
Whether a transformation of the parameterization is needed [Default FALSE] |
vstar |
Vector of latent dependent variable observations (for v^*) |
v |
Vector of dependent variable observations (ordinal) |
rho |
Scaling exponent |
s |
Baseline noise |
kappa |
Slope of noise [Optional] |
hetSpec |
Specification for the heteroskedasticity [Default 'none'] |
We assume that the latent response variable vstar (for v^*) is distributed as
vstar ~ N(g(x),sig(x)^2)
where x is the independent variable, g(x) the mean, sig(x) the noise, and N denotes a normal distribution. If sig is independent of x, the model is homoskedastic. Otherwise, it is heteroskedastic. What is observed is not the latent response vstar, but rather an ordinal response variable v that is derived from vstar per
-Inf < vstar <= tau_1 --> m = 0
tau_1 < vstar <= tau_2 --> m = 1
...
tau_M < vstar <= Inf --> m = M
That is, there are M+1 ordinal categories m = 0,1,...M, and the ordered vector tau = [tau_1,...,tau_M] provides the cut-offs to derive the ordinal response, v, from the latent continuous response, vstar. Given this model, the likelihood of the observation (x,v) is
l_v = Phi((tau_{m+1} - g)/sig) - Phi((tau_m - g)/sig)
where Phi is the cumulative distribution function of the standard univariate normal with a mean of 0 and standard deviation of 1. We adopt the convention tau_0 = -Inf and tau_M+1 = Inf and adopt the notation that tau_m is tau_lo and tau_m+1 is tau_hi (and similarly for Phi and other variables). The negative log likelihood of the observation (x,v) is
eta_v = -log(Phi((tau_hi - g)/sig) - Phi((tau_lo - g)/sig))
= -log(Phi_hi-Phi_lo)
For the mean and noise, we adopt the parametric forms
h = x^rho
and
sig = s
[hetSpec = 'none']
sig = s*(1 + kappa*x)
[hetSpec = 'sd_x']
sig = s*(1 + kappa*x^rho)
[hetSpec = 'sd_resp']
The choice of x^rho comes from using an offset power law, alpha*x^rho + beta, and requiring alpha=1 and beta=0 for identifiability. For optimization, it is often preferable to work with an unconstrained variable. This is supported via the optional input transformVar. rho, s, kappa, and the differences between successive values of tau must be positive. This is accomplished by using, for example, rho_bar = log(rho) and rho = exp(rho_bar).
Michael Holton Price <MichaelHoltonPrice@gmail.com>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.