train_GAM: Train a Generalized Additive Model on Simulation Data

View source: R/learning_GAM.R

train_GAMR Documentation

Train a Generalized Additive Model on Simulation Data

Description

This function fits a Generalized Additive Model (GAM) to the provided simulation results. It models the log-likelihood of simulation success ('loglik') as a function of the simulation parameters, using smooth terms for each parameter. Only simulations that completed successfully are used for the model fitting.

Usage

train_GAM(results)

Arguments

results

A list containing simulation results with the following components: - 'loglik_estimation': A list of log-likelihood values or 'try-error' objects. - 'trees': A list of data frames, each containing tree data. - 'param': A list of named vectors containing the simulation parameters 'mu', 'lambda', 'betaN', and 'betaP'.

Value

A 'gam' object representing the fitted model.

Examples

# Assuming 'results' is your list of simulation results:
gam_model <- train_GAM(results)
summary(gam_model)


franciscorichter/emphasis documentation built on Feb. 19, 2024, 7:36 p.m.