README.md

movingknots: Efficient Bayesian multivariate surface regression

Efficient Bayesian multivariate surface regression that combines both additive splines and interactive splines, and a highly efficient Markov chain Monte Carlo algorithm to update all the knot locations jointly.

The code is written in native R and should be compatible with R version >= 2.12

Copyright & Citation

This code is base on our published paper:

@article{li2013efficient,
  title={Efficient Bayesian multivariate surface regression},
  author={Li, Feng and Villani, Mattias},
  journal={Scandinavian Journal of Statistics},
  volume={40},
  number={4},
  pages={706--723},
  year={2013},
  publisher={Wiley Online Library}
}

Installation

devtools::install_github("feng-li/flutils")
devtools::install_github("feng-li/movingknots")

Run the code

Please take a look at the inst/examples folder which contains a few setup templates for configuring the model. You should edit the file to point the location of flutils.

Run inside R

source(file.path(system.file(package = "movingknots"), "examples","RUN_rajan_s_moving_2_plus_a_moving2.R"))
source(file.path(system.file(package = "movingknots"), "examples","RUN_rajan_s_moving_2_plus_a_moving2_SGLD.R"))

Run with Rscript (with Linux)

chmod +x movingknots/inst/examples/RUN_rajan_s_moving_2_plus_a_moving2.R
chmod +x movingknots/inst/examples/RUN_rajan_s_moving_2_plus_a_moving2_SGLD.R
./movingknots/inst/examples/RUN_rajan_s_moving_2_plus_a_moving2.R
./movingknots/inst/examples/RUN_rajan_s_moving_2_plus_a_moving2_SGLD.R

Help and bug reports

Please visit issues for bug reports. For further assistance, please contact the package author Feng Li feng.li@cufe.edu.cn.



feng-li/movingknots documentation built on March 30, 2021, 11:58 a.m.