-
Notifications
You must be signed in to change notification settings - Fork 21
Installation
install.packages("smooth")if (!require("remotes")) install.packages("remotes")
remotes::install_github("config-i1/smooth")Depends:
- R >= 3.0.2
- greybox >= 2.0.2
Imports:
- Rcpp, nloptr, zoo, pracma, statmod, MASS, xtable, generics, stats, graphics, methods
LinkingTo:
- Rcpp >= 0.12.3
- RcppArmadillo >= 0.8.100.0.0
Linux: No special requirements; BLAS/LAPACK typically pre-installed.
macOS: gfortran is required. Install via:
# Using Homebrew
brew install gcc
# Or download from CRAN
# https://mac.r-project.org/tools/See thecoatlessprofessor.com for detailed macOS instructions.
Windows: Standard R build tools (Rtools) should be sufficient.
Sometimes after upgrading smooth, C++ functions are cached incorrectly. Solutions:
- Restart R session
- If that doesn't work:
remove.packages("smooth") # Delete the "smooth" folder from R packages directory # Restart R install.packages("smooth")
If you see errors about -lgfortran or -lquadmath:
- Install gfortran from CRAN tools or via Homebrew
- Ensure gfortran is in your PATH
- Restart R and retry installation
library(smooth)
packageVersion("smooth")
# Test basic functionality
data <- rnorm(100)
model <- adam(data, model="ANN")
print(model)pip install smoothImportant: This package includes C++ extensions that require compilation. You must have a C++ compiler, CMake, and Armadillo installed before running pip install. See System Requirements below.
pip install "git+https://github.com/config-i1/smooth.git@master#subdirectory=python"Python Version:
- Python >= 3.10
Runtime Dependencies:
- numpy
- pandas
- scipy
- nlopt
- statsmodels
- pybind11
Build Dependencies:
- cmake >= 3.25
- scikit-build-core
- ninja
C++ Compiler:
- Linux: g++ (usually pre-installed, or
sudo apt install g++) - macOS: Xcode Command Line Tools (
xcode-select --install) - Windows: Visual Studio Build Tools with C++ workload
Linux (Debian/Ubuntu):
sudo apt update
sudo apt install libblas-dev liblapack-dev libarmadillo-dev cmake ninja-buildLinux (Fedora/RHEL):
sudo dnf install blas-devel lapack-devel armadillo-devel cmake ninja-buildmacOS:
brew install armadillo cmake ninjaWindows: Install Visual Studio Build Tools with C++ workload.
If you get import errors about nlopt:
pip install nloptOn some systems, you may need the system nlopt library:
# Debian/Ubuntu
sudo apt install libnlopt-dev
# macOS
brew install nloptIf compilation fails with Armadillo errors:
- Install Armadillo development headers (see System Requirements)
- Ensure CMake can find Armadillo:
pkg-config --cflags --libs armadillo
import smooth
print(smooth.__version__)
# Test basic functionality
import numpy as np
from smooth import ADAM
data = np.random.randn(100)
model = ADAM(model="ANN")
model.fit(data)
print(model.summary())