Skip to content

Instantly share code, notes, and snippets.

abikoushi

Block or report user

Report or block abikoushi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View basic_t2019_2.md

混合正規分布

set.seed(1)
s <- t(rmultinom(100,1,c(0.3,0.7)))
head(s)
s2 <- apply(s==1,1,which)
mu <- c(-2,2)
sigma <- c(1,1)
y <- rnorm(100,mu[s2],sigma[s2])
View basic_t2019_1.md

簡単な計算の実行

3 + 8
30 / 23
3005 %% 3
sin(100)
log(20)
View geom_grid.R
require(ggplot2)
####utilities
"%||%" <- function(a, b) {
if (!is.null(a)) a else b
}
rbind_dfs <- function(dfs) {
out <- list()
columns <- unique(unlist(lapply(dfs, names)))
View geom_grid.R
require(ggplot2)
####utilities
"%||%" <- function(a, b) {
if (!is.null(a)) a else b
}
rbind_dfs <- function(dfs) {
out <- list()
columns <- unique(unlist(lapply(dfs, names)))
View geom_grid.R
require(ggplot2)
require(grid)
require(dplyr)
"%||%" <- function(a, b) {
if (!is.null(a)) a else b
}
geom_grid <- function(mapping = NULL, data = NULL,
position = "identity",
View binom_mult.cpp
#include <RcppArmadillo.h>
using namespace Rcpp;
using namespace arma;
// [[Rcpp::depends(RcppArmadillo)]]
rowvec rdirichlet(const vec & alpha){
int K = alpha.n_rows;
rowvec y(K);
for(int k=0;k<K ;k++){
y[k] = R::rgamma(alpha[k],1);
View multmix_Gibbs.cpp
#include <RcppArmadillo.h>
using namespace Rcpp;
using namespace arma;
// [[Rcpp::depends(RcppArmadillo)]]
rowvec rdirichlet(const vec & alpha){
int K = alpha.n_rows;
rowvec y(K);
for(int k=0;k<K ;k++){
y[k] = R::rgamma(alpha[k],1);
View Poisreg.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View SIRjl.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View SIRNHPP.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.