Skip to contents

Calculate degrees of freedom of MARS

Usage

calc_df_mars(n = 100, p = 10, N = 100, nk = 5, d = 1, penalty = 2, seed = 1234)

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

penalty per knot

seed

random seed for construct x and y

Value

a vector of two elements:

dfcov

empirical df based on covariance formula

dfapp

average df based on mars' approximation formula