Package 'SIVMethod'

Title: R tool for Semiparametric Instrumental Variable Method
Description: Analysing Semiparametric Instrumental Variable Model. Tools are provided for simulation and empirical study.
Authors: Bin Peng [aut, cre], Yuhuai Chen [aut]
Maintainer: Bin Peng <Bin.Peng@monash.edu>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-09-28 10:50:09 UTC
Source: https://github.com/greatknee/sivmethod

Help Index


Unified simulation engine for Example B.2.1

Description

Unified simulation engine for Example B.2.1

Usage

Sim(n, no_sim, case, k = NULL)

Arguments

n

Integer. Number of observations.

no_sim

Integer. Number of simulation replications.

case

Character. One of '"A"', '"B"', '"C"' or '"D"'.

k

Integer. The truncation parameter.

Value

A list with:

output

Summary statistics matrix.

selection

Average selection frequencies.

Examples

Sim(100L, 200L, case = "A")

Unified simulation engine for Example B.2.3

Description

This function combines Case A and Case B into a single package-ready simulation interface.

Usage

Sim_test(n, no_sim, case = "A", c = 0.75, k = NULL)

Arguments

n

Integer. Number of observations.

no_sim

Integer. Number of simulation replications.

case

Character. One of '"A"' or '"B"'.

c

Numeric scalar with c >= 0. Used in ϵi=ck/nm(xi)\epsilon_i = c\sqrt{k/n}m(x_i). If c = 0, do not need to specify case.

k

Integer vector. The range of truncation parameters to be considered via Generalized Cross-Validation.

Value

A list with:

output

Summary statistics matrix.

TestRate_n

Average test rate.

Examples

Sim_test(100L, 200L, case = "A", c = 1)

This function implements the SIV method for the linear form

Description

This function implements the SIV method for the linear form

Usage

SIV(Y, X, k)

Arguments

Y

Response vector, n-by-1.

X

Regressor matrix, n-by-d.

k

Integer vector including the possible values of the truncation parameter, L_k-by-1.

Value

A list containing the following components:

  • b_SIV_*: Estimated coefficients (d-by-1).

  • gam_SIV_*: Estimated gams.

  • sd_*: Standard deviation of b_SIV_* and gam_SIV (d-by-1).

  • e_*: Estimated residuals (n-by-1).

  • eps_LSO: Estimated epsilon_i's of the paper (n-by-1), i.e., m(x_i) + e_i.

  • V_LSO: The psi_i()'s after selection (n-by-k).

  • Ind_LSO: Selection result for the LASSO method.

  • m_all: Estimated m(.) and its 95% CI.