fdp_staplm: Functional Dirichlet Process Spatial Temporal Aggregated...

View source: R/fdp_staplm.R

fdp_staplmR Documentation

Functional Dirichlet Process Spatial Temporal Aggregated Predictor in a Linear Model

Description

Functional Dirichlet Process Spatial Temporal Aggregated Predictor in a Linear Model

Usage

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 = 5L,
  iter_max = 1000,
  burn_in = 500,
  thin = 1,
  chains = 1,
  fix_alpha = FALSE,
  seed = NULL,
  scale = TRUE,
  center = TRUE,
  subsample_yhat = NULL,
  ...
)

Arguments

formula

Similar as for sstap_lm, though fdp_staplm is currently restricted to only one stap term.

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

chains

number of randomly initialized chains to run

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

scale

boolean determining if fixed effects matrix is scaled for estimation

center

boolean determining if fixed effects matrix is centered for estimation

subsample_yhat

integer value indicating how many samples to subsample of yhat samples. Useful when N is big.

...

optional arguments for fdp_staplm.fit

Details

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 a 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 gamma priors, respectively.

Value

a stapDP model object


apeterson91/rstapDP documentation built on Sept. 20, 2023, 9:34 a.m.