kclassfit: K-Class Estimation Method

View source: R/weak.R

kclassfitR Documentation

K-Class Estimation Method

Description

It estimates linearModel objects using the K-Class method. It includes LIML, Fuller, TSLS and OLS.

Usage

kclassfit(object, k, type = c("LIML", "Fuller", "BTSLS"), alpha = 1)

getK(object, alpha = 1, returnRes = FALSE)

Arguments

object

A model of class linearModel

k

The numeric value of k for the K-Class estimator. If missing, the value for LIML or Fuller is used.

type

Which value of k should we use to fit the model? Only used if k is missing.

alpha

A parameter for the Fuller method

returnRes

Should the function return the matrix of residuals from the first stage regression?

Details

Let the model be Y=X\beta+U and the matrix of instruments be Z. The K-Class estimator is (X'(I-kM_z)X)^{-1}(X'(I-kM_z)Y). The function getK can be used to compute the value of k for both LIML and Fuller. When type="BTSLS", the bias-adjusted TSLS of Nagar (1959) is computed.

Value

The function returns an object of class kclassfit.

Examples


data(simData)
theta <- c(beta0=1,beta1=2)
model1 <- momentModel(y~x1, ~z1+z2, data=simData)
kclassfit(model1, type="LIML")

momentfit documentation built on June 26, 2024, 3 p.m.