opsr.fit {OPSR}R Documentation

Fitter Function for Ordinal Probit Switching Regression Models

Description

This is the basic computing engine called by opsr used to fit ordinal probit switching regression models. Should usually not be used directly. The log-likelihood function is implemented in C++ which yields a considerable speed-up. Parallel computation is implemented using OpenMP.

Usage

opsr.fit(
  Ws,
  Xs,
  Ys,
  start,
  fixed,
  weights,
  method,
  iterlim,
  printLevel,
  nThreads,
  .useR = FALSE,
  ...
)

Arguments

Ws

list of matrices with explanatory variables for selection process for each regime.

Xs

list of matrices with expalanatory varialbes for outcome process for each regime.

Ys

list of vectors with continuous outcomes for each regime.

start

a numeric vector with the starting values (passed to maxLik::maxLik).

fixed

parameters to be treated as constants at their start values. If present, it is treated as an index vector of start parameters (passed to maxLik::maxLik).

weights

a vector of weights to be used in the fitting process. Has to conform with order (w <- weights[order(Z)], where Z is the ordinal outcome).

method

maximzation method (passed to maxLik::maxLik).

iterlim

maximum number of iterations (passed to maxLik::maxLik).

printLevel

larger number prints more working information (passed to maxLik::maxLik).

nThreads

number of threads to be used. Do not pass higher number than number of ordinal outcomes. See also opsr_check_omp and opsr_max_threads.

.useR

if TRUE, usese loglik_R. Go grab a coffe.

...

further arguments passed to maxLik::maxLik.

Value

object of class ⁠"maxLik" "maxim"⁠.

See Also

maxLik::maxLik, loglik_cpp, opsr


[Package OPSR version 0.1.2 Index]