Skip to contents

Ordinal probit models fitted by the Albert-Chib data-augmentation sampler, multinomial likelihoods, and penalised Poisson and multinomial fits.

Usage

morie_ordinal_probs(eta, thresholds, link = "probit") 

morie_ordinal_probit_gibbs(y, X, n_iter = 1500L, burn_in = 400L, nu_beta = 5, S_beta = 1, 
    seed = 42L) 

morie_multinomial_probs(X, beta0, beta, baseline_last = TRUE) 

morie_multinomial_loglik(X, y, beta0, beta, baseline_last = TRUE) 

morie_penalized_multinomial(X, y, beta0, beta, lambda, penalty = "ridge",
  baseline_last = TRUE) 

morie_penalized_poisson(X, y, lambda = 1, penalty = "ridge", n_iter = 100L, tol = 1e-10, 
    add_intercept = TRUE)

Arguments

y

response vector of category codes

X

predictor matrix

n_iter

number of Gibbs iterations

lambda

penalty parameter

eta

argument eta; not described in the source.

thresholds

argument thresholds; not described in the source.

argument link; not described in the source.

burn_in

argument burn_in; not described in the source.

nu_beta

argument nu_beta; not described in the source.

S_beta

argument S_beta; not described in the source.

seed

argument seed; not described in the source.

beta0

argument beta0; not described in the source.

beta

argument beta; not described in the source.

baseline_last

argument baseline_last; not described in the source.

penalty

argument penalty; not described in the source.

tol

argument tol; not described in the source.

add_intercept

argument add_intercept; not described in the source.

Value

A list holding the fitted quantities for the method called: point estimates, fitted values and any diagnostics it produces. See the individual method descriptions above for the components each returns.

Details

These functions mirror, in R, the implementations in the Python package morie; the two are checked against each other by the parity tests in tests/testthat/.

Examples

morie_ordinal_probs(eta = c(-0.5, 0.2, 1.1),
                    thresholds = c(-1, 0, 1))
#>           [,1]      [,2]      [,3]       [,4]
#> [1,] 0.0668072 0.2417303 0.3829249 0.30853754
#> [2,] 0.2118554 0.3674043 0.3056706 0.11506967
#> [3,] 0.5398278 0.3245061 0.1178016 0.01786442