fit_causl: Fit multivariate copula regression model

View source: R/fit.R

fit_causlR Documentation

Fit multivariate copula regression model

Description

Fit multivariate copula regression model

Usage

fit_causl(
  dat,
  formulas = list(y ~ x, z ~ 1, ~x),
  family = rep(1, length(formulas)),
  link,
  cop_pars,
  use_cpp = TRUE,
  control = list(),
  other_pars = list()
)

fitCausal(
  dat,
  formulas = list(y ~ x, z ~ 1, ~x),
  family = rep(1, length(formulas)),
  link,
  par2,
  sandwich = TRUE,
  use_cpp = TRUE,
  control = list()
)

Arguments

dat

data frame of observations

formulas

list of model formulae, for Y, for the Z variables, and finally for the copula

family

families for the Y and Z distributions, and the copula. Should be the same length as formulas

link

link functions for each variable

cop_pars

additional parameters for copula if required

use_cpp

logical: should C++ routines be used?

control

list of parameters to be passed to optim

other_pars

list of other parameters to use (e.g. degrees of freedom for a t-distribution)

par2

former name for cop_pars argument

sandwich

logical: should sandwich standard errors be returned?

Details

formulas is list of three or more formulae giving predictors of y-margin, z-margin(s) and interaction parameters. Fit is by maximum likelihood.

family takes numeric values of the following forms:

val family
0 binomial
1 gaussian
2 t
3 Gamma
4 beta
5 binomial
6 lognormal
11 ordinal
10 categorical

control has the same arguments as the argument in optim, as well as sandwich, a logical indicating if sandwich estimates of standard errors should be computed, newton, a logical which controls whether Newton iterates should be performed at the end, and cop which can edit the restricted variable name for the left-hand side of formulae. Useful for altering are trace (1 shows steps of optimization) and maxit for the number of steps.

The list other_pars should be named with the relevant variables, and each entry should be a named list containing the relevant parameters.

Warning By default, none of the variables should be called cop, as this is reserved for the copula. The reserved word can be changed using the argument cop within control.

Value

Returns a list of class cop_fit.

Functions

  • fitCausal(): old name


rje42/causl documentation built on June 1, 2025, 2:50 p.m.