simulDiagnosis: Simulation Diagnostics

View source: R/simulDiagnosis.R

simulDiagnosisR Documentation

Simulation Diagnostics

Description

This function provides diagnostics for evaluating the accuracy of simulated data. Specifically, it computes the Mean Squared Error (MSE) between the true and estimated response vectors, and optionally, the sign recovery percentage of the coefficient vector.

Usage

simulDiagnosis(data_Hat, data_True, sgn = FALSE)

Arguments

data_Hat

List containing the estimated high-frequency data, with components y_Est (estimated response vector) and beta_Est (estimated coefficient vector).

data_True

List containing the true high-frequency data, with components y_Gen (true response vector) and Beta_Gen (true coefficient vector).

sgn

Logical value indicating whether to compute the sign recovery percentage. Default is FALSE.

Details

The function takes in the generated high-frequency data (data_True) and the estimated high-frequency data (data_Hat), and returns the Mean Squared Error (MSE) between the true and estimated values of the response vector. If the sgn parameter is set to TRUE, the function additionally computes the percentage of correctly recovered signs of the coefficient vector.

Value

If sgn is FALSE, the function returns the Mean Squared Error (MSE) between the true and estimated response vectors. If sgn is TRUE, the function returns a list containing both the MSE and the sign recovery percentage.

Examples

true_data <- list(y_Gen = c(1, 2, 3), Beta_Gen = c(1, -1, 0))
est_data <- list(y_Est = c(1.1, 1.9, 2.8), beta_Est = c(1, 1, 0))
mse <- simulDiagnosis(est_data, true_data)
results <- simulDiagnosis(est_data, true_data, sgn = TRUE)


DisaggregateTS documentation built on Oct. 31, 2024, 5:09 p.m.