qrminfundtheorem: Minimize the negative of log-likelihood

Description Usage Arguments Details Value References See Also Examples

View source: R/ORI.R

Description

This function minimizes the negative of the log-likelihood for ordinal quantile model with respect to cut-points δ using the fundamental theorem of calculus.

Usage

1
qrminfundtheorem(deltaIn, y, x, beta, cri0, cri1, stepsize, maxiter, h, dh, sw, p)

Arguments

deltaIn

initialization of cut-points.

y

observed ordinal outcomes, column vector of dimension (n x 1).

x

covariate matrix of dimension (n x k) including a column of ones.

beta

column vector of coefficients of dimension (k x 1).

cri0

initial criterion, cri0 = 1.

cri1

criterion lies between (0.001 to 0.0001).

stepsize

learning rate lies between (0.1, 1).

maxiter

maximum number of iteration.

h

change in value of each δ, holding other δ constant for first derivatives.

dh

change in each value of δ, holding other δ constant for second derivaties.

sw

iteration to switch from BHHH to inv(-H) algorithm.

p

quantile level or skewness parameter, p in (0,1).

Details

First derivative from first principle

dy/dx=[f(x+h)-f(x-h)]/2h

Second derivative from first principle

f'(x-h)=(f(x)-f(x-h))/h

f''(x)= [{(f(x+h)-f(x))/h} - (f(x)-f(x-h))/h]/h

= [(f(x+h)+f(x-h)-2 f(x))]/h^2

cross partial derivatives

f(x) = [f(x+dh,y)-f(x-dh,y)]/2dh

f(x,y)=[{(f(x+dh,y+dh) - f(x+dh,y-dh))/2dh} - {(f(x-dh,y+dh) - f(x-dh,y-dh))/2dh}]/2dh

= 0.25* [{(f(x+dh,y+dh)-f(x+dh,y-dh))} -{(f(x-dh,y+dh)-f(x-dh,y-dh))}]/dh2

Value

Returns a list with components

References

Rahman, M. A. (2016). “Bayesian Quantile Regression for Ordinal Models.” Bayesian Analysis, 11(1): 1-24. DOI: 10.1214/15-BA939

See Also

differential calculus, functional maximization, mldivide

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
set.seed(101)
deltaIn <- c(-0.002570995,  1.044481071)
data("data25j4")
x <- data25j4$x
y <- data25j4$y
p <- 0.25
beta <- c(0.3990094, 0.8168991, 2.8034963)
cri0     <- 1
cri1     <- 0.001
stepsize <- 1
maxiter  <- 10
h        <- 0.002
dh       <- 0.0002
sw       <- 20
output <- qrminfundtheorem(deltaIn, y, x, beta, cri0, cri1, stepsize, maxiter, h, dh, sw, p)

# deltamin
#   0.8266967 0.3635708
# negsum
#   645.4911
# logl
#    -0.7136999
#    -1.5340787
#    -1.1072447
#    -1.4423124
#    -1.3944677
#    -0.7941271
#    -1.6544072
#    -0.3246632
#    -1.8582422
#    -0.9220822
#    -2.1117739 .. soon
# G
#    0.803892784  0.00000000
#   -0.420190546  0.72908381
#   -0.421776117  0.72908341
#   -0.421776117 -0.60184063
#   -0.421776117 -0.60184063
#    0.151489598  0.86175120
#    0.296995920  0.96329114
#   -0.421776117  0.72908341
#   -0.340103190 -0.48530164
#    0.000000000  0.00000000
#   -0.421776117 -0.60184063.. soon
# H
#   -338.21243  -41.10775
#   -41.10775 -106.32758

bqror documentation built on Nov. 22, 2021, 1:07 a.m.