├── .Rbuildignore ├── .gitignore ├── .travis.yml ├── DESCRIPTION ├── NAMESPACE ├── R ├── glm.r ├── glmnet.r ├── irls.r ├── lars.r ├── lmnet.r ├── lp.r ├── net_util.r ├── ols.r ├── pcr.r ├── ridge.r └── rlm.r ├── README.md ├── appveyor.yml ├── doc ├── Bay-Area-UseR-2015 │ ├── index.html │ └── lib │ │ ├── fonts │ │ ├── asul │ │ │ ├── asul-bold.ttf │ │ │ ├── asul-bold.woff │ │ │ ├── asul-regular.ttf │ │ │ ├── asul-regular.woff │ │ │ └── asul.css │ │ ├── cabinsketch │ │ │ ├── cabinsketch-bold.ttf │ │ │ ├── cabinsketch-bold.woff │ │ │ ├── cabinsketch-regular.ttf │ │ │ ├── cabinsketch-regular.woff │ │ │ └── cabinsketch.css │ │ ├── josefinsans │ │ │ ├── josefinsans-bold.ttf │ │ │ ├── josefinsans-bold.woff │ │ │ ├── josefinsans-bolditalic.ttf │ │ │ ├── josefinsans-bolditalic.woff │ │ │ ├── josefinsans-italic.ttf │ │ │ ├── josefinsans-italic.woff │ │ │ ├── josefinsans-regular.ttf │ │ │ ├── josefinsans-regular.woff │ │ │ └── josefinsans.css │ │ ├── katex │ │ │ ├── KaTeX_AMS-Regular.ttf │ │ │ ├── KaTeX_AMS-Regular.woff │ │ │ ├── KaTeX_Main-Bold.ttf │ │ │ ├── KaTeX_Main-Bold.woff │ │ │ ├── KaTeX_Main-Italic.ttf │ │ │ ├── KaTeX_Main-Italic.woff │ │ │ ├── KaTeX_Main-Regular.ttf │ │ │ ├── KaTeX_Main-Regular.woff │ │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ │ ├── KaTeX_Math-BoldItalic.woff │ │ │ ├── KaTeX_Math-Italic.ttf │ │ │ ├── KaTeX_Math-Italic.woff │ │ │ ├── KaTeX_Math-Regular.ttf │ │ │ ├── KaTeX_Math-Regular.woff │ │ │ ├── KaTeX_Size1-Regular.ttf │ │ │ ├── KaTeX_Size1-Regular.woff │ │ │ ├── KaTeX_Size2-Regular.ttf │ │ │ ├── KaTeX_Size2-Regular.woff │ │ │ ├── KaTeX_Size3-Regular.ttf │ │ │ ├── KaTeX_Size3-Regular.woff │ │ │ ├── KaTeX_Size4-Regular.ttf │ │ │ └── KaTeX_Size4-Regular.woff │ │ ├── lato │ │ │ ├── lato-bold.ttf │ │ │ ├── lato-bold.woff │ │ │ ├── lato-bolditalic.ttf │ │ │ ├── lato-bolditalic.woff │ │ │ ├── lato-italic.ttf │ │ │ ├── lato-italic.woff │ │ │ ├── lato-regular.ttf │ │ │ ├── lato-regular.woff │ │ │ └── lato.css │ │ ├── league │ │ │ ├── league_gothic.css │ │ │ ├── league_gothic.ttf │ │ │ ├── league_gothic.woff │ │ │ └── league_gothic_license │ │ ├── merriweathersans │ │ │ ├── merriweathersans-bold.ttf │ │ │ ├── merriweathersans-bold.woff │ │ │ ├── merriweathersans-regular.ttf │ │ │ ├── merriweathersans-regular.woff │ │ │ └── merriweathersans.css │ │ ├── montserrat │ │ │ ├── montserrat-bold.ttf │ │ │ ├── montserrat-bold.woff │ │ │ ├── montserrat-regular.ttf │ │ │ ├── montserrat-regular.woff │ │ │ └── montserrat.css │ │ ├── newscycle │ │ │ ├── newscycle-bold.ttf │ │ │ ├── newscycle-bold.woff │ │ │ ├── newscycle-regular.ttf │ │ │ ├── newscycle-regular.woff │ │ │ └── newscycle.css │ │ ├── opensans │ │ │ ├── opensans-bold.ttf │ │ │ ├── opensans-bold.woff │ │ │ ├── opensans-bolditalic.ttf │ │ │ ├── opensans-bolditalic.woff │ │ │ ├── opensans-italic.ttf │ │ │ ├── opensans-italic.woff │ │ │ ├── opensans-regular.ttf │ │ │ ├── opensans-regular.woff │ │ │ └── opensans.css │ │ ├── overpass │ │ │ ├── overpass-bold.ttf │ │ │ ├── overpass-bold.woff │ │ │ ├── overpass-light.ttf │ │ │ ├── overpass-light.woff │ │ │ ├── overpass-regular.ttf │ │ │ ├── overpass-regular.woff │ │ │ └── overpass.css │ │ ├── oxygen │ │ │ ├── oxygen-bold.ttf │ │ │ ├── oxygen-bold.woff │ │ │ ├── oxygen-regular.ttf │ │ │ ├── oxygen-regular.woff │ │ │ └── oxygen.css │ │ └── quicksand │ │ │ ├── quicksand-bold.ttf │ │ │ ├── quicksand-bold.woff │ │ │ ├── quicksand-regular.ttf │ │ │ ├── quicksand-regular.woff │ │ │ └── quicksand.css │ │ ├── head.min.js │ │ ├── offline-v1.css │ │ ├── offline-v2.css │ │ ├── reveal-plugins │ │ ├── highlight │ │ │ └── highlight.js │ │ ├── markdown │ │ │ ├── markdown.js │ │ │ └── marked.js │ │ └── notes │ │ │ ├── notes.html │ │ │ └── notes.js │ │ ├── reveal.css │ │ └── reveal.min.js └── NESS-2015-Presentation │ ├── index.html │ ├── lib │ ├── fonts │ │ ├── asul │ │ │ ├── asul-bold.ttf │ │ │ ├── asul-bold.woff │ │ │ ├── asul-regular.ttf │ │ │ ├── asul-regular.woff │ │ │ └── asul.css │ │ ├── cabinsketch │ │ │ ├── cabinsketch-bold.ttf │ │ │ ├── cabinsketch-bold.woff │ │ │ ├── cabinsketch-regular.ttf │ │ │ ├── cabinsketch-regular.woff │ │ │ └── cabinsketch.css │ │ ├── josefinsans │ │ │ ├── josefinsans-bold.ttf │ │ │ ├── josefinsans-bold.woff │ │ │ ├── josefinsans-bolditalic.ttf │ │ │ ├── josefinsans-bolditalic.woff │ │ │ ├── josefinsans-italic.ttf │ │ │ ├── josefinsans-italic.woff │ │ │ ├── josefinsans-regular.ttf │ │ │ ├── josefinsans-regular.woff │ │ │ └── josefinsans.css │ │ ├── katex │ │ │ ├── KaTeX_AMS-Regular.ttf │ │ │ ├── KaTeX_AMS-Regular.woff │ │ │ ├── KaTeX_Main-Bold.ttf │ │ │ ├── KaTeX_Main-Bold.woff │ │ │ ├── KaTeX_Main-Italic.ttf │ │ │ ├── KaTeX_Main-Italic.woff │ │ │ ├── KaTeX_Main-Regular.ttf │ │ │ ├── KaTeX_Main-Regular.woff │ │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ │ ├── KaTeX_Math-BoldItalic.woff │ │ │ ├── KaTeX_Math-Italic.ttf │ │ │ ├── KaTeX_Math-Italic.woff │ │ │ ├── KaTeX_Math-Regular.ttf │ │ │ ├── KaTeX_Math-Regular.woff │ │ │ ├── KaTeX_Size1-Regular.ttf │ │ │ ├── KaTeX_Size1-Regular.woff │ │ │ ├── KaTeX_Size2-Regular.ttf │ │ │ ├── KaTeX_Size2-Regular.woff │ │ │ ├── KaTeX_Size3-Regular.ttf │ │ │ ├── KaTeX_Size3-Regular.woff │ │ │ ├── KaTeX_Size4-Regular.ttf │ │ │ └── KaTeX_Size4-Regular.woff │ │ ├── lato │ │ │ ├── lato-bold.ttf │ │ │ ├── lato-bold.woff │ │ │ ├── lato-bolditalic.ttf │ │ │ ├── lato-bolditalic.woff │ │ │ ├── lato-italic.ttf │ │ │ ├── lato-italic.woff │ │ │ ├── lato-regular.ttf │ │ │ ├── lato-regular.woff │ │ │ └── lato.css │ │ ├── league │ │ │ ├── league_gothic.css │ │ │ ├── league_gothic.ttf │ │ │ ├── league_gothic.woff │ │ │ └── league_gothic_license │ │ ├── merriweathersans │ │ │ ├── merriweathersans-bold.ttf │ │ │ ├── merriweathersans-bold.woff │ │ │ ├── merriweathersans-regular.ttf │ │ │ ├── merriweathersans-regular.woff │ │ │ └── merriweathersans.css │ │ ├── montserrat │ │ │ ├── montserrat-bold.ttf │ │ │ ├── montserrat-bold.woff │ │ │ ├── montserrat-regular.ttf │ │ │ ├── montserrat-regular.woff │ │ │ └── montserrat.css │ │ ├── newscycle │ │ │ ├── newscycle-bold.ttf │ │ │ ├── newscycle-bold.woff │ │ │ ├── newscycle-regular.ttf │ │ │ ├── newscycle-regular.woff │ │ │ └── newscycle.css │ │ ├── opensans │ │ │ ├── opensans-bold.ttf │ │ │ ├── opensans-bold.woff │ │ │ ├── opensans-bolditalic.ttf │ │ │ ├── opensans-bolditalic.woff │ │ │ ├── opensans-italic.ttf │ │ │ ├── opensans-italic.woff │ │ │ ├── opensans-regular.ttf │ │ │ ├── opensans-regular.woff │ │ │ └── opensans.css │ │ ├── overpass │ │ │ ├── overpass-bold.ttf │ │ │ ├── overpass-bold.woff │ │ │ ├── overpass-light.ttf │ │ │ ├── overpass-light.woff │ │ │ ├── overpass-regular.ttf │ │ │ ├── overpass-regular.woff │ │ │ └── overpass.css │ │ ├── oxygen │ │ │ ├── oxygen-bold.ttf │ │ │ ├── oxygen-bold.woff │ │ │ ├── oxygen-regular.ttf │ │ │ ├── oxygen-regular.woff │ │ │ └── oxygen.css │ │ └── quicksand │ │ │ ├── quicksand-bold.ttf │ │ │ ├── quicksand-bold.woff │ │ │ ├── quicksand-regular.ttf │ │ │ ├── quicksand-regular.woff │ │ │ └── quicksand.css │ ├── head.min.js │ ├── offline-v1.css │ ├── offline-v2.css │ ├── reveal-plugins │ │ ├── highlight │ │ │ └── highlight.js │ │ ├── markdown │ │ │ ├── markdown.js │ │ │ └── marked.js │ │ └── notes │ │ │ ├── notes.html │ │ │ └── notes.js │ ├── reveal.css │ └── reveal.min.js │ └── scalable-exact-approaches-to-fitting-linear-models-when-n-p │ └── 1309455-Screen_Shot_2015-04-24_at_10.55.15_PM.png ├── inst └── ref-impl │ └── glmnet-ref.r └── tests ├── testthat.r └── testthat ├── test-ioglm.r ├── test-iolm.r ├── test-iolmnet.r ├── test-lars.r └── test-ridge.r /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | appveyor.yml 4 | .git 5 | .travis.yml 6 | .gitignore 7 | doc 8 | scratch 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: r 2 | sudo: required 3 | warnings_are_errors: false 4 | 5 | r_binary_packages: 6 | - lars 7 | 8 | r_github_packages: 9 | - s-u/iotools 10 | - kaneplusplus/adf 11 | - jimhester/covr 12 | 13 | after_success: 14 | - Rscript -e 'library(covr);coveralls()' 15 | 16 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: ioregression 2 | Type: Package 3 | Title: Out-of-Core Regressions with Connection Inputs 4 | Version: 0.4 5 | Date: 2015-05-26 6 | Author: Taylor Arnold, Michael J. Kane, Simon Urbanek 7 | Maintainer: Michael J. Kane 8 | Description: Implements out-of-core regression 9 | routines (OLS, GLM, LARS, Ridge) and can be used with any input 10 | implemented as an R connection. 11 | Depends: 12 | adf, 13 | lars, 14 | Matrix 15 | Suggests: 16 | testthat 17 | License: GPL-2 18 | RoxygenNote: 6.0.1 19 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | S3method(coef,iolm.lars) 4 | S3method(predict,ioglm) 5 | S3method(print,ioglm) 6 | S3method(print,iolars) 7 | S3method(print,iolm) 8 | S3method(print,iolm.pcr) 9 | S3method(print,iolm.ridge) 10 | S3method(print,iolp) 11 | S3method(print,iorlm) 12 | S3method(print,summary.iolm) 13 | S3method(summary,ioglm) 14 | S3method(summary,iolm) 15 | export(glmnet) 16 | export(ioglm) 17 | export(iolm) 18 | export(iolm.lars) 19 | export(iolm.pcr) 20 | export(iolm.ridge) 21 | export(iolmnet) 22 | export(iolp) 23 | export(iorlm) 24 | importFrom(Matrix,Matrix) 25 | importFrom(Matrix,colSums) 26 | importFrom(Matrix,crossprod) 27 | importFrom(Matrix,diag) 28 | importFrom(Matrix,solve) 29 | importFrom(Matrix,sparse.model.matrix) 30 | importFrom(adf,adf.apply) 31 | importFrom(adf,allFactorLevels) 32 | importFrom(lars,delcol) 33 | importFrom(lars,nnls.lars) 34 | importFrom(lars,updateR) 35 | -------------------------------------------------------------------------------- /R/glm.r: -------------------------------------------------------------------------------- 1 | #' @importFrom Matrix sparse.model.matrix 2 | #' @export 3 | predict.ioglm <- function(object, newdata, 4 | type=c("link", "response"), 5 | na.action = na.pass, ...) { 6 | current_na_action <- options()$na.action 7 | options(na.action=na.action) 8 | if (inherits(newdata, "data.frame")) { 9 | new_data_mm <- model.matrix(object$formula, newdata, 10 | contrasts=object$contrasts, 11 | na.action=na.action) 12 | if (type[1] == "link") { 13 | ret <- na.action((new_data_mm %*% object$coefficients)[,1]) 14 | } else if (type[1] == "response") { 15 | ret <- na.action( 16 | object$family$linkinv( (new_data_mm %*% object$coefficients)[,1] )) 17 | } else { 18 | options(na.action=current_na_action) 19 | stop(paste0('Unknown type "', type, '".')) 20 | } 21 | } else { 22 | options(na.action=current_na_action) 23 | stop(paste0("Don't know how to predict when new data is of class", 24 | class(newdata), ".")) 25 | } 26 | options(na.action=current_na_action) 27 | ret 28 | } 29 | 30 | #' Perform a generalized linear regression 31 | #' 32 | #' @importFrom Matrix solve crossprod 33 | #' @param formula the formula for the regression 34 | #' @param family a description of the error distribution and link function to 35 | #' be used in the model. This can be a character string naming a 36 | #' family function, a family function or the result of a call to 37 | #' a family function. 38 | #' @param data an abstract data frame, or something which can be 39 | #' coerced to one. 40 | #' @param weights a optional character string, which will be evaluated in the 41 | #' frame of the data, giving the sample weights for the regression 42 | #' @param subset an options character string, which will be evaluated in the 43 | #' frame of the data, to indicate which rows to include 44 | #' in the analysis 45 | #' @param na.action a function which indicates what should happen when the data 46 | #' contain 'NA's. See lm.fit for more details. 47 | #' @param start starting values for the parameters in the linear predictor. 48 | #' @param etastart starting values for the linear predictor. 49 | #' @param mustart starting values for the vector of means. 50 | #' @param offset a optional character string, which will be evaluated in the 51 | #' frame of the data, giving the offsets for the regression 52 | #' @param control a list of parameters for controlling the fitting process. 53 | #' @param contrasts contrasts to use with the regression. 54 | #' See the \code{contrasts.arg} of \code{model.matrix.default} 55 | #' @param trace logical indicating if output should be produced for each 56 | #' iteration. 57 | #' @param tol numeric tolerance when calling solve. 58 | #' @importFrom adf adf.apply 59 | #' @export 60 | ioglm <- function(formula, family=gaussian, data, weights=NULL, subset=NULL, 61 | na.action=NULL, start=NULL, etastart, mustart, offset=NULL, 62 | control=list(), contrasts=NULL, trace=FALSE, 63 | tol=2*.Machine$double.eps) { 64 | 65 | ret <- ioirls(formula, family, data, weights, subset, na.action, start, 66 | etastart, mustart, offset, control, contrasts, trace, 67 | tol, glm_update_fun) 68 | class(ret) <- c("ioglm", "iolm") 69 | ret 70 | } 71 | 72 | glm_update_fun <- function(XTWX, XTWz, tol) { 73 | Matrix::solve(XTWX, XTWz, tol) 74 | } 75 | 76 | glm_kernel <- function(d, passedVars=NULL) { 77 | if (nrow(d$x) == 0L) { 78 | return(NULL) 79 | } 80 | if (!is.null(d$w)) { 81 | if (any(d$w == 0)) { 82 | ok <- d$w != 0 83 | d$w <- d$w[ok] 84 | d$x <- d$x[ok,,drop = FALSE] 85 | d$y <- d$y[ok] 86 | if (!is.null(d$offset)) { 87 | d$offset <- d$offset[ok] 88 | } 89 | } 90 | sum_y <- sum(d$y * d$w) 91 | sum_w <- sum(d$w) 92 | } else { 93 | sum_y <- sum(d$y) 94 | sum_w <- nrow(d$x) 95 | } 96 | nobs <- length(d$y) 97 | offset <- if (!is.null(d$offset)) d$offset else rep.int(0,nobs) 98 | weights <- if (!is.null(d$w)) d$w else rep(1, nobs) 99 | family <- passedVars$family 100 | if (is.null(passedVars$beta)) { 101 | # It's the first iteration. 102 | etastart <- start <- mustart <- NULL 103 | y <- d$y 104 | eval(family$initialize) 105 | eta <- family$linkfun(mustart) 106 | } else { 107 | eta <- as.numeric(d$x %*% passedVars$beta) 108 | } 109 | g <- family$linkinv(eta <- eta + offset) 110 | gprime <- family$mu.eta(eta) 111 | residuals <- (d$y-g)/gprime 112 | z <- eta - offset + residuals 113 | W <- as.vector(weights * gprime^2 / family$variance(g)) 114 | aic <- NULL 115 | null_dev <- NULL 116 | if (!is.null(passedVars$cw) && !is.null(passedVars$wtdmu)) { 117 | wtdmu <- passedVars$wtdmu 118 | if (length(wtdmu) == 1 && length(d$y != 1)) { 119 | wtdmu <- rep(wtdmu, length(d$y)) 120 | } 121 | null_dev <- sum(family$dev.resids(d$y, wtdmu, weights)) 122 | } 123 | RSS <- sum(W*residuals^2) 124 | deviance <- sum(family$dev.resids(d$y, g, weights)) 125 | if (!is.null(passedVars$deviance) && !is.null(passedVars$cw)) { 126 | aic <- family$aic(d$y, length(d$y), g, weights, deviance) 127 | } 128 | list(XTWX=Matrix::crossprod(d$x, W * d$x), XTWz=Matrix::crossprod(d$x, W*z), 129 | deviance=deviance, null_dev=null_dev, cumulative_weight=sum(d$w), 130 | nobs=nobs, aic=aic, RSS=RSS, contrasts=attr(d$x, "contrasts"), 131 | wy=Matrix::crossprod(sqrt(weights), d$y), 132 | wx_norm=Matrix::colSums(W*d$x^2)) 133 | } 134 | 135 | #' Print ioglm object 136 | #' 137 | #' @method print ioglm 138 | #' @param x output of iolm 139 | #' @param ... optional arguments passed to print.glm 140 | #' @export 141 | print.ioglm <- function (x, ...) { 142 | class(x) <- "glm" 143 | print(x) 144 | } 145 | 146 | #' Get the regression diagnostics for a linear regression 147 | #' 148 | #' @method summary ioglm 149 | #' 150 | #' @param object an object return from ioglm 151 | #' @param ... optional, currently unused, arguments 152 | #' @export 153 | summary.ioglm <- function(object, ...) { 154 | call <- object$call 155 | terms <- object$terms 156 | dispersion <- object$dispersion 157 | inv_scatter <- solve(object$xtwx) 158 | standard_errors <- sqrt(dispersion * diag(inv_scatter)) 159 | stat_vals <- object$coefficients/standard_errors 160 | if (object$family$family %in% c("binomial", "poisson")) { 161 | p_vals <- 2 * pnorm(abs(stat_vals), lower.tail=FALSE) 162 | } else { 163 | p_vals <- 2 * pt(abs(stat_vals), df=object$df, lower.tail=FALSE) 164 | } 165 | coef_names <- names(object$coefficients) 166 | coefficients <- cbind(object$coefficients, standard_errors, stat_vals, p_vals) 167 | colnames(coefficients) <- c("Estimate", "Std. Error", "t value", "Pr(>|z|)") 168 | rownames(coefficients) <- coef_names 169 | if (object$family$family %in% c("binomial", "poisson")) { 170 | colnames(coefficients)[3] <- "z value" 171 | } 172 | aliased <- object$coefficients 173 | aliased <- FALSE 174 | ret <- list(call=call, 175 | terms=terms, 176 | family=object$family, 177 | deviance=object$deviance, 178 | aic=object$aic, 179 | contrasts=object$contrasts, 180 | df.residual=object$df.residual, 181 | null.deviance=object$null.deviance, 182 | df.null=object$df.null, 183 | iter=object$iter, 184 | deviance.resid=NA, 185 | coefficients=coefficients, 186 | aliased=aliased, 187 | dispersion=object$dispersion, 188 | df=c(ncol(object$xtwx), object$df.residual, ncol(object$xtwx)), 189 | data=object$data, 190 | cov.unscaled=inv_scatter, 191 | cov.scaled=inv_scatter * dispersion) 192 | class(ret) = c("summary.glm") 193 | ret 194 | } 195 | -------------------------------------------------------------------------------- /R/glmnet.r: -------------------------------------------------------------------------------- 1 | 2 | #' Fit a generalized linear model with lasso or elasticnet regularization. 3 | #' 4 | #' Fit a generalized linear model via penalized maximum likelihood. 5 | #' The regularization path is computed for the lasso or elasticnet 6 | #' penalty at a grid of values for the regularization parameter 7 | #' lambda. The function can deal data frames or abstract data frames. 8 | #' @param formula the formula for the regression 9 | #' @param family a description of the error distribution and link function 10 | #' to be used in the model. 11 | #' @param data an abstract data frame or something that can be coerced into one. 12 | #' @param subset an options character string, which will be evaluated in the 13 | #' frame of the data, to indicate which rows to include in the analysis 14 | #' @param weights a optional character string, which will be evaluated in the 15 | #' frame of the data, giving the sample weights for the 16 | #' regression. 17 | #' @param na.action a function which indicates what should happen when the data 18 | #' contain 'NA's. See lm.fit for more details. 19 | #' @param start starting values for the parameters in the linear predictor. 20 | #' @param etastart starting values for the linear predictor. 21 | #' @param mustart starting values for the vector of means. 22 | #' @param offset a optional character string, which will be evaluated in the 23 | #' frame of the data, giving the offsets for the regression 24 | #' @param control a list of parameters for controlling the fitting process. 25 | #' @param alpha the elasticnet mixing parameter 0 <= alpha <= 1. 26 | #' @param lambda a user supplied value (or sequence of values) for the penalty 27 | #' parameter. If not specified then a regularization path is created based 28 | #' on the data. 29 | #' @param contrasts contrasts to use with the regression. See the 30 | #' \code{contrasts.arg} of \code{model.matrix.default} 31 | #' @param standardize should the regression variables be normalized to have 32 | #' mean zero and standard deviation one? 33 | #' @param tol numeric tolerance. 34 | #' @param max_it the maximum number of iterations per regression. 35 | #' @param lambda_epsilon this value is multiplied by the max lambda in the 36 | #' data to determine the minimum lambda when the regularization path is 37 | #' determined from the data. This is ignored when lambda is specified. 38 | #' @param nlambdas the number of lambdas to be generated in the regularization 39 | #' path. This is ignored when lambda is specified. 40 | #' @export 41 | glmnet = function(formula, family, data, subset=NULL, weights=NULL, 42 | na.action=NULL, start=NULL, etastart, mustart, 43 | offset=NULL, control=list(), alpha=1, 44 | lambda=NULL, contrasts=NULL, standardize=FALSE, tol=1e-7, 45 | max_it=1e+05, lambda_epsilon=0.0001, nlambdas=100) { 46 | ret = ioirls(formula, family, data, weights, subset, na.action, start, 47 | etastart, mustart, offset, control, contrasts, trace, 48 | tol, glmnet_coordinate_descent_gen(lamda, alpha)) 49 | class(ret) = c("ioglmnet") 50 | ret 51 | } 52 | 53 | partial_beta_kernel = function() { 54 | if (nrow(d$x) == 0L) return(NULL) 55 | if (!is.null(d$w)) { 56 | if (any(d$w == 0)) { 57 | ok = d$w != 0 58 | d$w = d$w[ok] 59 | d$x = d$x[ok,,drop = FALSE] 60 | d$y = d$y[ok] 61 | if (!is.null(d$offset)) d$offset = d$offset[ok] 62 | } 63 | } 64 | offset <- if (!is.null(d$offset)) d$offset else offset = rep.int(0,nobs) 65 | weights <- if (!is.null(d$w)) d$w else rep(1, nobs) 66 | family = passedVars$family 67 | 68 | eta = as.numeric(d$x %*% passedVars$beta) 69 | g = family$linkinv(eta <- eta + offset) 70 | gprime = family$mu.eta(eta) 71 | residuals = (d$y-g)/gprime 72 | z = eta - offset + residuals 73 | W = as.vector(weights * gprime^2 / family$variance(g)) 74 | beta_new = rep(NA, length(beta)) 75 | for (l in 1:length(beta_new)) { 76 | beta_new[l] = W * d$x[,l] * (z - d$x[,-l] %*% beta) 77 | } 78 | list(partial_beta=beta_new) 79 | } 80 | 81 | quad_loss_kernel = function() { 82 | if (nrow(d$x) == 0L) return(NULL) 83 | if (!is.null(d$w)) { 84 | if (any(d$w == 0)) { 85 | ok = d$w != 0 86 | d$w = d$w[ok] 87 | d$x = d$x[ok,,drop = FALSE] 88 | d$y = d$y[ok] 89 | if (!is.null(d$offset)) d$offset = d$offset[ok] 90 | } 91 | } 92 | offset <- if (!is.null(d$offset)) d$offset else offset = rep.int(0,nobs) 93 | weights <- if (!is.null(d$w)) d$w else rep(1, nobs) 94 | family = passedVars$family 95 | 96 | eta = as.numeric(d$x %*% passedVars$beta) 97 | g = family$linkinv(eta <- eta + offset) 98 | gprime = family$mu.eta(eta) 99 | residuals = (d$y-g)/gprime 100 | z = eta - offset + residuals 101 | W = as.vector(weights * gprime^2 / family$variance(g)) 102 | list(partial_quad_loss = W * (z - d$x %*% beta)^2) 103 | } 104 | 105 | glmnet_coordinate_descent_gen <- function(lambda, alpha) { 106 | function() { 107 | quad_loss_new = Inf 108 | for (i in seq_len(control$maxit)) { 109 | pvar = list(beta=beta, family=family) 110 | cvs = adf.apply(x=data, type="sparse.model", FUN=partial_beta_kernel, 111 | args=pvar, formula=formula, subset=subset, 112 | weights=weights, na.action=na.action, offset=offset, 113 | contrasts=contrasts) 114 | beta_new = Reduce(`+`, Map(function(x) x$partial_beta, cvs)) 115 | beta_new = soft_thresh(beta_new, cumulative_weight*lambda*alpha) 116 | beta_new = beta_new / (wx_norm + lambda *(1-alpha)) 117 | 118 | pvar$beta = beta_new 119 | partial_quad_loss = adf.apply(x=data, type="sparse.model", 120 | FUN=partial_beta_kernel, 121 | args=pvar, formula=formula, subset=subset, 122 | weights=weights, na.action=na.action, 123 | offset=offset, contrasts=contrasts) 124 | quad_loss_new = Reduce(`+`, Map(function(x) x$partial_quad_loss, cvs)) 125 | quad_loss_new = -1/2/nrow(X) * quad_loss_new + 126 | lambda * (1-alpha) * sum(beta_new^2)/2 + alpha * sum(beta_new) 127 | if (quad_loss > quad_loss_old) { 128 | beta = beta_new 129 | quad_loss = quad_loss_new 130 | } 131 | else break 132 | } 133 | beta 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /R/irls.r: -------------------------------------------------------------------------------- 1 | 2 | ioirls = function(formula, family, data, weights, subset, 3 | na.action, start, etastart, mustart, offset, 4 | control, contrasts, trace, tol, beta_update_fun) { 5 | call <- match.call() 6 | control <- do.call("glm.control", control) 7 | if (is.character(family)) 8 | family <- get(family, mode = "function", envir = parent.frame()) 9 | if (is.function(family)) 10 | family <- family() 11 | if (is.null(family$family)) { 12 | print(family) 13 | stop("'family' not recognized") 14 | } 15 | 16 | if (!is.null(weights) && !is.character(weights <- weights[[1]])) { 17 | stop("weights must be a length one character vector") 18 | } 19 | if (!is.null(subset) && !is.character(subset <- subset[[1]])) { 20 | stop("subset must be a length one character vector") 21 | } 22 | if (!is.null(offset) && !is.character(offset <- offset[[1]])) { 23 | stop("offset must be a length one character vector") 24 | } 25 | 26 | converged <- FALSE 27 | beta <- beta_old <- start 28 | wtdmu <- deviance <- cumulative_weight <- NULL 29 | for (i in 1:control$maxit) { 30 | pvar <- list(beta = beta, cw = cumulative_weight, family = family, 31 | deviance = deviance, wtdmu = wtdmu) 32 | cvs <- adf.apply(x = data, type="sparse.model", FUN = glm_kernel, 33 | args = pvar, formula = formula, subset = subset, 34 | weights = weights, na.action = na.action, 35 | offset = offset, contrasts = contrasts) 36 | cvs <- cvs[!sapply(cvs, is.null)] 37 | num_rows <- Reduce(`+`, Map(function(x) x$num_rows, cvs)) 38 | XTWX <- Reduce(`+`, Map(function(x) x$XTWX, cvs)) 39 | XTWz <- Reduce(`+`, Map(function(x) x$XTWz, cvs)) 40 | deviance <- Reduce(`+`, Map(function(x) x$deviance, cvs)) 41 | cumulative_weight <- Reduce(`+`, Map(function(x) x$cumulative_weight, cvs)) 42 | wtdmu <- if( "(Intercept)" %in% colnames(XTWX) ) { 43 | Reduce(`+`, Map(function(x) x$wy, cvs))/cumulative_weight 44 | } else { 45 | family$linkinv(0) 46 | } 47 | contrasts <- cvs[[1]]$contrasts 48 | wx_norm <- Reduce(`+`, Map(function(x) x$wx_norm, cvs)) 49 | qr_check <- qr(XTWX) 50 | if (qr_check$rank < nrow(XTWX)) { 51 | warning("Design matrix is reduced rank! Some regressors will be removed.") 52 | rems <- qr_check$pivot[(qr_check$rank+1):nrow(XTWX)] 53 | rem_names <- colnames(XTWX)[rems] 54 | regressors <- attributes(terms(formula))$term.labels 55 | keep <- vapply(regressors, 56 | function(x) length(grep(x, rem_names)) == 0, FALSE) 57 | 58 | keep_names <- regressors[keep] 59 | if (! ("(Intercept)" %in% colnames(XTWX))) { 60 | keep_names <- c(keep_names, "-1") 61 | } 62 | 63 | formula <- as.formula(paste0(as.character(formula)[2], " ~ ", 64 | paste(keep_names, collapse=" + "))) 65 | if (trace) { 66 | cat("Reducing model because of singular design matrix.\n") 67 | } 68 | # Restart with the updated formula. 69 | beta <- beta_old <- NULL 70 | next 71 | } 72 | beta <- beta_update_fun(XTWX, XTWz, tol) 73 | if (!is.null(beta_old)) { 74 | err <- as.vector(Matrix::crossprod(beta-beta_old)) 75 | } else { 76 | err <- control$epsilon * 2 77 | } 78 | p_val <- NaN 79 | if ( (!is.null(beta_old) && (err < control$epsilon)) ) { 80 | converged <- TRUE 81 | break 82 | } 83 | if (trace) { 84 | cat(sprintf("Delta: %02.4f Deviance: %02.4f Iterations - %d\n", 85 | err,deviance,i)) 86 | } 87 | beta_old <- beta 88 | } 89 | # We only calculate these here, as we only care about the 90 | # converging loop: 91 | aic <- Reduce(`+`, Map(function(x) x$aic, cvs)) 92 | RSS <- Reduce(`+`, Map(function(x) x$RSS, cvs)) 93 | nobs <- Reduce(`+`, Map(function(x) x$nobs, cvs)) 94 | null_dev <- Reduce(`+`, Map(function(x) x$null_dev, cvs)) 95 | rank <- nrow(XTWX) 96 | 97 | aic <- aic + 2 * nrow(XTWX) 98 | 99 | # This will have to change when we support weights. 100 | nulldf <- nobs - attributes(terms(formula))$intercept 101 | resdf <- nobs - rank 102 | 103 | var_res <- RSS/resdf 104 | dispersion <- if (family$family %in% c("poisson", "binomial")) 1 else var_res 105 | 106 | ret <- list( 107 | coefficients = beta, 108 | family = family, 109 | deviance = deviance, 110 | aic = aic, 111 | data = data, 112 | rank = rank, 113 | xtwx = XTWX, 114 | xtwz = XTWz, 115 | iter = i, 116 | dispersion = dispersion, 117 | rss = RSS, 118 | converged = converged, 119 | formula = formula, 120 | call = call, 121 | num_obs = nobs, 122 | df.null = nulldf, 123 | null.deviance = null_dev, 124 | df.residual = resdf, 125 | terms = terms.formula(formula), 126 | control = control, 127 | contrasts = contrasts) 128 | class(ret) <- c("ioglm", "iolm") 129 | ret 130 | } 131 | 132 | -------------------------------------------------------------------------------- /R/lmnet.r: -------------------------------------------------------------------------------- 1 | 2 | #' Fit a linear model with lasso or elasticnet regularization 3 | #' 4 | #' Fit a linear model via penalized maxiumum likelihood. 5 | #' The regularization path is computed for the lasso or elasticnet 6 | #' penalty at a grid of values for the regularization parameter 7 | #' lambda. The function can deal data frames or abstract data frames. 8 | #' @importFrom Matrix crossprod colSums Matrix 9 | #' @param formula the formula for the regression 10 | #' @param data an abstract data frame or something that can be coerced into one. 11 | #' @param subset an options character string, which will be evaluated in the 12 | #' frame of the data, to indicate which rows to include in the analysis 13 | #' @param weights a optional character string, which will be evaluated in the 14 | #' frame of the data, giving the sample weights for the 15 | #' regression. 16 | #' @param na.action a function which indicates what should happen when the data 17 | #' contain 'NA's. See lm.fit for more details. 18 | #' @param offset a optional character string, which will be evaluated in the 19 | #' frame of the data, giving the offsets for the regression 20 | #' @param alpha the elasticnet mixing parameter 0 <= alpha <= 1. 21 | #' @param lambda a user supplied value (or sequence of values) for the penalty 22 | #' parameter. If not specified then a regularization path is created based 23 | #' on the data. 24 | #' @param contrasts contrasts to use with the regression. See the 25 | #' \code{contrasts.arg} of \code{model.matrix.default} 26 | #' @param standardize should the regression variables be normalized to have 27 | #' mean zero and standard deviation one? 28 | #' @param tol numeric tolerance. 29 | #' @param max_it the maximum number of iterations per regression. 30 | #' @param lambda_epsilon this value is multiplied by the max lambda in the 31 | #' data to determine the minimum lambda when the regularization path is 32 | #' determined from the data. This is ignored when lambda is specified. 33 | #' @param nlambdas the number of lambdas to be generated in the regularization 34 | #' path. This is ignored when lambda is specified. 35 | #' @export 36 | iolmnet = function(formula, data, subset=NULL, weights=NULL, na.action=NULL, 37 | offset=NULL, alpha=1, lambda=NULL, contrasts=NULL, 38 | standardize=FALSE, tol=1e-7, max_it = 1e+05, 39 | lambda_epsilon=0.0001, nlambdas=100) { 40 | 41 | # Under-development related messages. 42 | if (!missing(weights)) stop("Weights are not yet supported.") 43 | 44 | call = match.call() 45 | # if (!inherits(data, "adf")) data = adf(data) 46 | 47 | if (!is.null(weights) && !is.character(weights <- weights[[1]])) 48 | stop("weights must be a length one character vector") 49 | if (!is.null(subset) && !is.character(subset <- subset[[1]])) 50 | stop("subset must be a length one character vector") 51 | if (!is.null(offset) && !is.character(offset <- offset[[1]])) 52 | stop("offset must be a length one character vector") 53 | 54 | nm = net_matrices(data, formula, standardize, subset, weights, na.action, 55 | offset, contrasts) 56 | # net_matrices returns xty, xtx, num_rows, and all_var_names. 57 | 58 | data_lambdas = abs(nm$xty) / nm$num_rows / alpha 59 | lambda_k = max(abs(data_lambdas)) 60 | if (is.null(lambda)) { 61 | # change this 62 | # should be exp(seq(log(labmda_min), log(lambda_max), length(100))) 63 | lambda_path = seq(from=lambda_k, to=lambda_epsilon*lambda_k, 64 | length.out=nlambdas) 65 | } else { 66 | lambda_path = lambda 67 | } 68 | beta_path = NULL 69 | lambda = c() 70 | 71 | # Note that we'll need to do something with the a0 when we're not 72 | # standardizing. For now they are 0. 73 | # The following could be parallelized. 74 | for(lambda in lambda_path) { 75 | if (nrow(nm$xtx) > 0) { 76 | # This should change, intercept starts at 1 the rest can start 77 | # at zero. 78 | beta = Matrix::Matrix(1, nrow=nrow(nm$xtx), ncol=1) 79 | beta_old = -beta 80 | it_num = 0 81 | while (it_num <= max_it && 82 | as.vector(Matrix::crossprod(beta-beta_old)) > tol) { 83 | beta_old = beta 84 | ud = nm$xty - nm$xtx %*% beta 85 | beta = soft_thresh(ud / nm$num_rows + beta, lambda*alpha) / 86 | (1 + lambda*(1-alpha)) 87 | it_num = it_num + 1 88 | if (sum(beta == 0) >= length(beta) / 2) 89 | beta = suppressWarnings(as(beta, "dgCMatrix")) 90 | } 91 | if (it_num > max_it) 92 | warning("The regression did not converge.") 93 | beta_ret = Matrix::Matrix(0, ncol=1, nrow=(length(nm$all_var_names)), 94 | dimnames=list(nm$all_var_names, NULL)) 95 | beta_ret[colnames(nm$xtx),1] = beta 96 | } else { 97 | beta_ret = Matrix::Matrix(0, ncol=1, nrow=(length(nm$all_var_names)), 98 | dimnames=list(nm$all_var_names, NULL)) 99 | } 100 | if (is.null(beta_path)) { 101 | beta_path = beta_ret 102 | } else { 103 | beta_path = cbind(beta_path, beta_ret) 104 | } 105 | } 106 | # We are done with nm. Detach so we dont' get a warning the next time the 107 | # function is called. 108 | list(call=call, beta=beta_path, lambda = lambda_path) 109 | } 110 | 111 | -------------------------------------------------------------------------------- /R/lp.r: -------------------------------------------------------------------------------- 1 | #' Fit an Lp Regression 2 | #' 3 | #' Minimizes the loss ||Y - Xb||_p, for a suitable choice 4 | #' of p. 5 | #' 6 | #' @importFrom Matrix crossprod 7 | #' @param formula the formula for the regression 8 | #' @param data an abstract data frame, or something which can be 9 | #' coerced to one. 10 | #' @param p value of p for the regression, such that 1 <= p < 2. 11 | #' Using p=2 is also allowed for testing purposes, but 12 | #' sub-optimal as iolm should instead be called directly. 13 | #' @param weights a optional character string, which will be evaluated in the 14 | #' frame of the data, giving the sample weights for the regression 15 | #' @param subset an options character string, which will be evaluated in the 16 | #' frame of the data, to indicate which rows to include 17 | #' in the analysis 18 | #' @param na.action a function which indicates what should happen when the data 19 | #' contain 'NA's. See lm.fit for more details. 20 | #' @param offset a optional character string, which will be evaluated in the 21 | #' frame of the data, giving the offsets for the regression 22 | #' @param contrasts contrasts to use with the regression. See the \code{contrasts.arg} 23 | #' of \code{model.matrix.default} 24 | #' @param beta_init initial beta vector to start at; when missing an first pass using 25 | #' iolm is run to determine the starting point. 26 | #' @param delta tuning parameter to provide weights for very small residuals. 27 | #' most users should not need to change this parameter. 28 | #' @param maxit the limit on the number of IWLS iterations. 29 | #' @param acc accuracy for the IWLS stopping criterion. 30 | #' @param trace logical indicating if output should be produced for each 31 | #' iteration. 32 | #' @param tol numeric tolerance. Set to -1 to ignore. 33 | #' @export 34 | iolp = function(formula, data, p=1.5, weights=NULL, subset=NULL, 35 | na.action=NULL, offset=NULL, contrasts=NULL, 36 | beta_init=NULL, delta=0.0001, maxit=20, acc=1e-5, 37 | trace=FALSE, tol=-1) { 38 | call <- match.call() 39 | 40 | if (p > 2 || p < 1) stop("Invalid input to p; must have 1 <= p <= 2.") 41 | # if (!inherits(data, "adf")) data = adf(data) 42 | 43 | if (is.null(beta_init)) { 44 | lm.out = iolm(formula, data, subset=subset, weights=weights, 45 | na.action=na.action, offset=offset, contrasts=NULL, 46 | tol=tol) 47 | beta = beta_old = as.numeric(lm.out$coefficients) 48 | } else beta = beta_old = beta_init 49 | 50 | converged=FALSE 51 | for (i in 1:maxit) { 52 | pvar = list(beta=beta, p=p, delta=delta) 53 | cvs = adf.apply(x=data, type="sparse.model", 54 | FUN=lp_kernel, passedVars=pvar, formula=formula, 55 | subset=subset, weights=weights, na.action=na.action, 56 | offset=offset, contrasts=contrasts) 57 | cvs = cvs[!sapply(cvs,is.null)] 58 | 59 | 60 | XTWX = Reduce(`+`, Map(function(x) x$XTWX, cvs)) 61 | XTWz = Reduce(`+`, Map(function(x) x$XTWz, cvs)) 62 | 63 | beta = Matrix::solve(XTWX, XTWz, tol=2*.Machine$double.eps) 64 | err = as.vector(Matrix::crossprod(beta-beta_old) / sum(beta_old^2)) 65 | if (!is.null(beta_old) && err < acc) { 66 | converged=TRUE 67 | break 68 | } 69 | if (trace) cat(sprintf("Delta: %02.4f Iterations - %d\n",err,i)) 70 | beta_old = beta 71 | } 72 | 73 | b = as.numeric(beta) 74 | names(b) = rownames(beta) 75 | 76 | ret = list(coefficients=b, 77 | data=data, 78 | xtwx=XTWX, 79 | xtwz=XTWz, 80 | iter=i, 81 | p=p, 82 | converged=converged, 83 | formula=formula, 84 | call=call, 85 | num_obs=nobs) 86 | class(ret) = c("iolp") 87 | ret 88 | } 89 | 90 | #' Print iolp object 91 | #' 92 | #' @method print iolp 93 | #' @param x output of iolp 94 | #' @param digits significant digits to print 95 | #' @param ... optional, currently unused, arguments 96 | #' @export 97 | print.iolp = 98 | function (x, digits = max(3L, getOption("digits") - 3L), ...) 99 | { 100 | cat("\nCall:\n", paste(deparse(x$call), sep = "\n", collapse = "\n"), 101 | "\n\n", sep = "") 102 | if (length(coef(x))) { 103 | cat("Coefficients:\n") 104 | print.default(format(coef(x), digits = digits), print.gap = 2L, 105 | quote = FALSE) 106 | } 107 | else cat("No coefficients\n") 108 | cat("\n") 109 | invisible(x) 110 | } 111 | 112 | lp_kernel = function(d, passedVars=NULL) { 113 | if (nrow(d$x) == 0L) return(NULL) 114 | if (!is.null(d$w)) { 115 | if (any(d$w == 0)) { 116 | ok = d$w != 0 117 | d$w = d$w[ok] 118 | d$x = d$x[ok,,drop = FALSE] 119 | d$y = d$y[ok] 120 | if (!is.null(d$offset)) d$offset = d$offset[ok] 121 | } 122 | } 123 | nobs = length(d$y) 124 | offset <- if (!is.null(d$offset)) d$offset else offset = rep.int(0,nobs) 125 | weights <- if (!is.null(d$w)) d$w else rep(1, nobs) 126 | p <- if (!is.null(passedVars$a)) passedVars$a else 1.5 127 | delta <- if (!is.null(passedVars$s)) passedVars$s else 0.0001 128 | 129 | r = (d$x %*% passedVars$beta + offset - d$y) 130 | Winv = abs(r)^(2-passedVars$p) 131 | Winv[Winv < passedVars$delta] = passedVars$delta 132 | W = as.vector(weights * 1/Winv) 133 | 134 | list(XTWX=Matrix::crossprod(d$x, W*d$x), 135 | XTWz=Matrix::crossprod(d$x, W*d$y), 136 | cumulative_weight=sum(d$w), 137 | nobs=nobs, 138 | wy=Matrix::crossprod(sqrt(weights), d$y)) 139 | } 140 | -------------------------------------------------------------------------------- /R/net_util.r: -------------------------------------------------------------------------------- 1 | 2 | soft_thresh = function(x, g) { 3 | x = as.vector(x) 4 | w1 = which(g >= abs(x)) 5 | w2 = which(g < abs(x) & x > 0) 6 | w3 = which(g < abs(x) & x < 0) 7 | ret = x 8 | ret[w1] = 0 9 | ret[w2] = x[w2]-g 10 | ret[w3] = x[w3]+g 11 | Matrix::Matrix(ret, nrow=length(x)) 12 | } 13 | 14 | # Get xty, xtx_all, num_rows, and all_var_names from an adf. 15 | net_matrices = function(data, formula, standardize, subset, weights, na.action, 16 | offset, contrasts) { 17 | # Here's where we get the initial xtx, xty and number of rows. Note that 18 | # if we standardize that we need an extra pass through the data; one 19 | # to get the mans, one to get the standardized inner-products. If you try 20 | # to do it in a single pass you will lose stability. 21 | if (standardize) { 22 | stand_info = adf.apply(x=data, type="sparse.model", 23 | FUN=function(d,passedVars) { 24 | if (nrow(d$x) == 0L) return(NULL) 25 | if (colnames(d$x)[1] == "(Intercept)") { 26 | # Get rid of the intercept column. 27 | d$x = d$x[,2:ncol(d$x),drop=FALSE] 28 | } 29 | if (!is.null(d$offset)) d$y = d$y - d$offset 30 | if (!is.null(d$w)) { 31 | if (any(d$w == 0)) { 32 | ok = d$w != 0 33 | d$w = d$w[ok] 34 | d$x = d$x[ok,,drop = FALSE] 35 | d$y = d$y[ok] 36 | if (!is.null(d$offset)) d$offset = d$offset[ok] 37 | } 38 | sum_y = sum(d$y * d$w) 39 | sum_w = sum(d$w) 40 | d$x = d$x * sqrt(d$w) 41 | d$y = d$y * sqrt(d$w) 42 | } else { 43 | sum_w = nrow(d$x) 44 | } 45 | return(list(num_rows = nrow(d$x), 46 | sum_w = sum_w, 47 | col_sum_x = Matrix::colSums(d$x), 48 | col_sum_x_squared = Matrix::colSums(d$x^2), 49 | sum_y = sum(d$y), 50 | contrasts=attr(d$x, "contrasts"), 51 | all_var_names = colnames(d$x), 52 | warn_intercept=attributes(d$mt)$intercept)) 53 | 54 | },formula=formula,subset=subset,weights=weights, 55 | na.action=na.action, offset=offset, contrasts=contrasts) 56 | stand_info = stand_info[!sapply(stand_info, is.null)] 57 | if (length(stand_info) == 0L) stop("No valid data.") 58 | num_rows = Reduce(`+`, Map(function(x) x$num_rows, stand_info)) 59 | sum_w = Reduce(`+`, Map(function(x) x$sum_w , stand_info)) 60 | col_sum_x = Reduce(`+`, Map(function(x) x$col_sum_x, stand_info)) 61 | col_mean_x = col_sum_x / num_rows 62 | sum_y = Reduce(`+`, Map(function(x) x$sum_y, stand_info)) 63 | mean_y = sum_y / num_rows 64 | col_sum_x_squared = Reduce(`+`, 65 | Map(function(x) x$col_sum_x_squared, stand_info)) 66 | contrasts=stand_info[[1]]$contrasts 67 | all_var_names = stand_info[[1]]$all_var_names 68 | if (stand_info[[1]]$warn_intercept) 69 | warning("Intercept is ignored when variables are standardized") 70 | 71 | # Get the standard deviations and then fix the lambdas. 72 | stand_info = adf.apply(x=data, type="sparse.model", 73 | FUN=function(d,passedVars) { 74 | if (nrow(d$x) == 0L) return(NULL) 75 | if (colnames(d$x)[1] == "(Intercept)") { 76 | # Get rid of the intercept column. 77 | d$x = d$x[,2:ncol(d$x),drop=FALSE] 78 | } 79 | if (!is.null(d$offset)) d$y = d$y - d$offset 80 | if (!is.null(d$w)) { 81 | if (any(d$w == 0)) { 82 | ok = d$w != 0 83 | d$w = d$w[ok] 84 | d$x = d$x[ok,,drop = FALSE] 85 | d$y = d$y[ok] 86 | if (!is.null(d$offset)) d$offset = d$offset[ok] 87 | } 88 | sum_y = sum(d$y * d$w) 89 | sum_w = sum(d$w) 90 | d$x = d$x * sqrt(d$w) 91 | d$y = d$y * sqrt(d$w) 92 | } else { 93 | sum_w = nrow(d$x) 94 | } 95 | x_bar = Matrix::Matrix(col_mean_x,ncol=ncol(d$x), nrow=nrow(d$x), 96 | byrow=TRUE) 97 | x_centered=d$x-x_bar 98 | y_centered=d$y-mean_y 99 | return(list(col_x_square_diff=Matrix::colSums(x_centered^2), 100 | y_square_diff=sum(y_centered^2), 101 | centered_xty=Matrix::crossprod(x_centered, y_centered), 102 | all_var_names=colnames(d$x))) 103 | 104 | },formula=formula,subset=subset,weights=weights, 105 | na.action=na.action, offset=offset, contrasts=contrasts) 106 | col_x_square_diff = 107 | Reduce(`+`, Map(function(x) x$col_x_square_diff, stand_info)) 108 | x_sd = sqrt(col_x_square_diff / (num_rows-1)) 109 | y_square_diff = Reduce(`+`, Map(function(x) x$y_square_diff, stand_info)) 110 | y_sd = sqrt(y_square_diff / (num_rows-1)) 111 | xty = Reduce(`+`, 112 | Map(function(x) x$centered_xty, stand_info)) / x_sd / y_sd 113 | all_var_names = stand_info[[1]]$all_var_names 114 | 115 | # Second pass in the standardized case. 116 | cov_update_info = adf.apply(x=data, type="sparse.model", 117 | FUN=function(d,passedVars) { 118 | #d$x = d$x[,active_regressors, drop=FALSE] 119 | if (nrow(d$x) == 0L) return(NULL) 120 | if (colnames(d$x)[1] == "(Intercept)") { 121 | # Get rid of the intercept column. 122 | d$x = d$x[,2:ncol(d$x),drop=FALSE] 123 | } 124 | if (!is.null(d$offset)) d$y = d$y - d$offset 125 | if (!is.null(d$w)) { 126 | if (any(d$w == 0)) { 127 | ok = d$w != 0 128 | d$w = d$w[ok] 129 | d$x = d$x[ok,,drop = FALSE] 130 | d$y = d$y[ok] 131 | if (!is.null(d$offset)) d$offset = d$offset[ok] 132 | } 133 | d$x = d$x * sqrt(d$w) 134 | d$y = d$y * sqrt(d$w) 135 | } else { 136 | sum_w = nrow(d$x) 137 | } 138 | d$x=(d$x-Matrix::Matrix(col_mean_x, 139 | ncol=ncol(d$x), nrow=nrow(d$x), byrow=TRUE)) / 140 | Matrix::Matrix(x_sd, ncol=ncol(d$x), nrow=nrow(d$x), 141 | byrow=TRUE) 142 | d$y = (d$y - mean_y) / y_sd 143 | return(list(xtx = Matrix::crossprod(d$x))) 144 | },formula=formula,subset=subset,weights=weights, 145 | na.action=na.action, offset=offset, contrasts=contrasts) 146 | cov_update_info = cov_update_info[!sapply(cov_update_info, is.null)] 147 | xtx_all = Reduce(`+`, Map(function(x) x$xtx, cov_update_info)) 148 | ret = list(xty=xty, xtx_all=xtx_all, num_rows=num_rows, 149 | all_var_names=all_var_names) 150 | } else { 151 | # Unstandardized. 152 | stand_info = adf.apply(x=data, type="sparse.model", 153 | FUN=function(d,passedVars) { 154 | if (nrow(d$x) == 0L) return(NULL) 155 | if (!is.null(d$offset)) d$y = d$y - d$offset 156 | if (!is.null(d$w)) { 157 | if (any(d$w == 0)) { 158 | ok = d$w != 0 159 | d$w = d$w[ok] 160 | d$x = d$x[ok,,drop = FALSE] 161 | d$y = d$y[ok] 162 | if (!is.null(d$offset)) d$offset = d$offset[ok] 163 | } 164 | d$x = d$x * sqrt(d$w) 165 | d$y = d$y * sqrt(d$w) 166 | } else { 167 | sum_w = nrow(d$x) 168 | } 169 | return(list(num_rows=nrow(d$x), xty=Matrix::crossprod(d$x, d$y), 170 | xtx=Matrix::crossprod(d$x), 171 | contrasts=attr(d$x, "contrasts"), 172 | all_var_names=colnames(d$x))) 173 | 174 | },formula=formula,subset=subset,weights=weights, 175 | na.action=na.action, offset=offset, contrasts=contrasts) 176 | xty = Reduce(`+`, Map(function(x) x$xty, stand_info)) 177 | xtx_all = Reduce(`+`, Map(function(x) x$xtx, stand_info)) 178 | num_rows = Reduce(`+`, Map(function(x) x$num_rows, stand_info)) 179 | all_var_names=stand_info[[1]]$all_var_names 180 | ret = list(xty=xty, xtx_all=xtx_all, num_rows=num_rows, 181 | all_var_names=all_var_names) 182 | } 183 | ret 184 | } 185 | -------------------------------------------------------------------------------- /R/ols.r: -------------------------------------------------------------------------------- 1 | #' Perform a linear regression 2 | #' 3 | #' @param formula the formula for the regression 4 | #' @param data an abstract data frame, or something which can be 5 | #' coerced to one. 6 | #' @param subset an options character string, which will be evaluated in the 7 | #' frame of the data, to indicate which rows to include 8 | #' in the analysis 9 | #' @param weights a optional character string, which will be evaluated in the 10 | #' frame of the data, giving the sample weights for the regression 11 | #' @param na.action a function which indicates what should happen when the data 12 | #' contain 'NA's. See lm.fit for more details. 13 | #' @param offset a optional character string, which will be evaluated in the 14 | #' frame of the data, giving the offsets for the regression 15 | #' @param contrasts contrasts to use with the regression. See the \code{contrasts.arg} 16 | #' of \code{model.matrix.default} 17 | #' @param tol numeric tolerance. Set to -1 to ignore. 18 | #' @importFrom adf adf.apply allFactorLevels 19 | #' @export 20 | iolm = function(formula, data, subset=NULL, weights=NULL, 21 | na.action=NULL, offset=NULL, contrasts=NULL, tol=-1) { 22 | call = match.call() 23 | # if (!inherits(data, "adf")) data = as.adf(data) 24 | 25 | if (!is.null(weights) && !is.character(weights <- weights[[1]])) 26 | stop("weights must be a length one character vector") 27 | if (!is.null(subset) && !is.character(subset <- subset[[1]])) 28 | stop("subset must be a length one character vector") 29 | if (!is.null(offset) && !is.character(offset <- offset[[1]])) 30 | stop("offset must be a length one character vector") 31 | 32 | cvs = adf.apply(x=data, type="sparse.model", 33 | FUN=function(d,passedVars) { 34 | if (nrow(d$x) == 0L) return(NULL) 35 | z = d$y # non-offset version 36 | if (!is.null(d$offset)) d$y = d$y - d$offset 37 | if (!is.null(d$w)) { 38 | if (any(d$w == 0)) { 39 | ok = d$w != 0 40 | d$w = d$w[ok] 41 | d$x = d$x[ok,,drop = FALSE] 42 | d$y = d$y[ok] 43 | if (!is.null(d$offset)) d$offset = d$offset[ok] 44 | } 45 | sum_y = sum(d$y * d$w) 46 | sum_z = sum(z * d$w) 47 | sum_w = sum(d$w) 48 | if (!is.null(d$offset)) sum_o = sum(d$offset) else sum_o = 0 49 | d$x = d$x * sqrt(d$w) 50 | d$y = d$y * sqrt(d$w) 51 | if (!is.null(d$offset)) d$offset = d$offset * sqrt(d$w) 52 | z = z * sqrt(d$w) 53 | } else { 54 | sum_y = sum(d$y) 55 | sum_z = sum(z) 56 | sum_w = nrow(d$x) 57 | } 58 | if (!is.null(d$offset)) { 59 | oto = Matrix::crossprod(d$offset) 60 | xto = Matrix::crossprod(d$x, d$offset) 61 | } else { 62 | oto = Matrix(0) 63 | xto = Matrix(0,nrow=ncol(d$x)) 64 | } 65 | return(list(xtx = Matrix::crossprod(d$x), 66 | xty = Matrix::crossprod(d$x, d$y), 67 | yty = Matrix::crossprod(d$y), 68 | oto = oto, 69 | xto = xto, 70 | n = nrow(d$x), 71 | sum_y = sum_y, 72 | sum_w = sum_w, 73 | sum_z = sum_z, 74 | mean_x = apply(d$x,2,sum), 75 | contrasts=attr(d$x, "contrasts"), 76 | mt=d$mt)) 77 | 78 | },formula=formula,subset=subset,weights=weights, 79 | na.action=na.action, offset=offset, contrasts=contrasts) 80 | 81 | cvs = cvs[!sapply(cvs,is.null)] 82 | if (length(cvs) == 0L) stop("No valid data.") 83 | xtx = Reduce(`+`, Map(function(x) x$xtx, cvs)) 84 | xty = Reduce(`+`, Map(function(x) x$xty, cvs)) 85 | sum_y = Reduce(`+`, Map(function(x) x$sum_y, cvs)) 86 | sum_w = Reduce(`+`, Map(function(x) x$sum_w, cvs)) 87 | yty = Reduce(`+`, Map(function(x) x$yty, cvs)) 88 | oto = Reduce(`+`, Map(function(x) x$oto, cvs)) 89 | xto = Reduce(`+`, Map(function(x) x$xto, cvs)) 90 | sum_z = Reduce(`+`, Map(function(x) x$sum_z, cvs)) 91 | n = Reduce(`+`, Map(function(x) x$n, cvs)) 92 | mean_x = Reduce(`+`, Map(function(x) x$mean_x, cvs)) / n 93 | contrasts = cvs[[1]]$contrasts 94 | mt = cvs[[1]]$mt 95 | 96 | 97 | # Get rid of colinear variables. 98 | ch = chol(xtx, pivot=TRUE, tol=tol) 99 | if (attr(ch, "rank") < ncol(xtx)) { 100 | # xtx is rank deficient. 101 | new_name_order = attr(ch, "pivot") 102 | effective_rank = attr(ch, "rank") 103 | ft = mt 104 | formula_vars = colnames(attr(ft, "factors")) 105 | keep_vars = new_name_order[1:effective_rank] 106 | drop_var_names = colnames(xtx)[setdiff(new_name_order, keep_vars)] 107 | if (length(setdiff(drop_var_names, formula_vars)) > 0) { 108 | # A collinearity exists among factor levels in the design matrix. 109 | # Error out with an appropriate message. 110 | stop(paste("The following design matrix variables are colinear but", 111 | "could not be dropped because they are associated with a", 112 | "factor variable:", 113 | setdiff(drop_var_names, formula_vars), 114 | sep="\n")) 115 | } else { 116 | # The variable to drop can be dropped but we'll warn the user. 117 | warning(paste("Removing the following variables due to colinearity:", 118 | colnames(xtx)[tail(new_name_order,nrow(xtx)-effective_rank)], 119 | sep="\n")) 120 | } 121 | #Reorder xtx and xty in terms of the pivots up to the rank. 122 | xtx = xtx[keep_vars, keep_vars] 123 | xty = xty[keep_vars,] 124 | # Now update the formula so that it doesn't have the colinear terms. 125 | drop_inds = match(drop_var_names, formula_vars) 126 | ft = drop.terms(ft, drop_inds, keep.response=TRUE) 127 | form = formula(ft) 128 | } 129 | 130 | coefficients = as.numeric(Matrix::solve(xtx,xty)) 131 | names(coefficients) = rownames(xtx) 132 | terms = mt 133 | contrasts = contrasts 134 | 135 | ret = list(coefficients=coefficients, call=call, terms=terms, 136 | xtx=xtx, xty=xty, yty=yty, oto=oto, xto=xto, sum_z=sum_z, 137 | mean_x=mean_x, 138 | sum_y=as.numeric(sum_y), sum_w=as.numeric(sum_w), 139 | n=n, data=data, contrasts=contrasts, rank=ncol(xtx)) 140 | class(ret) = "iolm" 141 | ret 142 | } 143 | 144 | #' Get the regression diagnostics for a linear regression 145 | #' 146 | #' @method summary iolm 147 | #' @param object an object return from iolm 148 | #' @param ... optional, currently unused, arguments 149 | #' @export 150 | summary.iolm = function(object, ...) { 151 | call = match.call() 152 | 153 | beta = coef(object) 154 | btxtxb = t(beta) %*% object$xtx %*% beta 155 | rss = object$yty + btxtxb - 2 * t(beta) %*% object$xty 156 | 157 | mss = btxtxb + object$oto + 2 * Matrix::t(object$xto) %*% beta 158 | if (attr(object$terms, "intercept")) 159 | mss = mss - object$sum_z^2 / object$sum_w 160 | 161 | rss_beta = object$yty - btxtxb 162 | df = c(length(beta), 163 | object$n-length(beta), 164 | length(beta)) 165 | sigma = as.numeric(sqrt(rss_beta / df[2])) 166 | #vcv = sigma * sqrt(solve(object$xtx)) 167 | cov_unscaled = solve(object$xtx) 168 | se = sigma * sqrt(diag(cov_unscaled)) 169 | tv = object$coefficients/se 170 | ptv = 2 * pt(abs(tv), df[2], lower.tail = FALSE) 171 | 172 | coefficients = cbind(object$coefficients, se, tv, ptv) 173 | colnames(coefficients) = c("Estimate", "Std. Error", "t value", "Pr(>|t|)") 174 | rownames(coefficients) = rownames(object$xtx) 175 | 176 | # Aliasing could be better. 177 | aliased = rep(FALSE, length(object$coefficients)) 178 | names(aliased) = names(object$coefficients) 179 | df.int <- if (attr(object$terms, "intercept")) 1L else 0L 180 | r_squared = as.numeric(mss/(mss + rss)) 181 | adj_r_squared = 1 - (1-r_squared) * sum(df[1:2], -1*df.int)/df[2] 182 | fstatistic = c((mss/(df[1]-df.int))/sigma^2, df[1]-df.int, dendf=df[2]) 183 | names(fstatistic) = c("value", "numdf", "dendf") 184 | 185 | ret = list(call=call, terms=object$terms, coefficients=coefficients, 186 | aliased=aliased, sigma=sigma, df=df, r.squared=r_squared, 187 | adj.r.squared=as.numeric(adj_r_squared), 188 | fstatistic=sapply(fstatistic,as.numeric), 189 | cov.unscaled=cov_unscaled, data=object$data, dfpp=object$dfpp) 190 | class(ret) = "summary.iolm" 191 | ret 192 | } 193 | 194 | #' Print iolm object 195 | #' 196 | #' @method print iolm 197 | #' @param x output of iolm 198 | #' @param digits significant digits to print 199 | #' @param ... optional, currently unused, arguments 200 | #' @export 201 | print.iolm = 202 | function (x, digits = max(3L, getOption("digits") - 3L), ...) 203 | { 204 | cat("\nCall:\n", paste(deparse(x$call), sep = "\n", collapse = "\n"), 205 | "\n\n", sep = "") 206 | if (length(coef(x))) { 207 | cat("Coefficients:\n") 208 | print.default(format(coef(x), digits = digits), print.gap = 2L, 209 | quote = FALSE) 210 | } 211 | else cat("No coefficients\n") 212 | cat("\n") 213 | invisible(x) 214 | } 215 | 216 | #' Print iolm summary 217 | #' 218 | #' @method print summary.iolm 219 | #' @param x output of summary.iolm 220 | #' @param digits significant digits to print 221 | #' @param symbolic.cor logical. Should symbolic correlation be printed. 222 | #' @param signif.stars logical. Should significant starts be printed. 223 | #' @param ... optional, currently unused, arguments 224 | #' @export 225 | print.summary.iolm = 226 | function (x, digits = max(3L, getOption("digits") - 3L), symbolic.cor = x$symbolic.cor, 227 | signif.stars = getOption("show.signif.stars"), ...) 228 | { 229 | cat("\nCall:\n", paste(deparse(x$call), sep = "\n", collapse = "\n"), 230 | "\n\n", sep = "") 231 | resid <- x$residuals 232 | df <- x$df 233 | rdf <- df[2L] 234 | if (length(x$aliased) == 0L) { 235 | cat("\nNo Coefficients\n") 236 | } 237 | else { 238 | if (nsingular <- df[3L] - df[1L]) 239 | cat("\nCoefficients: (", nsingular, " not defined because of singularities)\n", 240 | sep = "") 241 | else cat("\nCoefficients:\n") 242 | coefs <- x$coefficients 243 | if (!is.null(aliased <- x$aliased) && any(aliased)) { 244 | cn <- names(aliased) 245 | coefs <- matrix(NA, length(aliased), 4, dimnames = list(cn, 246 | colnames(coefs))) 247 | coefs[!aliased, ] <- x$coefficients 248 | } 249 | printCoefmat(coefs, digits = digits, signif.stars = signif.stars, 250 | na.print = "NA", ...) 251 | } 252 | cat("\nResidual standard error:", format(signif(x$sigma, 253 | digits)), "on", rdf, "degrees of freedom") 254 | cat("\n") 255 | if (nzchar(mess <- naprint(x$na.action))) 256 | cat(" (", mess, ")\n", sep = "") 257 | if (!is.null(x$fstatistic)) { 258 | cat("Multiple R-squared: ", formatC(x$r.squared, digits = digits)) 259 | cat(",\tAdjusted R-squared: ", formatC(x$adj.r.squared, 260 | digits = digits), "\nF-statistic:", formatC(x$fstatistic[1L], 261 | digits = digits), "on", x$fstatistic[2L], "and", 262 | x$fstatistic[3L], "DF, p-value:", format.pval(pf(x$fstatistic[1L], 263 | x$fstatistic[2L], x$fstatistic[3L], lower.tail = FALSE), 264 | digits = digits)) 265 | cat("\n") 266 | } 267 | correl <- x$correlation 268 | if (!is.null(correl)) { 269 | p <- NCOL(correl) 270 | if (p > 1L) { 271 | cat("\nCorrelation of Coefficients:\n") 272 | if (is.logical(symbolic.cor) && symbolic.cor) { 273 | print(symnum(correl, abbr.colnames = NULL)) 274 | } 275 | else { 276 | correl <- format(round(correl, 2), nsmall = 2, 277 | digits = digits) 278 | correl[!lower.tri(correl)] <- "" 279 | print(correl[-1, -p, drop = FALSE], quote = FALSE) 280 | } 281 | } 282 | } 283 | cat("\n") 284 | invisible(x) 285 | } 286 | -------------------------------------------------------------------------------- /R/pcr.r: -------------------------------------------------------------------------------- 1 | #' Recalculate iolm with Principal Component Regression 2 | #' 3 | #' This function takes a pre-computed iolm object, 4 | #' and recalculates the regression vector with only 5 | #' the top k-principal components. 6 | #' 7 | #' @importFrom Matrix diag 8 | #' @param object an iolm object with the desired formula 9 | #' @param k A scalar or vector of degrees to fit. 10 | #' @param normalize If TRUE, each variable is standardized to 11 | #' have unit L2 norm, otherwise it is left alone. 12 | #' Default is TRUE. 13 | #' @export 14 | iolm.pcr = function(object, k=seq(1,ncol(object$xtx)-attr(object$terms, "intercept")), 15 | normalize=TRUE) { 16 | if (!inherits(object, "iolm")) 17 | stop("input to object must be an iolm object! See ?ioregression::iolm for more info.") 18 | 19 | n = object$n 20 | p = ncol(object$xtx) 21 | mean_y = object$sum_y / n 22 | mean_x = object$mean_x 23 | noms = names(out$coefficients) 24 | intercept = as.logical(attr(object$terms, "intercept")) 25 | 26 | k = unique(round(k)) 27 | if (any(k <= 0L) || any(k > p-1)) 28 | stop("Values of k must be between 1 and p-1.") 29 | 30 | XtY = as.matrix(object$xty) 31 | XtX = as.matrix(object$xtx) 32 | YtY = as.matrix(object$yty) 33 | 34 | # If the model matrix already has an intercept, remove it: 35 | if (intercept) { 36 | XtX = XtX[-1,-1] 37 | XtY = XtY[-1] 38 | mean_x = mean_x[-1] 39 | noms = noms[-1] 40 | p = p - 1 41 | } else mu = 0 42 | 43 | # Need to center X and Y for PCA: 44 | mu = mean_y 45 | XtY = XtY - n * mean_x * mean_y 46 | XtX = XtX - n * outer(mean_x,mean_x) 47 | 48 | if (normalize) { 49 | normx = sqrt(Matrix::diag(XtX)) 50 | names(normx) <- NULL 51 | XtX = XtX / outer(normx,normx) 52 | XtY = XtY / normx 53 | } else normx = rep(1,p) 54 | 55 | ev = eigen(XtX) 56 | 57 | beta = matrix(0.0, ncol=p, nrow=length(k)) 58 | 59 | for (j in 1:length(k)) { 60 | v = ev$vector[,1:k[j]] 61 | wtw = t(v) %*% XtX %*% v 62 | wty = t(v) %*% XtY 63 | beta[,j] = v %*% solve(wtw,wty) 64 | } 65 | 66 | beta = scale(t(beta), FALSE, normx) 67 | rownames(beta) = k 68 | MtM = XtX - outer(mean_x,mean_x)*n 69 | RSS = drop(YtY + Matrix::diag(beta %*% MtM %*% t(beta)) - 2 * beta %*% XtY 70 | - mu^2*n + 2 * n * mu * beta %*% mean_x) 71 | 72 | # Add offset back: 73 | beta = cbind(mu - beta %*% mean_x, beta) 74 | colnames(beta) = c("(Intercept)", noms) 75 | df = k 76 | 77 | out = list(coefficients=beta, df=df, RSS=RSS, 78 | iolm=out, call=match.call()) 79 | class(out) = c("iolm.pcr") 80 | return(out) 81 | } 82 | 83 | #' Print an iolm.pcr object 84 | #' 85 | #' @method print iolm.pcr 86 | #' @param x an iolars object to print the summary of 87 | #' @param ... other inputs; currently unused 88 | #' @export 89 | print.iolm.pcr = function (x, ...) { 90 | cat("\nCall:\n") 91 | dput(x$call) 92 | mat = cbind(lambda=x$lambda, df=x$df, RSS=x$RSS, AIC=x$AIC, 93 | BIC=x$BIC) 94 | rownames(mat) = rep("",nrow(mat)) 95 | print(mat) 96 | } 97 | 98 | -------------------------------------------------------------------------------- /R/ridge.r: -------------------------------------------------------------------------------- 1 | #' Add a ridge penalty to an iolm object 2 | #' 3 | #' This function takes a pre-computed iolm object, 4 | #' and applies a (sequence) of ridge penalties. An 5 | #' intercept, if present in the original model, will 6 | #' not be penalized. 7 | #' 8 | #' @param object an iolm object with the desired formula 9 | #' @param lambda A scalar or vector of ridge constants. 10 | #' @param normalize If TRUE, each variable is standardized to have unit L2 norm, 11 | #' otherwise it is left alone. Default is TRUE. 12 | #' @export 13 | iolm.ridge = function(object, lambda=seq(0,1,by=0.1), normalize=TRUE) { 14 | if (!inherits(object, "iolm")) 15 | stop("input to object must be an iolm object! See ?ioregression::iolm for more info.") 16 | 17 | n = object$n 18 | p = ncol(object$xtx) 19 | mean_y = object$sum_y / n 20 | mean_x = object$mean_x 21 | noms = names(object$coefficients) 22 | intercept = as.logical(attr(object$terms, "intercept")) 23 | 24 | XtY = object$xty 25 | XtX = object$xtx 26 | YtY = object$yty 27 | if (intercept) { 28 | mu = mean_y 29 | XtX = XtX[-1,-1] 30 | XtY = XtY[-1] 31 | mean_x = mean_x[-1] 32 | noms = noms[-1] 33 | p = p - 1 34 | XtY = XtY - n * mean_x * mean_y 35 | XtX = XtX - n * outer(mean_x,mean_x) 36 | } else mu = 0 37 | if (normalize) { 38 | normx = sqrt(Matrix::diag(XtX)) 39 | names(normx) <- NULL 40 | XtX = XtX / outer(normx,normx) 41 | XtY = XtY / normx 42 | } else normx = rep(1,p) 43 | 44 | beta = sapply(lambda, function(l) 45 | as.numeric(Matrix::solve(XtX + Matrix::Diagonal(p,l),XtY))) 46 | beta = scale(t(beta), FALSE, normx) 47 | rownames(beta) = lambda 48 | MtM = XtX - outer(mean_x,mean_x)*n 49 | RSS = drop(YtY + Matrix::diag(beta %*% MtM %*% t(beta)) - 2 * beta %*% XtY 50 | - mu^2*n + 2 * n * mu * beta %*% mean_x) 51 | 52 | if (intercept) { 53 | beta = cbind(mu - beta %*% mean_x, beta) 54 | colnames(beta) = c("(Intercept)", noms) 55 | } 56 | 57 | sigma = summary.iolm(object)$sigma 58 | ev = eigen(XtX,only.values=TRUE)$values 59 | 60 | df = apply(ev / matrix(rep(ev,length(lambda)) + rep(lambda, 61 | each=length(ev)),ncol=length(lambda)),2,sum) + intercept 62 | names(df) = lambda 63 | 64 | out = list(coefficients=beta, lambda=lambda, intercept=intercept, df=df, RSS=RSS, 65 | AIC=n*log(RSS)+2*df, BIC=n*log(RSS)+log(n)*df, 66 | iolm=object, sigma = sigma, call=match.call()) 67 | class(out) = c("iolm.ridge") 68 | return(out) 69 | } 70 | 71 | #' Print an ioridge object 72 | #' 73 | #' @method print iolm.ridge 74 | #' @param x an iolars object to print the summary of 75 | #' @param ... other inputs; currently unused 76 | #' @export 77 | print.iolm.ridge = function (x, ...) { 78 | cat("\nCall:\n") 79 | dput(x$call) 80 | mat = cbind(lambda=x$lambda, df=x$df, RSS=x$RSS, AIC=x$AIC, 81 | BIC=x$BIC) 82 | rownames(mat) = rep("",nrow(mat)) 83 | print(mat) 84 | } 85 | -------------------------------------------------------------------------------- /R/rlm.r: -------------------------------------------------------------------------------- 1 | #' Fit a robust linear regression 2 | #' 3 | #' Fits an M-estimator using Tukey's bisquare function for 4 | #' estimating slope coefficients in a linear model. 5 | #' 6 | #' @param formula the formula for the regression 7 | #' @param data an abstract data frame, or something which can be 8 | #' coerced to one. 9 | #' @param weights a optional character string, which will be evaluated in the 10 | #' frame of the data, giving the sample weights for the regression 11 | #' @param subset an options character string, which will be evaluated in the 12 | #' frame of the data, to indicate which rows to include 13 | #' in the analysis 14 | #' @param na.action a function which indicates what should happen when the data 15 | #' contain 'NA's. See lm.fit for more details. 16 | #' @param offset a optional character string, which will be evaluated in the 17 | #' frame of the data, giving the offsets for the regression 18 | #' @param contrasts contrasts to use with the regression. See the \code{contrasts.arg} 19 | #' of \code{model.matrix.default} 20 | #' @param beta_init initial beta vector to start at; when missing a first pass using 21 | #' iolm is run to determine the starting point. 22 | #' @param s_init inital value of the scale factor; when missing a first pass using 23 | #' iolm is run to determine the starting scale. 24 | #' @param a tuning parameter for Tukey bisquare. See Details for more information. 25 | #' @param maxit the limit on the number of IWLS iterations. 26 | #' @param acc accuracy for the IWLS stopping criterion. 27 | #' @param trace logical indicating if output should be produced for each 28 | #' iteration. 29 | #' @param tol numeric tolerance. Set to -1 to ignore. 30 | #' @details 31 | #' The parameter \code{a} controls the tradeoff between efficency 32 | #' and robustness. The default value of 4.685 yields an efficency of 95% 33 | #' but breakdown point of about 10%; conversely 1.547 has only a 28% efficency 34 | #' but a breakdown point of 50%. For large datasets, it may be preferable to set 35 | #' the values of \code{a} lower than the default. 36 | #' 37 | #' @export 38 | iorlm = function(formula, data, weights=NULL, subset=NULL, 39 | na.action=NULL, offset=NULL, contrasts=NULL, 40 | beta_init=NULL, s_init=NULL, a=4.685, maxit = 20, 41 | acc = 1e-4, trace=FALSE, tol=-1) { 42 | call <- match.call() 43 | 44 | # if (!inherits(data, "adf")) data = adf(data) 45 | 46 | if (!is.null(weights) && !is.character(weights <- weights[[1]])) 47 | stop("weights must be a length one character vector") 48 | if (!is.null(subset) && !is.character(subset <- subset[[1]])) 49 | stop("subset must be a length one character vector") 50 | if (!is.null(offset) && !is.character(offset <- offset[[1]])) 51 | stop("offset must be a length one character vector") 52 | 53 | if (is.null(beta_init) || is.null(s_init)) 54 | lm.out = iolm(formula, data, subset=subset, weights=weights, 55 | na.action=na.action, offset=offset, contrasts=NULL, 56 | tol=tol) 57 | 58 | beta <- if (is.null(beta_init)) as.numeric(lm.out$coefficients) else beta_init 59 | s <- if (is.null(s_init)) summary(lm.out)$sigma else s_init 60 | beta_old = beta 61 | 62 | converged=FALSE 63 | for (i in 1:maxit) { 64 | pvar = list(beta=beta, a=a, s=s) 65 | cvs = adf.apply(x=data, type="sparse.model", 66 | FUN=rlm_kernel ,passedVars=pvar, formula=formula, 67 | subset=subset,weights=weights, na.action=na.action, 68 | offset=offset, contrasts=contrasts) 69 | cvs = cvs[!sapply(cvs,is.null)] 70 | 71 | XTWX = Reduce(`+`, Map(function(x) x$XTWX, cvs)) 72 | XTWz = Reduce(`+`, Map(function(x) x$XTWz, cvs)) 73 | resid20 = unlist(Map(function(x) x$resid20, cvs)) 74 | 75 | s = median(abs(resid20 - median(resid20))) * 1.4826 76 | 77 | beta = Matrix::solve(XTWX, XTWz, tol=2*.Machine$double.eps) 78 | err = as.vector(Matrix::crossprod(beta-beta_old) / sum(beta_old^2)) 79 | if (!is.null(beta_old) && err < acc) { 80 | converged=TRUE 81 | break 82 | } 83 | if (trace) cat(sprintf("Delta: %02.4f Scale: %02.4f Iterations - %d\n",err,s,i)) 84 | beta_old = beta 85 | } 86 | 87 | b = as.numeric(beta) 88 | names(b) = rownames(beta) 89 | 90 | ret = list(coefficients=b, 91 | data=data, 92 | xtwx=XTWX, 93 | xtwz=XTWz, 94 | iter=i, 95 | a=a, 96 | s=s, 97 | converged=converged, 98 | formula=formula, 99 | call=call, 100 | num_obs=nobs) 101 | class(ret) = c("iorlm") 102 | ret 103 | } 104 | 105 | #' Print iorlm object 106 | #' 107 | #' @method print iorlm 108 | #' @param x output of iorlm 109 | #' @param digits significant digits to print 110 | #' @param ... optional, currently unused, arguments 111 | #' @export 112 | print.iorlm = 113 | function (x, digits = max(3L, getOption("digits") - 3L), ...) 114 | { 115 | cat("\nCall:\n", paste(deparse(x$call), sep = "\n", collapse = "\n"), 116 | "\n\n", sep = "") 117 | if (length(coef(x))) { 118 | cat("Coefficients:\n") 119 | print.default(format(coef(x), digits = digits), print.gap = 2L, 120 | quote = FALSE) 121 | } 122 | else cat("No coefficients\n") 123 | cat("\n") 124 | invisible(x) 125 | } 126 | 127 | rlm_kernel = function(d, passedVars=NULL) { 128 | if (nrow(d$x) == 0L) return(NULL) 129 | if (!is.null(d$w)) { 130 | if (any(d$w == 0)) { 131 | ok = d$w != 0 132 | d$w = d$w[ok] 133 | d$x = d$x[ok,,drop = FALSE] 134 | d$y = d$y[ok] 135 | if (!is.null(d$offset)) d$offset = d$offset[ok] 136 | } 137 | } 138 | nobs = length(d$y) 139 | offset <- if (!is.null(d$offset)) d$offset else offset = rep.int(0,nobs) 140 | weights <- if (!is.null(d$w)) d$w else rep(1, nobs) 141 | a <- if (!is.null(passedVars$a)) passedVars$a else 4.685 142 | s <- if (!is.null(passedVars$s)) passedVars$s else 1.0 143 | 144 | tbw = function(z, a) { 145 | out = (1 - (z/a)^2)^2 146 | out[abs(z) > a] = 0 147 | out 148 | } 149 | 150 | r = (d$x %*% passedVars$beta + offset - d$y) 151 | W = as.vector(weights * as.numeric(tbw(r / s, a = a))) 152 | 153 | list(XTWX=Matrix::crossprod(d$x, W * d$x), 154 | XTWz=Matrix::crossprod(d$x, W*d$y), 155 | cumulative_weight=sum(d$w), 156 | nobs=nobs, 157 | wy=Matrix::crossprod(sqrt(weights), d$y), 158 | resid20=quantile(r,seq(0,1,0.05))) 159 | } 160 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/ioregression)](http://cran.r-project.org/package=ioregression) 2 | [![Build Status](https://travis-ci.org/kaneplusplus/ioregression.png)](https://travis-ci.org/kaneplusplus/ioregression) 3 | [![Build status](https://ci.appveyor.com/api/projects/status/how1lupbnrkmbeun/branch/master?svg=true)](https://ci.appveyor.com/project/kaneplusplus/ioregression/branch/master) 4 | [![Coverage Status](https://coveralls.io/repos/kaneplusplus/ioregression/badge.svg?branch=master&service=github)](https://coveralls.io/github/kaneplusplus/ioregression?branch=master) 5 | 6 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # $ErrActionPreference = "Stop" when we tighten this up. 2 | # DO NOT CHANGE the "init" and "install" sections below 3 | # Download script file from GitHub 4 | init: 5 | ps: | 6 | $ErrorActionPreference = "Continue" 7 | Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" 8 | Import-Module '..\appveyor-tool.ps1' 9 | install: 10 | ps: Bootstrap 11 | 12 | # Adapt as necessary starting from here 13 | 14 | build_script: 15 | - travis-tool.sh install_deps 16 | 17 | test_script: 18 | - travis-tool.sh run_tests 19 | 20 | on_failure: 21 | - travis-tool.sh dump_logs 22 | 23 | artifacts: 24 | - path: '*.Rcheck\**\*.log' 25 | name: Logs 26 | 27 | - path: '*.Rcheck\**\*.out' 28 | name: Logs 29 | 30 | - path: '*.Rcheck\**\*.fail' 31 | name: Logs 32 | 33 | - path: '*.Rcheck\**\*.Rout' 34 | name: Logs 35 | 36 | - path: '\*_*.tar.gz' 37 | name: Bits 38 | 39 | - path: '\*_*.zip' 40 | name: Bits 41 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/asul/asul-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/asul/asul-bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/asul/asul-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/asul/asul-bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/asul/asul-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/asul/asul-regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/asul/asul-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/asul/asul-regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/asul/asul.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Asul'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('asul-regular.woff') format('woff'), 8 | url('asul-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Asul'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('asul-bold.woff') format('woff'), 15 | url('asul-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/cabinsketch/cabinsketch-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/cabinsketch/cabinsketch-bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/cabinsketch/cabinsketch-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/cabinsketch/cabinsketch-bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/cabinsketch/cabinsketch-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/cabinsketch/cabinsketch-regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/cabinsketch/cabinsketch-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/cabinsketch/cabinsketch-regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/cabinsketch/cabinsketch.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Cabin Sketch'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('cabinsketch-regular.woff') format('woff'), 8 | url('cabinsketch-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Cabin Sketch'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('cabinsketch-regular.woff') format('woff'), 15 | url('cabinsketch-regular.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-bolditalic.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-bolditalic.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-italic.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-italic.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans-regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/josefinsans/josefinsans.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Josefin Sans'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('josefinsans-regular.woff') format('woff'), 8 | url('josefinsans-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Josefin Sans'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('josefinsans-bold.woff') format('woff'), 15 | url('josefinsans-bold.ttf') format('truetype'); 16 | } 17 | @font-face { 18 | font-family: 'Josefin Sans'; 19 | font-style: italic; 20 | font-weight: 400; 21 | src: url('josefinsans-italic.woff') format('woff'), 22 | url('josefinsans-italic.ttf') format('truetype'); 23 | } 24 | @font-face { 25 | font-family: 'Josefin Sans'; 26 | font-style: italic; 27 | font-weight: 700; 28 | src: url('josefinsans-bolditalic.woff') format('woff'), 29 | url('josefinsans-bolditalic.ttf') format('truetype'); 30 | } 31 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-Regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Math-Regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/katex/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-bolditalic.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-bolditalic.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-italic.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-italic.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/lato/lato-regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/lato/lato.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Lato'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('lato-regular.woff') format('woff'), 8 | url('lato-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Lato'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('lato-bold.woff') format('woff'), 15 | url('lato-bold.ttf') format('truetype'); 16 | } 17 | @font-face { 18 | font-family: 'Lato'; 19 | font-style: italic; 20 | font-weight: 400; 21 | src: url('lato-italic.woff') format('woff'), 22 | url('lato-italic.ttf') format('truetype'); 23 | } 24 | @font-face { 25 | font-family: 'Lato'; 26 | font-style: italic; 27 | font-weight: 700; 28 | src: url('lato-bolditalic.woff') format('woff'), 29 | url('lato-bolditalic.ttf') format('truetype'); 30 | } 31 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/league/league_gothic.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'League Gothic'; 3 | src: url('league_gothic.woff') format('woff'), 4 | url('league_gothic.ttf') format('truetype'); 5 | 6 | font-weight: normal; 7 | font-style: normal; 8 | } 9 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/league/league_gothic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/league/league_gothic.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/league/league_gothic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/league/league_gothic.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/league/league_gothic_license: -------------------------------------------------------------------------------- 1 | SIL Open Font License (OFL) 2 | http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL 3 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/merriweathersans/merriweathersans-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/merriweathersans/merriweathersans-bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/merriweathersans/merriweathersans-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/merriweathersans/merriweathersans-bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/merriweathersans/merriweathersans-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/merriweathersans/merriweathersans-regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/merriweathersans/merriweathersans-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/merriweathersans/merriweathersans-regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/merriweathersans/merriweathersans.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Merriweather Sans'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('merriweathersans-regular.woff') format('woff'), 8 | url('merriweathersans-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Merriweather Sans'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('merriweathersans-bold.woff') format('woff'), 15 | url('merriweathersans-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/montserrat/montserrat-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/montserrat/montserrat-bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/montserrat/montserrat-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/montserrat/montserrat-bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/montserrat/montserrat-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/montserrat/montserrat-regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/montserrat/montserrat-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/montserrat/montserrat-regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/montserrat/montserrat.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Montserrat'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('montserrat-regular.woff') format('woff'), 8 | url('montserrat-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Montserrat'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('montserrat-bold.woff') format('woff'), 15 | url('montserrat-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/newscycle/newscycle-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/newscycle/newscycle-bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/newscycle/newscycle-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/newscycle/newscycle-bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/newscycle/newscycle-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/newscycle/newscycle-regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/newscycle/newscycle-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/newscycle/newscycle-regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/newscycle/newscycle.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'News Cycle'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('newscycle-regular.woff') format('woff'), 8 | url('newscycle-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'News Cycle'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('newscycle-bold.woff') format('woff'), 15 | url('newscycle-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-bolditalic.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-bolditalic.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-italic.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-italic.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans-regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/opensans/opensans.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Open Sans'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('opensans-regular.woff') format('woff'), 8 | url('opensans-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Open Sans'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('opensans-bold.woff') format('woff'), 15 | url('opensans-bold.ttf') format('truetype'); 16 | } 17 | @font-face { 18 | font-family: 'Open Sans'; 19 | font-style: italic; 20 | font-weight: 400; 21 | src: url('opensans-italic.woff') format('woff'), 22 | url('opensans-italic.ttf') format('truetype'); 23 | } 24 | @font-face { 25 | font-family: 'Open Sans'; 26 | font-style: italic; 27 | font-weight: 700; 28 | src: url('opensans-bolditalic.woff') format('woff'), 29 | url('opensans-bolditalic.ttf') format('truetype'); 30 | } 31 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-light.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-light.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass-regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/overpass/overpass.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Overpass'; 3 | font-style: normal; 4 | font-weight: bold; 5 | src: url('overpass-bold.woff') format('woff'), 6 | url('overpass-bold.ttf') format('truetype'); 7 | } 8 | 9 | 10 | @font-face { 11 | font-family: 'Overpass'; 12 | font-style: normal; 13 | font-weight: 500; 14 | src: url('overpass-regular.woff') format('woff'), 15 | url('overpass-regular.ttf') format('truetype'); 16 | } 17 | 18 | 19 | @font-face { 20 | font-family: 'Overpass'; 21 | font-style: normal; 22 | font-weight: normal; 23 | src: url('overpass-light.woff') format('woff'), 24 | url('overpass-light.ttf') format('truetype'); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/oxygen/oxygen-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/oxygen/oxygen-bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/oxygen/oxygen-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/oxygen/oxygen-bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/oxygen/oxygen-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/oxygen/oxygen-regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/oxygen/oxygen-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/oxygen/oxygen-regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/oxygen/oxygen.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Oxygen'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('oxygen-regular.woff') format('woff'), 8 | url('oxygen-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Oxygen'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('oxygen-bold.woff') format('woff'), 15 | url('oxygen-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/quicksand/quicksand-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/quicksand/quicksand-bold.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/quicksand/quicksand-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/quicksand/quicksand-bold.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/quicksand/quicksand-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/quicksand/quicksand-regular.ttf -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/quicksand/quicksand-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/Bay-Area-UseR-2015/lib/fonts/quicksand/quicksand-regular.woff -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/fonts/quicksand/quicksand.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Quicksand'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('quicksand-regular.woff') format('woff'), 8 | url('quicksand-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Quicksand'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('quicksand-bold.woff') format('woff'), 15 | url('quicksand-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/head.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | Head JS The only script in your 3 | Copyright Tero Piirainen (tipiirai) 4 | License MIT / http://bit.ly/mit-license 5 | Version 0.96 6 | 7 | http://headjs.com 8 | */ 9 | (function(a){function z(){d||(d=!0,s(e,function(a){p(a)}))}function y(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.async=!1,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.done=!0,d())},(a.body||b).appendChild(e)}function x(a,b){if(a.state==o)return b&&b();if(a.state==n)return k.ready(a.name,b);if(a.state==m)return a.onpreload.push(function(){x(a,b)});a.state=n,y(a.url,function(){a.state=o,b&&b(),s(g[a.name],function(a){p(a)}),u()&&d&&s(g.ALL,function(a){p(a)})})}function w(a,b){a.state===undefined&&(a.state=m,a.onpreload=[],y({src:a.url,type:"cache"},function(){v(a)}))}function v(a){a.state=l,s(a.onpreload,function(a){a.call()})}function u(a){a=a||h;var b;for(var c in a){if(a.hasOwnProperty(c)&&a[c].state!=o)return!1;b=!0}return b}function t(a){return Object.prototype.toString.call(a)=="[object Function]"}function s(a,b){if(!!a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c 0 ) { 48 | text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' ); 49 | } 50 | else if( leadingWs > 1 ) { 51 | text = text.replace( new RegExp('\\n? {' + leadingWs + '}','g'), '\n' ); 52 | } 53 | 54 | return text; 55 | 56 | } 57 | 58 | /** 59 | * Given a markdown slide section element, this will 60 | * return all arguments that aren't related to markdown 61 | * parsing. Used to forward any other user-defined arguments 62 | * to the output markdown slide. 63 | */ 64 | function getForwardedAttributes( section ) { 65 | 66 | var attributes = section.attributes; 67 | var result = []; 68 | 69 | for( var i = 0, len = attributes.length; i < len; i++ ) { 70 | var name = attributes[i].name, 71 | value = attributes[i].value; 72 | 73 | // disregard attributes that are used for markdown loading/parsing 74 | if( /data\-(markdown|separator|vertical|notes)/gi.test( name ) ) continue; 75 | 76 | if( value ) { 77 | result.push( name + '=' + value ); 78 | } 79 | else { 80 | result.push( name ); 81 | } 82 | } 83 | 84 | return result.join( ' ' ); 85 | 86 | } 87 | 88 | /** 89 | * Inspects the given options and fills out default 90 | * values for what's not defined. 91 | */ 92 | function getSlidifyOptions( options ) { 93 | 94 | options = options || {}; 95 | options.separator = options.separator || DEFAULT_SLIDE_SEPARATOR; 96 | options.notesSeparator = options.notesSeparator || DEFAULT_NOTES_SEPARATOR; 97 | options.attributes = options.attributes || ''; 98 | 99 | return options; 100 | 101 | } 102 | 103 | /** 104 | * Helper function for constructing a markdown slide. 105 | */ 106 | function createMarkdownSlide( content, options ) { 107 | 108 | options = getSlidifyOptions( options ); 109 | 110 | var notesMatch = content.split( new RegExp( options.notesSeparator, 'mgi' ) ); 111 | 112 | if( notesMatch.length === 2 ) { 113 | content = notesMatch[0] + ''; 114 | } 115 | 116 | return ''; 117 | 118 | } 119 | 120 | /** 121 | * Parses a data string into multiple slides based 122 | * on the passed in separator arguments. 123 | */ 124 | function slidify( markdown, options ) { 125 | 126 | options = getSlidifyOptions( options ); 127 | 128 | var separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ), 129 | horizontalSeparatorRegex = new RegExp( options.separator ); 130 | 131 | var matches, 132 | lastIndex = 0, 133 | isHorizontal, 134 | wasHorizontal = true, 135 | content, 136 | sectionStack = []; 137 | 138 | // iterate until all blocks between separators are stacked up 139 | while( matches = separatorRegex.exec( markdown ) ) { 140 | notes = null; 141 | 142 | // determine direction (horizontal by default) 143 | isHorizontal = horizontalSeparatorRegex.test( matches[0] ); 144 | 145 | if( !isHorizontal && wasHorizontal ) { 146 | // create vertical stack 147 | sectionStack.push( [] ); 148 | } 149 | 150 | // pluck slide content from markdown input 151 | content = markdown.substring( lastIndex, matches.index ); 152 | 153 | if( isHorizontal && wasHorizontal ) { 154 | // add to horizontal stack 155 | sectionStack.push( content ); 156 | } 157 | else { 158 | // add to vertical stack 159 | sectionStack[sectionStack.length-1].push( content ); 160 | } 161 | 162 | lastIndex = separatorRegex.lastIndex; 163 | wasHorizontal = isHorizontal; 164 | } 165 | 166 | // add the remaining slide 167 | ( wasHorizontal ? sectionStack : sectionStack[sectionStack.length-1] ).push( markdown.substring( lastIndex ) ); 168 | 169 | var markdownSections = ''; 170 | 171 | // flatten the hierarchical stack, and insert
tags 172 | for( var i = 0, len = sectionStack.length; i < len; i++ ) { 173 | // vertical 174 | if( sectionStack[i].propertyIsEnumerable( length ) && typeof sectionStack[i].splice === 'function' ) { 175 | markdownSections += '
'; 176 | 177 | sectionStack[i].forEach( function( child ) { 178 | markdownSections += '
' + createMarkdownSlide( child, options ) + '
'; 179 | } ); 180 | 181 | markdownSections += '
'; 182 | } 183 | else { 184 | markdownSections += '
' + createMarkdownSlide( sectionStack[i], options ) + '
'; 185 | } 186 | } 187 | 188 | return markdownSections; 189 | 190 | } 191 | 192 | /** 193 | * Parses any current data-markdown slides, splits 194 | * multi-slide markdown into separate sections and 195 | * handles loading of external markdown. 196 | */ 197 | function processSlides() { 198 | 199 | var sections = document.querySelectorAll( '[data-markdown]'), 200 | section; 201 | 202 | for( var i = 0, len = sections.length; i < len; i++ ) { 203 | 204 | section = sections[i]; 205 | 206 | if( section.getAttribute( 'data-markdown' ).length ) { 207 | 208 | var xhr = new XMLHttpRequest(), 209 | url = section.getAttribute( 'data-markdown' ); 210 | 211 | datacharset = section.getAttribute( 'data-charset' ); 212 | 213 | // see https://developer.mozilla.org/en-US/docs/Web/API/element.getAttribute#Notes 214 | if( datacharset != null && datacharset != '' ) { 215 | xhr.overrideMimeType( 'text/html; charset=' + datacharset ); 216 | } 217 | 218 | xhr.onreadystatechange = function() { 219 | if( xhr.readyState === 4 ) { 220 | if ( xhr.status >= 200 && xhr.status < 300 ) { 221 | 222 | section.outerHTML = slidify( xhr.responseText, { 223 | separator: section.getAttribute( 'data-separator' ), 224 | verticalSeparator: section.getAttribute( 'data-vertical' ), 225 | notesSeparator: section.getAttribute( 'data-notes' ), 226 | attributes: getForwardedAttributes( section ) 227 | }); 228 | 229 | } 230 | else { 231 | 232 | section.outerHTML = '
' + 233 | 'ERROR: The attempt to fetch ' + url + ' failed with HTTP status ' + xhr.status + '.' + 234 | 'Check your browser\'s JavaScript console for more details.' + 235 | '

Remember that you need to serve the presentation HTML from a HTTP server.

' + 236 | '
'; 237 | 238 | } 239 | } 240 | }; 241 | 242 | xhr.open( 'GET', url, false ); 243 | 244 | try { 245 | xhr.send(); 246 | } 247 | catch ( e ) { 248 | alert( 'Failed to get the Markdown file ' + url + '. Make sure that the presentation and the file are served by a HTTP server and the file can be found there. ' + e ); 249 | } 250 | 251 | } 252 | else if( section.getAttribute( 'data-separator' ) || section.getAttribute( 'data-vertical' ) || section.getAttribute( 'data-notes' ) ) { 253 | 254 | section.outerHTML = slidify( getMarkdownFromSlide( section ), { 255 | separator: section.getAttribute( 'data-separator' ), 256 | verticalSeparator: section.getAttribute( 'data-vertical' ), 257 | notesSeparator: section.getAttribute( 'data-notes' ), 258 | attributes: getForwardedAttributes( section ) 259 | }); 260 | 261 | } 262 | else { 263 | 264 | section.innerHTML = createMarkdownSlide( getMarkdownFromSlide( section ) ); 265 | 266 | } 267 | } 268 | 269 | } 270 | 271 | /** 272 | * Converts any current data-markdown slides in the 273 | * DOM to HTML. 274 | */ 275 | function convertSlides() { 276 | 277 | var sections = document.querySelectorAll( '[data-markdown]'); 278 | 279 | for( var i = 0, len = sections.length; i < len; i++ ) { 280 | 281 | var section = sections[i]; 282 | 283 | // Only parse the same slide once 284 | if( !section.getAttribute( 'data-markdown-parsed' ) ) { 285 | 286 | section.setAttribute( 'data-markdown-parsed', true ) 287 | 288 | var notes = section.querySelector( 'aside.notes' ); 289 | var markdown = getMarkdownFromSlide( section ); 290 | 291 | section.innerHTML = marked( markdown ); 292 | 293 | // If there were notes, we need to re-add them after 294 | // having overwritten the section's HTML 295 | if( notes ) { 296 | section.appendChild( notes ); 297 | } 298 | 299 | } 300 | 301 | } 302 | 303 | } 304 | 305 | // API 306 | return { 307 | 308 | initialize: function() { 309 | processSlides(); 310 | convertSlides(); 311 | }, 312 | 313 | // TODO: Do these belong in the API? 314 | processSlides: processSlides, 315 | convertSlides: convertSlides, 316 | slidify: slidify 317 | 318 | }; 319 | 320 | })); 321 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/reveal-plugins/notes/notes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | reveal.js - Slide Notes 7 | 8 | 139 | 140 | 141 | 142 | 143 |
144 |
UPCOMING:
145 |
146 |
147 |

Time

148 |
149 | 0:00 AM 150 |
151 |
152 | 00:00:00 153 |
154 |
155 |
156 | 157 | 161 |
162 | 163 | 164 | 386 | 387 | 388 | -------------------------------------------------------------------------------- /doc/Bay-Area-UseR-2015/lib/reveal-plugins/notes/notes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Handles opening of and synchronization with the reveal.js 3 | * notes window. 4 | * 5 | * Handshake process: 6 | * 1. This window posts 'connect' to notes window 7 | * - Includes URL of presentation to show 8 | * 2. Notes window responds with 'connected' when it is available 9 | * 3. This window proceeds to send the current presentation state 10 | * to the notes window 11 | */ 12 | var RevealNotes = (function() { 13 | 14 | function openNotes() { 15 | var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path 16 | jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path 17 | var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1100,height=700' ); 18 | 19 | /** 20 | * Connect to the notes window through a postmessage handshake. 21 | * Using postmessage enables us to work in situations where the 22 | * origins differ, such as a presentation being opened from the 23 | * file system. 24 | */ 25 | function connect() { 26 | // Keep trying to connect until we get a 'connected' message back 27 | var connectInterval = setInterval( function() { 28 | notesPopup.postMessage( JSON.stringify( { 29 | namespace: 'reveal-notes', 30 | type: 'connect', 31 | url: window.location.protocol + '//' + window.location.host + window.location.pathname, 32 | state: Reveal.getState() 33 | } ), '*' ); 34 | }, 500 ); 35 | 36 | window.addEventListener( 'message', function( event ) { 37 | var data = JSON.parse( event.data ); 38 | if( data && data.namespace === 'reveal-notes' && data.type === 'connected' ) { 39 | clearInterval( connectInterval ); 40 | onConnected(); 41 | } 42 | } ); 43 | } 44 | 45 | /** 46 | * Posts the current slide data to the notes window 47 | */ 48 | function post() { 49 | 50 | var slideElement = Reveal.getCurrentSlide(), 51 | notesElement = slideElement.querySelector( 'aside.notes' ); 52 | 53 | var messageData = { 54 | namespace: 'reveal-notes', 55 | type: 'state', 56 | notes: '', 57 | markdown: false, 58 | state: Reveal.getState() 59 | }; 60 | 61 | // Look for notes defined in a slide attribute 62 | if( slideElement.hasAttribute( 'data-notes' ) ) { 63 | messageData.notes = slideElement.getAttribute( 'data-notes' ); 64 | } 65 | 66 | // Look for notes defined in an aside element 67 | if( notesElement ) { 68 | messageData.notes = notesElement.innerHTML; 69 | messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string'; 70 | } 71 | 72 | notesPopup.postMessage( JSON.stringify( messageData ), '*' ); 73 | 74 | } 75 | 76 | /** 77 | * Called once we have established a connection to the notes 78 | * window. 79 | */ 80 | function onConnected() { 81 | 82 | // Monitor events that trigger a change in state 83 | Reveal.addEventListener( 'slidechanged', post ); 84 | Reveal.addEventListener( 'fragmentshown', post ); 85 | Reveal.addEventListener( 'fragmenthidden', post ); 86 | Reveal.addEventListener( 'overviewhidden', post ); 87 | Reveal.addEventListener( 'overviewshown', post ); 88 | Reveal.addEventListener( 'paused', post ); 89 | Reveal.addEventListener( 'resumed', post ); 90 | 91 | // Post the initial state 92 | post(); 93 | 94 | } 95 | 96 | connect(); 97 | } 98 | 99 | // If the there's a 'notes' query set, open directly 100 | if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { 101 | openNotes(); 102 | } 103 | 104 | // Open the notes when the 's' key is hit 105 | document.addEventListener( 'keydown', function( event ) { 106 | // Disregard the event if the target is editable or a 107 | // modifier is present 108 | if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return; 109 | 110 | if( event.keyCode === 83 ) { 111 | event.preventDefault(); 112 | openNotes(); 113 | } 114 | }, false ); 115 | 116 | return { open: openNotes }; 117 | })(); 118 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/asul/asul-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/asul/asul-bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/asul/asul-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/asul/asul-bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/asul/asul-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/asul/asul-regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/asul/asul-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/asul/asul-regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/asul/asul.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Asul'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('asul-regular.woff') format('woff'), 8 | url('asul-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Asul'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('asul-bold.woff') format('woff'), 15 | url('asul-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/cabinsketch/cabinsketch-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/cabinsketch/cabinsketch-bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/cabinsketch/cabinsketch-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/cabinsketch/cabinsketch-bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/cabinsketch/cabinsketch-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/cabinsketch/cabinsketch-regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/cabinsketch/cabinsketch-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/cabinsketch/cabinsketch-regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/cabinsketch/cabinsketch.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Cabin Sketch'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('cabinsketch-regular.woff') format('woff'), 8 | url('cabinsketch-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Cabin Sketch'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('cabinsketch-regular.woff') format('woff'), 15 | url('cabinsketch-regular.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-bolditalic.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-bolditalic.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-italic.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-italic.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans-regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/josefinsans/josefinsans.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Josefin Sans'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('josefinsans-regular.woff') format('woff'), 8 | url('josefinsans-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Josefin Sans'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('josefinsans-bold.woff') format('woff'), 15 | url('josefinsans-bold.ttf') format('truetype'); 16 | } 17 | @font-face { 18 | font-family: 'Josefin Sans'; 19 | font-style: italic; 20 | font-weight: 400; 21 | src: url('josefinsans-italic.woff') format('woff'), 22 | url('josefinsans-italic.ttf') format('truetype'); 23 | } 24 | @font-face { 25 | font-family: 'Josefin Sans'; 26 | font-style: italic; 27 | font-weight: 700; 28 | src: url('josefinsans-bolditalic.woff') format('woff'), 29 | url('josefinsans-bolditalic.ttf') format('truetype'); 30 | } 31 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-Regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Math-Regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/katex/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/lato/lato-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/lato/lato-bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/lato/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/lato/lato-bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/lato/lato-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/lato/lato-bolditalic.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/lato/lato-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/lato/lato-bolditalic.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/lato/lato-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/lato/lato-italic.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/lato/lato-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/lato/lato-italic.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/lato/lato-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/lato/lato-regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/lato/lato-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/lato/lato-regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/lato/lato.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Lato'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('lato-regular.woff') format('woff'), 8 | url('lato-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Lato'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('lato-bold.woff') format('woff'), 15 | url('lato-bold.ttf') format('truetype'); 16 | } 17 | @font-face { 18 | font-family: 'Lato'; 19 | font-style: italic; 20 | font-weight: 400; 21 | src: url('lato-italic.woff') format('woff'), 22 | url('lato-italic.ttf') format('truetype'); 23 | } 24 | @font-face { 25 | font-family: 'Lato'; 26 | font-style: italic; 27 | font-weight: 700; 28 | src: url('lato-bolditalic.woff') format('woff'), 29 | url('lato-bolditalic.ttf') format('truetype'); 30 | } 31 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/league/league_gothic.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'League Gothic'; 3 | src: url('league_gothic.woff') format('woff'), 4 | url('league_gothic.ttf') format('truetype'); 5 | 6 | font-weight: normal; 7 | font-style: normal; 8 | } 9 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/league/league_gothic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/league/league_gothic.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/league/league_gothic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/league/league_gothic.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/league/league_gothic_license: -------------------------------------------------------------------------------- 1 | SIL Open Font License (OFL) 2 | http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL 3 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/merriweathersans/merriweathersans-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/merriweathersans/merriweathersans-bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/merriweathersans/merriweathersans-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/merriweathersans/merriweathersans-bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/merriweathersans/merriweathersans-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/merriweathersans/merriweathersans-regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/merriweathersans/merriweathersans-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/merriweathersans/merriweathersans-regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/merriweathersans/merriweathersans.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Merriweather Sans'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('merriweathersans-regular.woff') format('woff'), 8 | url('merriweathersans-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Merriweather Sans'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('merriweathersans-bold.woff') format('woff'), 15 | url('merriweathersans-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/montserrat/montserrat-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/montserrat/montserrat-bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/montserrat/montserrat-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/montserrat/montserrat-bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/montserrat/montserrat-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/montserrat/montserrat-regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/montserrat/montserrat-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/montserrat/montserrat-regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/montserrat/montserrat.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Montserrat'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('montserrat-regular.woff') format('woff'), 8 | url('montserrat-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Montserrat'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('montserrat-bold.woff') format('woff'), 15 | url('montserrat-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/newscycle/newscycle-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/newscycle/newscycle-bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/newscycle/newscycle-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/newscycle/newscycle-bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/newscycle/newscycle-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/newscycle/newscycle-regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/newscycle/newscycle-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/newscycle/newscycle-regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/newscycle/newscycle.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'News Cycle'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('newscycle-regular.woff') format('woff'), 8 | url('newscycle-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'News Cycle'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('newscycle-bold.woff') format('woff'), 15 | url('newscycle-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-bolditalic.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-bolditalic.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-italic.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-italic.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/opensans/opensans-regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/opensans/opensans.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Open Sans'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('opensans-regular.woff') format('woff'), 8 | url('opensans-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Open Sans'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('opensans-bold.woff') format('woff'), 15 | url('opensans-bold.ttf') format('truetype'); 16 | } 17 | @font-face { 18 | font-family: 'Open Sans'; 19 | font-style: italic; 20 | font-weight: 400; 21 | src: url('opensans-italic.woff') format('woff'), 22 | url('opensans-italic.ttf') format('truetype'); 23 | } 24 | @font-face { 25 | font-family: 'Open Sans'; 26 | font-style: italic; 27 | font-weight: 700; 28 | src: url('opensans-bolditalic.woff') format('woff'), 29 | url('opensans-bolditalic.ttf') format('truetype'); 30 | } 31 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-light.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-light.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/overpass/overpass-regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/overpass/overpass.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Overpass'; 3 | font-style: normal; 4 | font-weight: bold; 5 | src: url('overpass-bold.woff') format('woff'), 6 | url('overpass-bold.ttf') format('truetype'); 7 | } 8 | 9 | 10 | @font-face { 11 | font-family: 'Overpass'; 12 | font-style: normal; 13 | font-weight: 500; 14 | src: url('overpass-regular.woff') format('woff'), 15 | url('overpass-regular.ttf') format('truetype'); 16 | } 17 | 18 | 19 | @font-face { 20 | font-family: 'Overpass'; 21 | font-style: normal; 22 | font-weight: normal; 23 | src: url('overpass-light.woff') format('woff'), 24 | url('overpass-light.ttf') format('truetype'); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/oxygen/oxygen-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/oxygen/oxygen-bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/oxygen/oxygen-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/oxygen/oxygen-bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/oxygen/oxygen-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/oxygen/oxygen-regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/oxygen/oxygen-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/oxygen/oxygen-regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/oxygen/oxygen.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Oxygen'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('oxygen-regular.woff') format('woff'), 8 | url('oxygen-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Oxygen'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('oxygen-bold.woff') format('woff'), 15 | url('oxygen-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/quicksand/quicksand-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/quicksand/quicksand-bold.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/quicksand/quicksand-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/quicksand/quicksand-bold.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/quicksand/quicksand-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/quicksand/quicksand-regular.ttf -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/quicksand/quicksand-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/lib/fonts/quicksand/quicksand-regular.woff -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/fonts/quicksand/quicksand.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 10, 2013 */ 2 | 3 | @font-face { 4 | font-family: 'Quicksand'; 5 | font-style: normal; 6 | font-weight: 400; 7 | src: url('quicksand-regular.woff') format('woff'), 8 | url('quicksand-regular.ttf') format('truetype'); 9 | } 10 | @font-face { 11 | font-family: 'Quicksand'; 12 | font-style: normal; 13 | font-weight: 700; 14 | src: url('quicksand-bold.woff') format('woff'), 15 | url('quicksand-bold.ttf') format('truetype'); 16 | } 17 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/head.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | Head JS The only script in your 3 | Copyright Tero Piirainen (tipiirai) 4 | License MIT / http://bit.ly/mit-license 5 | Version 0.96 6 | 7 | http://headjs.com 8 | */ 9 | (function(a){function z(){d||(d=!0,s(e,function(a){p(a)}))}function y(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.async=!1,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.done=!0,d())},(a.body||b).appendChild(e)}function x(a,b){if(a.state==o)return b&&b();if(a.state==n)return k.ready(a.name,b);if(a.state==m)return a.onpreload.push(function(){x(a,b)});a.state=n,y(a.url,function(){a.state=o,b&&b(),s(g[a.name],function(a){p(a)}),u()&&d&&s(g.ALL,function(a){p(a)})})}function w(a,b){a.state===undefined&&(a.state=m,a.onpreload=[],y({src:a.url,type:"cache"},function(){v(a)}))}function v(a){a.state=l,s(a.onpreload,function(a){a.call()})}function u(a){a=a||h;var b;for(var c in a){if(a.hasOwnProperty(c)&&a[c].state!=o)return!1;b=!0}return b}function t(a){return Object.prototype.toString.call(a)=="[object Function]"}function s(a,b){if(!!a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c 0 ) { 48 | text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' ); 49 | } 50 | else if( leadingWs > 1 ) { 51 | text = text.replace( new RegExp('\\n? {' + leadingWs + '}','g'), '\n' ); 52 | } 53 | 54 | return text; 55 | 56 | } 57 | 58 | /** 59 | * Given a markdown slide section element, this will 60 | * return all arguments that aren't related to markdown 61 | * parsing. Used to forward any other user-defined arguments 62 | * to the output markdown slide. 63 | */ 64 | function getForwardedAttributes( section ) { 65 | 66 | var attributes = section.attributes; 67 | var result = []; 68 | 69 | for( var i = 0, len = attributes.length; i < len; i++ ) { 70 | var name = attributes[i].name, 71 | value = attributes[i].value; 72 | 73 | // disregard attributes that are used for markdown loading/parsing 74 | if( /data\-(markdown|separator|vertical|notes)/gi.test( name ) ) continue; 75 | 76 | if( value ) { 77 | result.push( name + '=' + value ); 78 | } 79 | else { 80 | result.push( name ); 81 | } 82 | } 83 | 84 | return result.join( ' ' ); 85 | 86 | } 87 | 88 | /** 89 | * Inspects the given options and fills out default 90 | * values for what's not defined. 91 | */ 92 | function getSlidifyOptions( options ) { 93 | 94 | options = options || {}; 95 | options.separator = options.separator || DEFAULT_SLIDE_SEPARATOR; 96 | options.notesSeparator = options.notesSeparator || DEFAULT_NOTES_SEPARATOR; 97 | options.attributes = options.attributes || ''; 98 | 99 | return options; 100 | 101 | } 102 | 103 | /** 104 | * Helper function for constructing a markdown slide. 105 | */ 106 | function createMarkdownSlide( content, options ) { 107 | 108 | options = getSlidifyOptions( options ); 109 | 110 | var notesMatch = content.split( new RegExp( options.notesSeparator, 'mgi' ) ); 111 | 112 | if( notesMatch.length === 2 ) { 113 | content = notesMatch[0] + ''; 114 | } 115 | 116 | return ''; 117 | 118 | } 119 | 120 | /** 121 | * Parses a data string into multiple slides based 122 | * on the passed in separator arguments. 123 | */ 124 | function slidify( markdown, options ) { 125 | 126 | options = getSlidifyOptions( options ); 127 | 128 | var separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ), 129 | horizontalSeparatorRegex = new RegExp( options.separator ); 130 | 131 | var matches, 132 | lastIndex = 0, 133 | isHorizontal, 134 | wasHorizontal = true, 135 | content, 136 | sectionStack = []; 137 | 138 | // iterate until all blocks between separators are stacked up 139 | while( matches = separatorRegex.exec( markdown ) ) { 140 | notes = null; 141 | 142 | // determine direction (horizontal by default) 143 | isHorizontal = horizontalSeparatorRegex.test( matches[0] ); 144 | 145 | if( !isHorizontal && wasHorizontal ) { 146 | // create vertical stack 147 | sectionStack.push( [] ); 148 | } 149 | 150 | // pluck slide content from markdown input 151 | content = markdown.substring( lastIndex, matches.index ); 152 | 153 | if( isHorizontal && wasHorizontal ) { 154 | // add to horizontal stack 155 | sectionStack.push( content ); 156 | } 157 | else { 158 | // add to vertical stack 159 | sectionStack[sectionStack.length-1].push( content ); 160 | } 161 | 162 | lastIndex = separatorRegex.lastIndex; 163 | wasHorizontal = isHorizontal; 164 | } 165 | 166 | // add the remaining slide 167 | ( wasHorizontal ? sectionStack : sectionStack[sectionStack.length-1] ).push( markdown.substring( lastIndex ) ); 168 | 169 | var markdownSections = ''; 170 | 171 | // flatten the hierarchical stack, and insert
tags 172 | for( var i = 0, len = sectionStack.length; i < len; i++ ) { 173 | // vertical 174 | if( sectionStack[i].propertyIsEnumerable( length ) && typeof sectionStack[i].splice === 'function' ) { 175 | markdownSections += '
'; 176 | 177 | sectionStack[i].forEach( function( child ) { 178 | markdownSections += '
' + createMarkdownSlide( child, options ) + '
'; 179 | } ); 180 | 181 | markdownSections += '
'; 182 | } 183 | else { 184 | markdownSections += '
' + createMarkdownSlide( sectionStack[i], options ) + '
'; 185 | } 186 | } 187 | 188 | return markdownSections; 189 | 190 | } 191 | 192 | /** 193 | * Parses any current data-markdown slides, splits 194 | * multi-slide markdown into separate sections and 195 | * handles loading of external markdown. 196 | */ 197 | function processSlides() { 198 | 199 | var sections = document.querySelectorAll( '[data-markdown]'), 200 | section; 201 | 202 | for( var i = 0, len = sections.length; i < len; i++ ) { 203 | 204 | section = sections[i]; 205 | 206 | if( section.getAttribute( 'data-markdown' ).length ) { 207 | 208 | var xhr = new XMLHttpRequest(), 209 | url = section.getAttribute( 'data-markdown' ); 210 | 211 | datacharset = section.getAttribute( 'data-charset' ); 212 | 213 | // see https://developer.mozilla.org/en-US/docs/Web/API/element.getAttribute#Notes 214 | if( datacharset != null && datacharset != '' ) { 215 | xhr.overrideMimeType( 'text/html; charset=' + datacharset ); 216 | } 217 | 218 | xhr.onreadystatechange = function() { 219 | if( xhr.readyState === 4 ) { 220 | if ( xhr.status >= 200 && xhr.status < 300 ) { 221 | 222 | section.outerHTML = slidify( xhr.responseText, { 223 | separator: section.getAttribute( 'data-separator' ), 224 | verticalSeparator: section.getAttribute( 'data-vertical' ), 225 | notesSeparator: section.getAttribute( 'data-notes' ), 226 | attributes: getForwardedAttributes( section ) 227 | }); 228 | 229 | } 230 | else { 231 | 232 | section.outerHTML = '
' + 233 | 'ERROR: The attempt to fetch ' + url + ' failed with HTTP status ' + xhr.status + '.' + 234 | 'Check your browser\'s JavaScript console for more details.' + 235 | '

Remember that you need to serve the presentation HTML from a HTTP server.

' + 236 | '
'; 237 | 238 | } 239 | } 240 | }; 241 | 242 | xhr.open( 'GET', url, false ); 243 | 244 | try { 245 | xhr.send(); 246 | } 247 | catch ( e ) { 248 | alert( 'Failed to get the Markdown file ' + url + '. Make sure that the presentation and the file are served by a HTTP server and the file can be found there. ' + e ); 249 | } 250 | 251 | } 252 | else if( section.getAttribute( 'data-separator' ) || section.getAttribute( 'data-vertical' ) || section.getAttribute( 'data-notes' ) ) { 253 | 254 | section.outerHTML = slidify( getMarkdownFromSlide( section ), { 255 | separator: section.getAttribute( 'data-separator' ), 256 | verticalSeparator: section.getAttribute( 'data-vertical' ), 257 | notesSeparator: section.getAttribute( 'data-notes' ), 258 | attributes: getForwardedAttributes( section ) 259 | }); 260 | 261 | } 262 | else { 263 | 264 | section.innerHTML = createMarkdownSlide( getMarkdownFromSlide( section ) ); 265 | 266 | } 267 | } 268 | 269 | } 270 | 271 | /** 272 | * Converts any current data-markdown slides in the 273 | * DOM to HTML. 274 | */ 275 | function convertSlides() { 276 | 277 | var sections = document.querySelectorAll( '[data-markdown]'); 278 | 279 | for( var i = 0, len = sections.length; i < len; i++ ) { 280 | 281 | var section = sections[i]; 282 | 283 | // Only parse the same slide once 284 | if( !section.getAttribute( 'data-markdown-parsed' ) ) { 285 | 286 | section.setAttribute( 'data-markdown-parsed', true ) 287 | 288 | var notes = section.querySelector( 'aside.notes' ); 289 | var markdown = getMarkdownFromSlide( section ); 290 | 291 | section.innerHTML = marked( markdown ); 292 | 293 | // If there were notes, we need to re-add them after 294 | // having overwritten the section's HTML 295 | if( notes ) { 296 | section.appendChild( notes ); 297 | } 298 | 299 | } 300 | 301 | } 302 | 303 | } 304 | 305 | // API 306 | return { 307 | 308 | initialize: function() { 309 | processSlides(); 310 | convertSlides(); 311 | }, 312 | 313 | // TODO: Do these belong in the API? 314 | processSlides: processSlides, 315 | convertSlides: convertSlides, 316 | slidify: slidify 317 | 318 | }; 319 | 320 | })); 321 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/reveal-plugins/notes/notes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | reveal.js - Slide Notes 7 | 8 | 139 | 140 | 141 | 142 | 143 |
144 |
UPCOMING:
145 |
146 |
147 |

Time

148 |
149 | 0:00 AM 150 |
151 |
152 | 00:00:00 153 |
154 |
155 |
156 | 157 | 161 |
162 | 163 | 164 | 386 | 387 | 388 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/lib/reveal-plugins/notes/notes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Handles opening of and synchronization with the reveal.js 3 | * notes window. 4 | * 5 | * Handshake process: 6 | * 1. This window posts 'connect' to notes window 7 | * - Includes URL of presentation to show 8 | * 2. Notes window responds with 'connected' when it is available 9 | * 3. This window proceeds to send the current presentation state 10 | * to the notes window 11 | */ 12 | var RevealNotes = (function() { 13 | 14 | function openNotes() { 15 | var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path 16 | jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path 17 | var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1100,height=700' ); 18 | 19 | /** 20 | * Connect to the notes window through a postmessage handshake. 21 | * Using postmessage enables us to work in situations where the 22 | * origins differ, such as a presentation being opened from the 23 | * file system. 24 | */ 25 | function connect() { 26 | // Keep trying to connect until we get a 'connected' message back 27 | var connectInterval = setInterval( function() { 28 | notesPopup.postMessage( JSON.stringify( { 29 | namespace: 'reveal-notes', 30 | type: 'connect', 31 | url: window.location.protocol + '//' + window.location.host + window.location.pathname, 32 | state: Reveal.getState() 33 | } ), '*' ); 34 | }, 500 ); 35 | 36 | window.addEventListener( 'message', function( event ) { 37 | var data = JSON.parse( event.data ); 38 | if( data && data.namespace === 'reveal-notes' && data.type === 'connected' ) { 39 | clearInterval( connectInterval ); 40 | onConnected(); 41 | } 42 | } ); 43 | } 44 | 45 | /** 46 | * Posts the current slide data to the notes window 47 | */ 48 | function post() { 49 | 50 | var slideElement = Reveal.getCurrentSlide(), 51 | notesElement = slideElement.querySelector( 'aside.notes' ); 52 | 53 | var messageData = { 54 | namespace: 'reveal-notes', 55 | type: 'state', 56 | notes: '', 57 | markdown: false, 58 | state: Reveal.getState() 59 | }; 60 | 61 | // Look for notes defined in a slide attribute 62 | if( slideElement.hasAttribute( 'data-notes' ) ) { 63 | messageData.notes = slideElement.getAttribute( 'data-notes' ); 64 | } 65 | 66 | // Look for notes defined in an aside element 67 | if( notesElement ) { 68 | messageData.notes = notesElement.innerHTML; 69 | messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string'; 70 | } 71 | 72 | notesPopup.postMessage( JSON.stringify( messageData ), '*' ); 73 | 74 | } 75 | 76 | /** 77 | * Called once we have established a connection to the notes 78 | * window. 79 | */ 80 | function onConnected() { 81 | 82 | // Monitor events that trigger a change in state 83 | Reveal.addEventListener( 'slidechanged', post ); 84 | Reveal.addEventListener( 'fragmentshown', post ); 85 | Reveal.addEventListener( 'fragmenthidden', post ); 86 | Reveal.addEventListener( 'overviewhidden', post ); 87 | Reveal.addEventListener( 'overviewshown', post ); 88 | Reveal.addEventListener( 'paused', post ); 89 | Reveal.addEventListener( 'resumed', post ); 90 | 91 | // Post the initial state 92 | post(); 93 | 94 | } 95 | 96 | connect(); 97 | } 98 | 99 | // If the there's a 'notes' query set, open directly 100 | if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { 101 | openNotes(); 102 | } 103 | 104 | // Open the notes when the 's' key is hit 105 | document.addEventListener( 'keydown', function( event ) { 106 | // Disregard the event if the target is editable or a 107 | // modifier is present 108 | if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return; 109 | 110 | if( event.keyCode === 83 ) { 111 | event.preventDefault(); 112 | openNotes(); 113 | } 114 | }, false ); 115 | 116 | return { open: openNotes }; 117 | })(); 118 | -------------------------------------------------------------------------------- /doc/NESS-2015-Presentation/scalable-exact-approaches-to-fitting-linear-models-when-n-p/1309455-Screen_Shot_2015-04-24_at_10.55.15_PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaneplusplus/ioregression/ffe43ee4a6ec8b02acba8f4719543f73a39d5d6a/doc/NESS-2015-Presentation/scalable-exact-approaches-to-fitting-linear-models-when-n-p/1309455-Screen_Shot_2015-04-24_at_10.55.15_PM.png -------------------------------------------------------------------------------- /inst/ref-impl/glmnet-ref.r: -------------------------------------------------------------------------------- 1 | 2 | soft_thresh = function(x, g) { 3 | x = as.vector(x) 4 | w1 = which(g >= abs(x)) 5 | w2 = which(g < abs(x) & x > 0) 6 | w3 = which(g < abs(x) & x < 0) 7 | ret = x 8 | ret[w1] = 0 9 | ret[w2] = x[w2]-g 10 | ret[w3] = x[w3]+g 11 | ret 12 | } 13 | 14 | lmnet_ref = function(X, y, lambda, alpha, maxit=10000, tol=1e-7) { 15 | beta = rep(0, ncol(X)) 16 | xty = crossprod(X, y) 17 | xtx = crossprod(X) 18 | for(j in 1:maxit) { 19 | beta_old = beta 20 | #beta = soft_thresh((xty - xtx %*% beta)/nrow(X) + beta, lambda*alpha) 21 | for (l in 1:length(beta)) { 22 | beta[l] = soft_thresh(sum(X[,l]*(y - X[,-l] %*% beta_old[-l])), 23 | nrow(X)*lambda*alpha) 24 | } 25 | beta = beta / (colSums(X^2) + lambda*(1-alpha)) 26 | if(sqrt(crossprod(beta-beta_old)) < tol) break 27 | } 28 | list(beta=beta, iterations=j) 29 | } 30 | 31 | set.seed(3) 32 | x=matrix(rnorm(100*20),100,20) * 100 33 | y= sample(0:1,100,replace=TRUE) 34 | fit=glmnet(x,y, lambda=0.0454336178, standardize=FALSE, intercept=FALSE) 35 | 36 | fit_ref = lmnet_ref(x, y, lambda=0.0454336178, alpha=1) 37 | crossprod(fit_ref$beta, fit$beta) 38 | print("LMNET") 39 | 40 | print(cbind(fit$beta, fit_ref$beta)) 41 | stop("here") 42 | max(abs(fit_ref$beta - fit$beta)) 43 | 44 | glmnet_ref = function(X, y, lambda, alpha, family=binomial, maxit=10, tol=1e-08) 45 | { 46 | beta = matrix(rep(0,ncol(X)), ncol=1) 47 | ql = c() 48 | for(j in 1:maxit) 49 | { 50 | beta_outer_old = beta 51 | eta = as.matrix(X %*% beta) 52 | g = family()$linkinv(eta) 53 | gprime = family()$mu.eta(eta) 54 | z = eta + (y - g) / gprime 55 | W = as.vector(gprime^2 / family()$variance(g)) 56 | wx_norm = colSums(W*X^2) 57 | quad_loss = Inf 58 | for (k in 1:maxit) { 59 | quad_loss_old = Inf 60 | beta_inner_old = beta 61 | for (l in 1:length(beta)) { 62 | beta[l] = soft_thresh(sum(W*X[,l]*(z - X[,-l] %*% beta_inner_old[-l])), 63 | sum(W)*lambda*alpha) 64 | } 65 | beta = beta / (wx_norm + lambda*(1-alpha)) 66 | quad_loss = -1/2/nrow(X) * sum(W*(z - X %*% beta)^2) + 67 | lambda * (1-alpha) * sum(beta^2)/2 + alpha * sum(beta) 68 | if (quad_loss < quad_loss_old) quad_loss_old = quad_loss 69 | else { 70 | beta = beta_inner_old 71 | break 72 | } 73 | #if(sqrt(as.double(crossprod(beta-beta_inner_old))) < tol) break 74 | } 75 | ql = c(ql, quad_loss) 76 | if (sqrt(as.double(crossprod(beta-beta_outer_old))) < tol) break 77 | } 78 | list(beta=beta,iterations=j, ql=ql) 79 | } 80 | 81 | set.seed(3) 82 | x = matrix(rnorm(100*20),100,20) * 100 83 | #x <- scale(x) 84 | g2 = sample(0:1,100,replace=TRUE) 85 | 86 | #lambda = 0 87 | lambda = 0.0454336178 88 | 89 | fg = glmnet(x, g2, family="gaussian", lambda=lambda, standardize=FALSE, 90 | intercept=FALSE) 91 | fit = glmnet_ref(x, g2, family=gaussian, lambda=lambda, alpha=1, tol=0) 92 | 93 | max(abs(fg$beta - fit$beta)) 94 | print("GLMNET GAUSSIAN") 95 | print(cbind(fg$beta, fit$beta)) 96 | 97 | fg = glmnet(x, g2, family="binomial", lambda=lambda, standardize=FALSE, 98 | intercept=FALSE) 99 | fit = glmnet_ref(x, g2, family=binomial, lambda=lambda, alpha=1, tol=0) 100 | 101 | print(max(abs(fg$beta - fit$beta))) 102 | print("GLMNET BINOMIAL") 103 | print(cbind(fg$beta, fit$beta)) 104 | 105 | #fit$beta 106 | #fit$iterations 107 | crossprod(fit$beta, fg$beta) 108 | 109 | max(abs(fg$beta - fit$beta)) 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /tests/testthat.r: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | test_check("ioregression") 3 | -------------------------------------------------------------------------------- /tests/testthat/test-ioglm.r: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(adf) 3 | library(ioregression) 4 | 5 | TOL <- 1e-4 6 | 7 | # Download the data to a temp directory. 8 | temp_dir <- tempdir() 9 | bz_file_name <- file.path(temp_dir, "1987.csv.bz2") 10 | if (!file.exists(bz_file_name)) { 11 | download.file("http://stat-computing.org/dataexpo/2009/1987.csv.bz2", 12 | bz_file_name) 13 | } 14 | 15 | # Create an abstract data frame and a real data frame: 16 | data <- adf(bz_file_name, sep=",", header=TRUE, conMethod="bzfile") 17 | data <- allFactorLevels(data) 18 | df <- read.table(bzfile(bz_file_name), header=TRUE, sep=",") 19 | 20 | # Run a basic glm model and check the terms 21 | iofit <- ioglm((DepDelay > 15) ~ Distance + UniqueCarrier, data=data, 22 | family=binomial, trace=TRUE) 23 | lmfit <- glm((DepDelay > 15) ~ Distance + UniqueCarrier, data=df, 24 | family=binomial) 25 | expect_equal(coef(iofit), coef(lmfit), tol=TOL) 26 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients,tol=TOL) 27 | expect_equal(summary(iofit)[c("sigma", "df", "r.squared", "adj.r.squared", 28 | "fstatistic")], 29 | summary(lmfit)[c("sigma", "df", "r.squared", "adj.r.squared", 30 | "fstatistic")],tol=TOL) 31 | 32 | expect_equal(predict(iofit, df, type="link"), predict(lmfit, df, type="link")) 33 | expect_equal(predict(iofit, df, type="response"), 34 | predict(lmfit, df, type="response")) 35 | 36 | 37 | # Run a basic glm model with a poisson loss function and check the terms 38 | iofit <- ioglm((DepDelay > 15) ~ Distance + UniqueCarrier, data=data, 39 | family=poisson, trace=TRUE) 40 | lmfit <- glm((DepDelay > 15) ~ Distance + UniqueCarrier, data=df, 41 | family=poisson) 42 | expect_equal(coef(iofit),coef(lmfit),tol=TOL) 43 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients,tol=TOL) 44 | expect_equal(summary(iofit)[c("sigma", "df", "r.squared", "adj.r.squared", 45 | "fstatistic")], 46 | summary(lmfit)[c("sigma", "df", "r.squared", "adj.r.squared", 47 | "fstatistic")],tol=TOL) 48 | 49 | expect_equal(predict(iofit, df, type="link"), predict(lmfit, df, type="link")) 50 | expect_equal(predict(iofit, df, type="response"), 51 | predict(lmfit, df, type="response")) 52 | 53 | # Run a glm model without an intercept (a lot of the 54 | # metrics have special cases w/o an intercept) and check the terms 55 | iofit <- ioglm((DepDelay > 15) ~ Distance + UniqueCarrier - 1, data=data, 56 | family=binomial, trace=TRUE) 57 | lmfit <- glm((DepDelay > 15) ~ Distance + UniqueCarrier - 1, data=df, 58 | family=binomial) 59 | expect_equal(coef(iofit),coef(lmfit),tol=TOL) 60 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients, tol=TOL) 61 | expect_equal(summary(iofit)[c("sigma", "df", "r.squared", "adj.r.squared", 62 | "fstatistic")], 63 | summary(lmfit)[c("sigma", "df", "r.squared", "adj.r.squared", 64 | "fstatistic")], tol=TOL) 65 | 66 | expect_equal(predict(iofit, df, type="link"), predict(lmfit, df, type="link")) 67 | expect_equal(predict(iofit, df, type="response"), 68 | predict(lmfit, df, type="response")) 69 | 70 | 71 | # Run a glm model, only using observations where DepDelay > 0 72 | iofit <- ioglm((DepDelay > 15) ~ Distance + UniqueCarrier, data=data, 73 | family=binomial, subset="DepDelay > 0", trace=TRUE) 74 | lmfit <- glm((DepDelay > 15) ~ Distance + UniqueCarrier, data=df, 75 | family=binomial, subset=df$DepDelay > 0) 76 | expect_equal(coef(iofit),coef(lmfit)) 77 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients) 78 | expect_equal(summary(iofit)[c("sigma", "df", "r.squared", "adj.r.squared", 79 | "fstatistic")], 80 | summary(lmfit)[c("sigma", "df", "r.squared", "adj.r.squared", 81 | "fstatistic")]) 82 | 83 | expect_equal(predict(iofit, df, type="link"), predict(lmfit, df, type="link")) 84 | expect_equal(predict(iofit, df, type="response"), 85 | predict(lmfit, df, type="response")) 86 | 87 | 88 | # Run a glm model with a weight term (use Month since 89 | # it is non-negative and the best thing available). 90 | iofit <- ioglm((DepDelay > 15) ~ Distance + UniqueCarrier, data=data, 91 | family=binomial, weight="Month", trace=TRUE) 92 | lmfit <- glm((DepDelay > 15) ~ Distance + UniqueCarrier, data=df, 93 | family=binomial, weight=df$Month) 94 | expect_equal(coef(iofit),coef(lmfit),tol=TOL) 95 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients,tol=TOL) 96 | expect_equal(summary(iofit)[c("sigma", "df", "r.squared", "adj.r.squared", 97 | "fstatistic")], 98 | summary(lmfit)[c("sigma", "df", "r.squared", "adj.r.squared", 99 | "fstatistic")], tol=TOL) 100 | 101 | expect_equal(predict(iofit, df, type="link"), predict(lmfit, df, type="link")) 102 | expect_equal(predict(iofit, df, type="response"), 103 | predict(lmfit, df, type="response")) 104 | 105 | 106 | # Run a glm model with an offset. Use ArrDelay. 107 | iofit <- ioglm((DepDelay > 15) ~ Distance + UniqueCarrier, data=data, 108 | family=binomial, offset="ArrDelay", trace=TRUE) 109 | lmfit <- glm((DepDelay > 15) ~ Distance + UniqueCarrier, data=df, 110 | family=binomial, offset=df$ArrDelay) 111 | expect_equal(coef(iofit),coef(lmfit),tol=TOL) 112 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients,tol=TOL) 113 | expect_equal(summary(iofit)[c("sigma", "df", "r.squared", "adj.r.squared", 114 | "fstatistic")], 115 | summary(lmfit)[c("sigma", "df", "r.squared", "adj.r.squared", 116 | "fstatistic")], tol=TOL) 117 | 118 | # predict.glm with offset doesn't work. 119 | #expect_equal(predict(iofit, df, type="link"), predict(lmfit, df, type="link")) 120 | #expect_equal(predict(iofit, df, type="response"), 121 | # predict(lmfit, df, type="response")) 122 | # 123 | -------------------------------------------------------------------------------- /tests/testthat/test-iolm.r: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(adf) 3 | library(ioregression) 4 | 5 | # Download the data to a temp directory. 6 | library(adf) 7 | bz_file_name = file.path(temp_dir <- tempdir(), "1987.csv.bz2") 8 | if (!file.exists(bz_file_name)) { 9 | download.file("http://stat-computing.org/dataexpo/2009/1987.csv.bz2", 10 | bz_file_name) 11 | } 12 | 13 | # Create an abstract data frame and a real data frame: 14 | data = adf(bz_file_name, conMethod="bzfile", header=TRUE, sep=",") 15 | data = allFactorLevels(data) 16 | if(!exists("df")) df = read.table(bzfile(bz_file_name), header=TRUE, sep=",") 17 | 18 | # Run a basic linear regression and check the terms 19 | iofit = iolm(DepDelay ~ Distance + UniqueCarrier, data=data) 20 | lmfit = lm(DepDelay ~ Distance + UniqueCarrier, data=df) 21 | expect_equal(coef(iofit),coef(lmfit)) 22 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients) 23 | expect_equal(summary(iofit)[c("sigma","df","r.squared","adj.r.squared","fstatistic")], 24 | summary(lmfit)[c("sigma","df","r.squared","adj.r.squared","fstatistic")]) 25 | 26 | # Run a linear regression without an intercept (a lot of the 27 | # metrics have special cases w/o an intercept) and check the terms 28 | iofit = iolm(DepDelay ~ Distance + UniqueCarrier - 1, data=data) 29 | lmfit = lm(DepDelay ~ Distance + UniqueCarrier - 1, data=df) 30 | expect_equal(coef(iofit),coef(lmfit)) 31 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients) 32 | expect_equal(summary(iofit)[c("sigma","df","r.squared","adj.r.squared","fstatistic")], 33 | summary(lmfit)[c("sigma","df","r.squared","adj.r.squared","fstatistic")]) 34 | 35 | # Run a basic linear regression, only using observations where DepDelay > 0 36 | iofit = iolm(DepDelay ~ Distance + UniqueCarrier, data=data, 37 | subset="DepDelay > 0") 38 | lmfit = lm(DepDelay ~ Distance + UniqueCarrier, data=df, 39 | subset=df$DepDelay > 0) 40 | expect_equal(coef(iofit),coef(lmfit)) 41 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients) 42 | expect_equal(summary(iofit)[c("sigma", "df", "r.squared", "adj.r.squared", 43 | "fstatistic")], 44 | summary(lmfit)[c("sigma", "df", "r.squared", "adj.r.squared", 45 | "fstatistic")]) 46 | 47 | # Run a linear regression with a weight term (use Month since 48 | # it is non-negative and the best thing available). 49 | iofit = iolm(DepDelay ~ Distance + UniqueCarrier, data=data, weight="Month") 50 | lmfit = lm(DepDelay ~ Distance + UniqueCarrier, data=df, weight=df$Month) 51 | expect_equal(coef(iofit),coef(lmfit)) 52 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients) 53 | expect_equal(summary(iofit)[c("sigma", "df", "r.squared", "adj.r.squared", 54 | "fstatistic")], 55 | summary(lmfit)[c("sigma", "df", "r.squared", "adj.r.squared", 56 | "fstatistic")]) 57 | 58 | # Run a linear regression with an offset. Use ArrDelay. 59 | iofit = iolm(DepDelay ~ Distance + UniqueCarrier, data=data, offset="ArrDelay") 60 | lmfit = lm(DepDelay ~ Distance + UniqueCarrier, data=df, offset=df$ArrDelay) 61 | expect_equal(coef(iofit),coef(lmfit)) 62 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients) 63 | expect_equal(summary(iofit)[c("sigma", "df", "r.squared", "adj.r.squared", 64 | "fstatistic")], 65 | summary(lmfit)[c("sigma", "df", "r.squared", "adj.r.squared", 66 | "fstatistic")]) 67 | 68 | # Test data frames 69 | iofit = iolm(Sepal.Width ~ Sepal.Length, iris) 70 | lmfit = lm(Sepal.Width ~ Sepal.Length, iris) 71 | expect_equal(coef(iofit),coef(lmfit)) 72 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients) 73 | expect_equal(summary(iofit)[c("sigma", "df", "r.squared", "adj.r.squared", 74 | "fstatistic")], 75 | summary(lmfit)[c("sigma", "df", "r.squared", "adj.r.squared", 76 | "fstatistic")]) 77 | 78 | # Test dot notation 79 | iofit = iolm(Sepal.Width ~ ., iris) 80 | lmfit = lm(Sepal.Width ~ ., iris) 81 | expect_equal(coef(iofit),coef(lmfit)) 82 | expect_equal(summary(iofit)$coefficients, summary(lmfit)$coefficients) 83 | expect_equal(summary(iofit)[c("sigma", "df", "r.squared", "adj.r.squared", 84 | "fstatistic")], 85 | summary(lmfit)[c("sigma", "df", "r.squared", "adj.r.squared", 86 | "fstatistic")]) 87 | -------------------------------------------------------------------------------- /tests/testthat/test-iolmnet.r: -------------------------------------------------------------------------------- 1 | library(Matrix) 2 | library(adf) 3 | library(ioregression) 4 | library(glmnet) 5 | 6 | data("QuickStartExample") 7 | 8 | df = as.data.frame(x) 9 | df$Y = as.vector(y) 10 | names(df) = gsub("V", "X", names(df)) 11 | 12 | alpha=0.5 13 | 14 | iofit = iolmnet(Y ~ .-1, df, alpha=alpha, standardize=FALSE) 15 | fit = glmnet(x, y, alpha=alpha) 16 | 17 | print(fit$beta[,ncol(fit$beta)]) 18 | print(iofit$beta[,ncol(iofit$beta)]) 19 | 20 | iofit = iolmnet(Y ~ ., df, alpha=alpha, standardize=TRUE) 21 | col_means = colMeans(x) 22 | x = x - matrix(data=col_means, ncol=ncol(x), nrow=nrow(x), byrow=TRUE) 23 | col_sd = apply(x, 2, sd) 24 | x = x / matrix(data=col_sd, ncol=ncol(x), nrow=nrow(x), byrow=TRUE) 25 | y = (y-mean(y)) / sd(y) 26 | fit = glmnet(x, y, alpha=alpha) 27 | 28 | print(fit$beta[,ncol(fit$beta)]) 29 | print(iofit$beta[,ncol(iofit$beta)]) 30 | -------------------------------------------------------------------------------- /tests/testthat/test-lars.r: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(ioregression) 3 | library(adf) 4 | 5 | library(MASS) 6 | 7 | # Download the data to a temp directory. 8 | bz_file_name = file.path(temp_dir <- tempdir(), "1987.csv.bz2") 9 | if (!file.exists(bz_file_name)) 10 | download.file("http://stat-computing.org/dataexpo/2009/1987.csv.bz2", bz_file_name) 11 | 12 | # Create an abstract data frame and a real data frame: 13 | data = adf(bz_file_name, sep=",", header=TRUE, conMethod="bzfile") 14 | data = allFactorLevels(data) 15 | if (!exists('df')) df = read.table(bzfile(bz_file_name), header=TRUE, sep=",") 16 | 17 | # Create an iofit and a local model matrix: 18 | obj = iolm(DepDelay ~ Distance + Month + ArrTime - 1, data=data) 19 | mf = lm(DepDelay ~ Distance + Month + ArrTime - 1, data=df, method="model.frame") 20 | X = model.matrix(DepDelay ~ Distance + Month + ArrTime - 1, mf) 21 | y = model.response(mf) 22 | 23 | # Fit lars algorithms 24 | iofit = iolm.lars(obj, intercept=FALSE) 25 | lmfit = lars::lars(X,y, intercept=FALSE) 26 | 27 | # Compare methods: 28 | expect_equal(iofit$lambda, lmfit$lambda) 29 | expect_equal(iofit$df, lmfit$df) 30 | expect_equal(iofit$R2, lmfit$R2) 31 | expect_equal(iofit$RSS, lmfit$RSS) 32 | expect_equal(iofit$Cp, lmfit$Cp) 33 | expect_equal(as.numeric(iofit$beta), as.numeric(lmfit$beta)) 34 | -------------------------------------------------------------------------------- /tests/testthat/test-ridge.r: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(adf) 3 | library(ioregression) 4 | 5 | library(MASS) 6 | 7 | # Download the data to a temp directory. 8 | bz_file_name = file.path(temp_dir <- tempdir(), "1987.csv.bz2") 9 | if (!file.exists(bz_file_name)) 10 | download.file("http://stat-computing.org/dataexpo/2009/1987.csv.bz2", bz_file_name) 11 | 12 | # Create an abstract data frame and a real data frame: 13 | data = adf(bz_file_name, sep=",", header=TRUE, conMethod="bzfile") 14 | data = allFactorLevels(data) 15 | if (!exists('df')) df = read.table(bzfile(bz_file_name), header=TRUE, sep=",") 16 | 17 | # Test on a simple regression 18 | iolmObj = iolm(DepDelay ~ Distance + ArrDelay, data=data) 19 | iofit = iolm.ridge(iolmObj, lambda=seq(0, 1, by = 0.1)) 20 | lmfit = lm.ridge(DepDelay ~ Distance + ArrDelay, df, 21 | lambda=seq(0, 1, by = 0.1)*nrow(df)) 22 | 23 | iocoef = coef(iofit) 24 | lmcoef = coef(lmfit) 25 | attributes(lmcoef) = attributes(iocoef) 26 | expect_equal(iocoef, lmcoef, tol=0.01) 27 | 28 | # Test on a regression with factors 29 | iolmObj = iolm(DepDelay ~ Distance + UniqueCarrier, data=data) 30 | iofit = iolm.ridge(iolmObj, lambda=seq(0, 1, by = 0.1)) 31 | lmfit = lm.ridge(DepDelay ~ Distance + UniqueCarrier, df, 32 | lambda=seq(0, 1, by = 0.1)*nrow(df)) 33 | 34 | iocoef = coef(iofit) 35 | lmcoef = coef(lmfit) 36 | attributes(lmcoef) = attributes(iocoef) 37 | expect_equal(iocoef, lmcoef, tol=0.005) 38 | --------------------------------------------------------------------------------