pois_vcm_cv.Rd
This function conducts a leave-one-out cross-validation approach to determine the best bandwidth for the data.
pois_vcm_cv( formula, data, time, id = NULL, bandwidths = NULL, kernel = "epanechnikov" )
formula | A formula class object. Provides information about the names of the response and predictor variables. |
---|---|
data | A data frame containing the variables needed for the function. |
time | The name of the variable indicating the time points for each observation. |
id | The name of the variable to group observations. Necessary when dealing with repeated measurements such as longitudinal data. |
bandwidths | A vector containing the bandwidth values for the cross-validation. Default is tests 50 bandwidths from ranging from double the smallest time point difference to range of time points. |
kernel | The name of the kernel function used to estimate the varying-coefficient values. Default is Epanechnikov. |
pois_vcm_cv returns a list containing the results from the cross-validation
recommended_bandwidth: The bandwidth with the smallest negative log-likelihood.
value: value of negative log-likelihood at recommended bandwidth
neg_logliks: The tested bandwidths and their corresponding negative log-likelihood value.
Isaac Quintanilla Salinas
#> [1] "Recommended Bandwidth: 0.0833333333333333" #> [1] "Negative Log-Likelihood Value: 2993.83371402404"