R/fdp_staplm.R
fdp_staplm.RdFunctional Dirichlet Process Spatial Temporal Aggregated Predictor in a Linear Model
fdp_staplm( formula, benvo, weights = NULL, alpha_a = 1, alpha_b = 1, sigma_a = 1, sigma_b = 1, tau_a = 1, tau_b = 1, K = 5, iter_max = 1000, burn_in = 500, thin = 1, fix_alpha = FALSE, seed = NULL )
| formula | Similar as for |
|---|---|
| benvo | built environment object from the rbenvo package containing the relevant data |
| weights | weights for weighted regression - default is vector of ones |
| alpha_a | alpha gamma prior hyperparameter or alpha if fix_alpha = TRUE |
| alpha_b | alpha gamma prior hyperparameter |
| sigma_a | precision gamma prior hyperparameter |
| sigma_b | precision gamma prior hyperparameter |
| tau_a | penalty parameters gamma prior hyperparameter |
| tau_b | penalty parameters gamma prior hyperparameter |
| K | truncation number |
| iter_max | maximum number of iterations |
| burn_in | number of burn in iterations |
| thin | number by which to thin samples |
| fix_alpha | boolean value indicating whether or not to fix the concentration parameter |
| seed | random number generator seed will be set to default value if not by user |
a stapDP model object
This function fits a linear model in a bayesian paradigm with
improper priors assigned to the "standard" regression covariates designated
in the formula argument and a Dirichlet process prior with normal-gamma base measure
assigned to the stap basis function expansion using penalized splines via jagam.
The concentration parameter is assigned gamma prior with hyperparameters shape alpha_a and scale alpha_b. Precision parameters sigma_a,sigma_b, tau_a,tau_b are similar for the residual and penalties' precision, respectively.