beta_se: Standard Error Estimation for Linear Coefficients

Description Usage Arguments Details Value Examples

View source: R/beta_se.R

Description

This is an internal function of package ggam.

Usage

1
beta_se(UB, B, Q2, K, lam1, lam2, Z, Y, ind.c, VS = FALSE, ...)

Arguments

UB

The univariate basis function matrix constructed.

B

The bernstein basis matrix.

Q2

The Q matrix from QR decomposition of the constraint matrix.

K

The energy matrix.

lam1

The smoothing penalty parameter.

lam2

The variable selection penalty parameter.

Z

The parametric matrix.

Y

Response variable.

ind.c

The indexed for parametric coefficient for which standard error want to be calculated.

VS

variable section is conducted or not.

...

other arguments.

Details

A sandwich formula is developed to find the standard error for β. The detailed algorithm is in the paper Wang et al. (2018).

Value

se_beta

The standard error of linear coefficients.

Ve

The estimated covariance matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(MASS)
library(grpreg)
library(Matrix)
library(BPST)
data("eg1pop_dat")
eg1_V1=eg1pop_dat[['V1']]
eg1_T1=eg1pop_dat[['T1']]
eg1pop_rho03=eg1pop_dat[['rho03']]
sam=eg1pop_rho03[sample(1:dim(eg1pop_rho03)[1],100),]
B0=basis(eg1_V1,eg1_T1, d=2, r=1, sam[,3:4])
B=B0$B
ind=B0$Ind.inside
Q2=B0$Q2
K=B0$K
Z=sam[ind,c(5:12)]
Y=sam[ind,'Y']
lam1=0.1
lam2=0
beta_se(UB=NULL,as.matrix(B),Q2,K,lam1,lam2,Z,Y,ind.c=1:6)

funstatpackages/GgAM documentation built on Nov. 4, 2019, 12:59 p.m.