psfm: psfm

View source: R/psfm.R

psfmR Documentation

psfm

Description

Main panel function of package

Usage

psfm(formula, model_name = c("TRE_Z", "GTRE_Z", "TRE", "GTRE", "WMLE", "FD", "GTRE_SEQ1", "GTRE_SEQ2"), data, maxit.bobyqa = 100, maxit.psoptim = 10, maxit.optim = 10, REPORT = 1, trace = 3, pgtol = 0, individual, halton_num = NULL, start_val = FALSE, gamma = FALSE, PSopt = FALSE, bob = TRUE, optHessian = TRUE, inefdec = TRUE, Method = "L-BFGS-B")

Arguments

formula

a symbolic description for the model to be estimated

model_name

model name for the estimation

data

a pdata.frame

maxit.bobyqa

Maximum number of iterations for the bobyqa optimization routine

maxit.psoptim

Maximum number of iterations for the psoptim optimization routine

maxit.optim

Maximum number of iterations for the optim optimization routine

REPORT

reporting parameter

trace

trace

pgtol

pgtol

individual

individual unit in the regression model

halton_num

number of Halton draws to use in SML models

start_val

starting value (optional)

gamma

gamma

PSopt

use psoptim optimization routine (T/F)

bob

use bobyqa optimization routine (T/F)

optHessian

Logical. Should a numerically differentiated Hessian matrix be returned? (for optim routine)

inefdec

Production or cost function

Method

The method to be used for optim. See ‘Details’ within optim.

Note

The generalized true random effects model (GTRE, 4-component model) and true random effects models (TRE) are both estimated by simulated maximum likelihood based on the paper by the Fillipini and Greene (2016, JPA). The TRE_Z and GTRE_Z allow for modeling the u-component of the GTRE and TRE with determinants of inefficiency. The first-difference model (FD) of Wang and Ho (2010, JoE) as well as the within-maximum likelihood (WMLE) of Chen, Schmidt and Wang (2014, JoE) are also available.

Author(s)

David Bernstein

References

Fillipini and Greene (2016, JPA); Wang and Ho (2010, JoE); Chen, Schmidt and Wang (2014, JoE)

See Also

NA

Examples

data_trial <- data_gen_p(t=10,N=100, rand = 100, 
                         sig_u = 1,  sig_v = 0.3, 
                         sig_r = .2, sig_h = .4, 
                         cons = 0.5, beta1 = 0.5,
                         beta2 = 0.5)
## Trial runs:
max_fd          <-   psfm(formula = y_fd ~  x_fd|z_fd,
                          model_name = "FD",  
                          data=data_trial, 
                          individual = "name")

max_tre_z   <-  psfm(formula    = y_tre_z ~ x1 +x2| z_gtre, 
                     model_name = "TRE",                    ## "TRE_Z" also works
                     data       = p.data,
                     individual = "name",
                     PSopt      = TRUE)

max_gtre         <-   psfm(formula = y_gtre ~ x1+x2,    
                           model_name = "GTRE", 
                           data=data_trial,
                           individual = "name")

max_tre    <-   psfm(formula = y_tre ~  x1+x2,    
                     model_name = "TRE",  
                     data=data_trial, 
                     individual = "name")

max_wmle   <-   psfm(formula = y_wmle~ x1_w + x2_w,
                     model_name = "WMLE",
                     data=data_trial,
                     individual = "name")

davidhbernstein/sfm documentation built on Feb. 28, 2025, 1:17 a.m.