Skip to contents

Solve penalty factor by equating empirical df

Usage

sol_mars_df_and_penalty(n = 20, p = 2, N = 100, nk = 5, d = 1, penalty = NULL)

Arguments

n

sample size

p

number of features

N

number of repetitions

nk

maximum number of model terms before pruning in earth::earth

d

maximum degree of interactions

penalty

the initial penalty. If not specified, it is `d + 1`.

Value

a list of three elements

df_cov

empirical df based on covariance formula

df_app

average df based on mars' approximation formula

penalty

penalty factor

Note

Note that `penalty` only works in the backward procedure, so we do not need to a while loop to ensure the self-consistency.