author: JinhuaSu
Semi-parametric estimation problem can be solved by two-step Newton-Raphson iteration. The implicit Profiling method(our arXiv paper with the title of “Implicit Profiling Estimation for Semiparametric Models with Bundled Parameters” is available at https://arxiv.org/abs/2108.07928.) is an improved method of two-step NR iteration especially for the implicit-bundled type of the parametric part and non-parametric part. This package provides a function semislv() supporting the above two methods and numeric derivative approximation for unprovided Jacobian matrix.
S3 usage
functional object
there is a global varible s3 -> final result
there are different small function to modify it
function factory + s3
https://stackoverflow.com/questions/30283389/packing-and-unpacking-elements-from-list-in-r
finding a useful method for realizing the two part: (1) mget (2) list2env (3) ellipsis(The ellipsis is a powerful tool for extending functions. Unfortunately this power comes at a cost: misspelled arguments will be silently ignored. The ellipsis package provides a collection of functions to catch problems and alert the user.)
a function:
build jac_list: check name is correct
new_Date <- function(x = double()) {
stopifnot(is.double(x))
structure(x, class = "Date")
}
new_Date(c(-1, 0, 1))
#> [1] "1969-12-31" "1970-01-01" "1970-01-02"
semislv <- function(theta0, lambda0, Phi_fn, Psi_fn, jac = list(), …, method = c(“iterative”, “implicit”), jacobian=FALSE, control=list())
all build function should be the constructor:
https://adv-r.hadley.nz/s3.html
eqfns(class):
$Phi_fn
$Psi_fn
jac(class):
$Phi_der_theta_fn
$Phi_der_lambda_fn
$Psi_der_theta_fn
$Psi_der_lambda_fn
constructor: new_jac -> function() validator: check the expression name if there is (iter2)
quasijac(class):
$Phi_der_theta_fn
$Phi_der_lambda_fn
$Psi_der_theta_fn
$Psi_der_lambda_fn
constructor: new_jac -> function() validator: check the expression name if there is (iter2)
semijac(class):
$Phi_der_theta_fn
$Phi_der_lambda_fn
$Psi_der_theta_fn
$Psi_der_lambda_fn
constructor: new_jac -> function() validator: check the expression name if there is (iter2)
diyjac(class):
$ordered_fn
$itermedials(class)
$return_fn
constructor: new_jac -> function() validator: check the expression name if there is (iter2)
iterspace(class): -> {“ITAT”,“IPAT”,“ITHM”,“IPHM”}
$initials(base list)
$eqfns
$jac_like
$iter_step
$update_delta
$parameters(base list): copy from initial at the step 1
resspace(list)
iterspace -> respace
generic:
update(iterspace) -> (iterspace, iter_over_flag)
update.ITAT
update.IPAT
update.ITHM
update.IPHM
savestats(resspace, iterspace)