copreg: Joint, copula-based regression model

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/copreg.R

Description

This functions fits a joint, bivariate regression model for a Gamma generalized linear model and a (zero-truncated) Poisson generalized linear model.

Usage

1
copreg(x,y,R,S=R,family=1,exposure,sd.error=FALSE,joint=TRUE,zt=TRUE)

Arguments

x

n observations of the Gamma variable

y

n observations of the (zero-truncated) Poisson variable

R

n x p design matrix for the Gamma model

S

n x q design matrix for the (zero-truncated) Poisson model

family

an integer defining the bivariate copula family: 1 = Gauss, 3 = Clayton, 4=Gumbel, 5=Frank

exposure

exposure time for the (zero-truncated) Poisson model, all entries of the vector have to be >0. Default is a constant vector of 1.

sd.error

logical. Should the standard errors of the regression coefficients be returned? Default is FALSE.

joint

logical. Should the two generalized liner models be estimated jointly? Default is TRUE.

zt

logical. If zt=TRUE, we fit a marginal zero-truncated Poisson regression model. Otherwise, we fit a marginal Poisson regression model. Default is TRUE.

Details

We consider positive continuous random variables X_i and positive or non-negative count variables Y_i. We model X_i in terms of a covariate vector r_i and Y_i in terms of a covariate vector s_i. The marginal regression models are specified via

X_i\sim Gamma(μ_i,δ)

with \ln(μ_i)={ r_i} ^\top α for the continuous variable. For the count variable, if zt=TRUE, we use a zero-truncated Poisson model,

Y_i\sim ZTP(λ_{i})

with \ln(λ_{i})=\ln(e_i)+{s_i}^\top β. Otherwise, we use a Poisson model. e_i denotes the exposure time.

Further, mwe assume that the dependency of X_i and Y_i is modeled in terms of a copula family with parameter θ.

Value

This is an object of class copreg

alpha

estimated coefficients for X, including the intercept

beta

estimated coefficients for Y, including the intercept

sd.alpha

estimated standard deviation of alpha (if sd.error=TRUE)

sd.beta

estimated standard deviation of beta (if sd.error=TRUE)

delta

estimated dispersion parameter

theta

estimated copula parameter if joint=TRUE, 0 otherwise (in combination with family=1, 0 corresponds to the independence assumption)

family

copula family as provided in the function call if joint=TRUE, 1 otherwise (in combination with theta=0, 1 corresponds to the independence assumption)

ll

loglikelihood of the estimated model, evaluated at each observation

loglik

overall loglikelihood, i.e. sum of ll

alpha0

estimated coefficients for X under independence, including the intercept

beta0

estimated coefficients for Y under independence, including the intercept

sd.alpha0

estimated standard deviation (if sd.error=TRUE)

sd.beta0

estimated standard deviation (if sd.error=TRUE)

delta0

estimated dispersion parameter under independence

theta0

0 (in combination with family0=1, 0 corresponds to the independence assumption)

family0

1 (in combination with theta0=0, 1 corresponds to the independence assumption)

ll0

loglikelihood of the estimated model under independence, evaluated at each observation

loglik0

overall loglikelihood, under independence, i.e. sum of ll0

zt

The value of zt

tau_IFM

estimated Kendall's τ based on the marginal models, using inference from margins

theta_ifm

estimated copula parameter, estimated via inference from margins

npar

the number of estimated parameters in the model

Author(s)

Nicole Kraemer

References

N. Kraemer, E. Brechmann, D. Silvestrini, C. Czado (2013): Total loss estimation using copula-based regression models. Insurance: Mathematics and Economics 53 (3), 829 - 839.

See Also

mle_marginal,mle_joint, simulate_regression_data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 n<-200 # number of examples
 R<-S<-cbind(rep(1,n),rnorm(n)) # design matrices with intercept 
 alpha<-beta<-c(1,-1) # regression coefficients
 exposure<-rep(1,n) # constant exposure
 delta<-0.5 # dispersion parameter
 tau<-0.3 # Kendall's tau
 family=3 # Clayton copula
 # simulate data
 my.data<-simulate_regression_data(n,alpha,beta,R,S,delta,tau,family,TRUE,exposure)
 x<-my.data[,1]
 y<-my.data[,2]
 
 # joint model without standard errors
 my.model<-copreg(x,y,R,S,family,exposure,FALSE,TRUE)
 

CopulaRegression documentation built on May 29, 2017, 5:47 p.m.