reg_cd: Cross-sectional dependence in regression

Description Usage Arguments Value See Also Examples

View source: R/Functions_Cross_Dep.R

Description

A routine that takes starting values and model specifications as in ncd_gen() and returns regression results.

Usage

1
reg_cd(startp, ..., rvcov = FALSE)

Arguments

startp

vector of starting values

...

arguments to be passed to ncd_gen() except argument rval. Argument names must match exactly.

rvcov

Logical. Should the variance-covariance matrix be returned?

Value

A list

See Also

ncd_gen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pars=c(1.0,0.5,0.8); N = 5; Tp = 6; fnp<- function(x,y,k){-(0.5*y^4+(x-y)^4)^.25} #dummy k
datpois=gdat_cd(pars=pars,N=N,Tp=Tp,seed=2,fun=fnp,eta = 200,modclass="poiscd") #poisson data 
k=1; lp=k*(k+1)/2; startp = rep(0.2,(lp+2)) # fun() is known
zg1=RpacSPD::reg_cd(startp=startp,Y=datpois$Y,X=datpois$X,Xm=NULL,Xi=datpois$X,Tid=datpois$tpID,
Pid=datpois$psID,fun=fnp,k=k,nt=lp,utid=c(2:Tp),modclass="poiscd") #return function value
BIC(zg1) #compute BIC of fitted model

k=4; lp=k*(k+1)/2; startp = rep(0.2,(lp+2)) # fun() is polynomial approximated
zg4=RpacSPD::reg_cd(startp=startp,Y=datpois$Y,X=datpois$X,Xm=NULL,Xi=datpois$X,Tid=datpois$tpID,
Pid=datpois$psID,fun=polyexp,k=k,nt=lp,utid=c(2:Tp),modclass="poiscd") #return function value
BIC(zg4) #compute BIC of fitted model

estsyawo/RpacSPD documentation built on Aug. 12, 2019, 5:22 a.m.