Learn R Programming

SCE (version 1.0.0)

Model_simulation: Perform Simulations using a Trained SCE Model

Description

This function facilitates the simulation of dependent variables based on the specified independent variables utilizing a previously trained SCE model. It generates predictions for training, out-of-bag validation, and testing datasets. The function includes comprehensive input validation for data types, missing values, and predictor matching.

Usage

Model_simulation(Testing_data, model)

Value

A list containing three components:

  • Training: A data.frame containing predictions for the training dataset

  • Validation: A data.frame containing out-of-bag (OOB) predictions

  • Testing: A data.frame containing predictions for the testing dataset

Arguments

Testing_data

A data.frame or matrix comprising the data that will be used to test the model. Must contain all the predictors used in the model. Must not contain missing values.

model

The trained SCE model object generated through the SCE function. This model contains the necessary information and parameters for conducting simulations.

Author

Kailong Li <lkl98509509@gmail.com>

Details

The simulation process involves the following steps:

  1. Input validation:

    • Data type and structure checks (data.frame or matrix)

    • Missing value checks

    • Predictor matching with training data

    • Numeric data validation

  2. Data preparation:

    • Conversion to matrix format

    • Initialization of prediction matrices

  3. Prediction generation:

    • Training predictions using all trees

    • Out-of-bag predictions using trees not trained on each sample

    • Testing predictions using all trees

See Also

SCE