get_trend_BIC: Choose smoothing parameter using SIC

Description Usage Arguments Examples

View source: R/get_trend_BIC.R

Description

get_trend_cv Selects smoothing parameter using Schwarz Information

Usage

1
2
3
get_trend_BIC(y, tau, k, lambdaSeq = exp(seq(0, 14, 1)),
  df_tol = 1e-09, gamma = 1, plot_lambda = FALSE, solver = NULL,
  criteria = "eBIC")

Arguments

y

observed data

tau

quantile levels at which to evaluate trend

k

order of differencing

lambdaSeq

smoothing penalty parameter options to compare

df_tol

tolerance for determining degrees of freedom (Dtheta > df_tol)

gamma

parameter for eBIC

plot_lambda

TRUE/FALSE for plotting lambda by model criteria

solver

LP solver, can be "gurobi", "Rglpk", or "lpSolve"

criteria

criteria to use for lambda selection, must be "eBIC", "SIC", or "valid"

Examples

1
2
3
4
5
6
7
8
9
require(Matrix)
n <- 100
x <- seq(1, n, 1)
y <- sin(x*2*pi/n) + rnorm(n, 0, .4)
lambdaSeq <- exp(seq(-2, 5, 1))
k <- 3
tau <- c(0.05, .2)
trend <- get_trend_BIC(y, tau, k, lambdaSeq, plot_lambda = TRUE)
plot(trend$trend[,1]~x, type="l")  

halleybrantley/detrendr documentation built on May 30, 2019, 12:43 p.m.