simfun: Simulate an an augmented regression.

Description Usage Arguments Value Examples

View source: R/combined.R

Description

Takes a valid k by k covariance matrix, augments it into a valid k+1 by k+1 covariance matrix, and returns the vector of regression coefficients and R-squared from the implicit linear regression. Primarily for internal use by DOPE. Currently implimented in both R and C++. The C++ version is faster while the R version is easier for the expected user base to read and modify as needed

Usage

1
2
  simfun(vcvm, buff = sqrt(.Machine$double.eps))
  simfuncpp(vcvm, buff = sqrt(.Machine$double.eps))

Arguments

vcvm

A valid k by k covariance matrix. Assumes that the outcome variable is defined by the first row and column.

buff

numeric. A buffer to avoid numeric positive non-definiteness.

Value

A valid k + 1 length vector of regression coefficients (k-1 regressors, 1 control function, 1 R-squared).

Examples

1
2
3
  set.seed(1234)
  corm <- RandomCormCPP(5)
  simfuncpp(corm)

christophercschwarz/DOPE documentation built on April 10, 2020, 4:43 a.m.