This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
example use of pandas with oracle mysql postgresql sqlite | |
lightly tested. | |
to do: | |
save/restore index (how to check table existence? just do select count(*)?), | |
finish odbc, | |
add booleans?, | |
sql_server? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(Rcpp) | |
#library(RcppProgress) | |
#library(RcppParallel) | |
{ | |
code = ' | |
// [[Rcpp::depends(RcppProgress, RcppArmadillo, RcppParallel)]] | |
#define ARMA_64BIT_WORD | |
#include <RcppArmadillo.h> | |
#include <RcppParallel.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local({ | |
myglmnet = function(x, y, family = c("gaussian", "binomial", "poisson", "multinomial", "cox", "mgaussian"), weights, offset = NULL, alpha = 1, nlambda = 100, lambda.min.ratio = ifelse(nobs < nvars, 0.01, 1e-04), lambda = NULL, standardize = TRUE, intercept = TRUE, thresh = 1e-07, dfmax = nvars + 1, pmax = min(dfmax * 2 + 20, nvars), exclude, penalty.factor = rep(1, nvars), lower.limits = -Inf, upper.limits = Inf, maxit = 1e+05, type.gaussian = ifelse(nvars < 500, "covariance", "naive"), type.logistic = c("Newton", "modified.Newton"), standardize.response = FALSE, type.multinomial = c("ungrouped", "grouped")) { | |
family = match.arg(family) | |
if (alpha > 1) { | |
warning("alpha >1; set to 1") | |
alpha = 1 | |
} | |
if (alpha < 0) { | |
warning("alpha<0; set to 0") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# Check out org.mate.panel in dconf. It has a `.toplevels` | |
# section with `bottom` and `top` entries that provide the | |
# mate-panel dimensions and screen id. | |
# Seems like those could be read and used by qtile. | |
# | |
# | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy import stats | |
from theano.tensor.nlinalg import det, matrix_inverse, trace, eigh | |
from pymc3 import transforms | |
from pymc3.distributions.distribution import Continuous, Discrete, draw_values, generate_samples | |
from pymc3.distributions.special import gammaln, multigammaln | |
from pymc3.distributions.dist_math import bound, logpow, factln | |
class MvNormal(Continuous): | |
r""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Simple inspection of an inverse mean reparameterization for observations | |
# x ~ N(theta, 1) | |
# and theta = 1/u. | |
# Original discussion: https://xianblog.wordpress.com/2016/07/15/the-curious-incident-of-the-inverse-of-the-mean/ | |
# | |
# Authors: Jyotishka Datta and Brandon T. Willard | |
# | |
library(rstan) | |
rstan_options(auto_write = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from hsplus.special_funcs import sure_hib | |
alpha_d_range = np.linspace(-100, 100, 200) | |
sigma = 1. | |
tau = 1. | |
from timeit import default_timer as timer | |
start = timer() | |
sure_range = sure_hib(alpha_d_range, sigma, tau) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer