R Under development (unstable) (2024-09-21 r87186 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(glmm) Loading required package: trust Loading required package: mvtnorm Loading required package: Matrix Loading required package: parallel Loading required package: doParallel Loading required package: foreach Loading required package: iterators > eta<-1.23 > neta<-length(eta) > delta<-rep(.0000000001,neta) > > #check derivatives for bernoulli using finite differences > foo<-.C(glmm:::C_cp3,eta=as.double(eta),neta=as.integer(neta),type=as.integer(1),ntrials=as.integer(1),cpout=double(neta))$cpout > this<-foo*delta > that<-.C(glmm:::C_cum3,eta=as.double(eta+delta),neta=as.integer(neta),type=as.integer(1),ntrials=as.integer(1),wts=as.double(1),cumout=double(neta))$cumout-.C(glmm:::C_cum3,eta=as.double(eta),neta=as.integer(neta),type=as.integer(1), ntrials=as.integer(1), wts=as.double(1), cumout=double(neta))$cumout > all.equal(this,that) [1] TRUE > > this<-.C(glmm:::C_cpp3,eta=as.double(eta),neta=as.integer(neta),type=as.integer(1),ntrials=as.integer(1),cppout=double(neta))$cppout*delta > that<-.C(glmm:::C_cp3,eta=as.double(eta+delta),neta=as.integer(neta),type=as.integer(1),ntrials=as.integer(1),cpout=double(neta))$cpout-.C(glmm:::C_cp3,eta=as.double(eta),neta=as.integer(neta),type=as.integer(1),ntrials=as.integer(1),cpout=double(neta))$cpout > all.equal(this,that) [1] TRUE > > #check derivatives for poisson using finite differences > foo<-.C(glmm:::C_cp3,eta=as.double(eta),neta=as.integer(neta),type=as.integer(2),ntrials=as.integer(1),cpout=double(neta))$cpout > this<-foo*delta > that<-.C(glmm:::C_cum3,eta=as.double(eta+delta),neta=as.integer(neta),type=as.integer(2),ntrials=as.integer(1),wts=as.double(1),cumout=double(neta))$cumout-.C(glmm:::C_cum3,eta=as.double(eta),neta=as.integer(neta),type=as.integer(2), ntrials=as.integer(1),wts=as.double(1),cumout=double(neta))$cumout > all.equal(this,that) [1] TRUE > > this<-.C(glmm:::C_cpp3,eta=as.double(eta),neta=as.integer(neta),type=as.integer(2),ntrials=as.integer(1),cppout=double(neta))$cppout*delta > that<-.C(glmm:::C_cp3,eta=as.double(eta+delta),neta=as.integer(neta),type=as.integer(2),ntrials=as.integer(1),cpout=double(neta))$cpout-.C(glmm:::C_cp3,eta=as.double(eta),neta=as.integer(neta),type=as.integer(2),ntrials=as.integer(1),cpout=double(neta))$cpout > all.equal(this,that) [1] TRUE > > > > proc.time() user system elapsed 1.25 0.17 1.39