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
/* ----------------------------------------------------------------------------- | |
Estimate latent variable hierarchical Bayes RFM model | |
stan ver. 2.9 | |
CREATED BY: 09/APR/2015, ill-identified | |
------------------------------------------------------------------------------- */ | |
data { | |
int<lower=1> N ; // num of customers |
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
require(tidyverse) | |
fonts_win = tibble::tribble( | |
~family, ~name, ~group, ~os, | |
"Yu Mincho", "游明朝", "明朝", "windows 10", | |
"游明朝", "游明朝", "明朝", "windows 10", # WSL | |
"BIZ UDMincho", "BIZ UD明朝", "明朝", "windows 10", | |
"BIZ UD明朝", "BIZ UD明朝", "明朝", "windows 10", | |
"BIZ UDPMincho", "BIZ UDP明朝", "明朝", "windows 10", | |
"BIZ UDP明朝", "BIZ UDP明朝", "明朝", "windows 10", |
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
# Auto generated file - do not change manually | |
# setWorkingDirToProjectDir | |
setWorkingDirToProjectDirLabel = プロジェクトのディレクトリを作業ディレクトリにする | |
setWorkingDirToProjectDirButtonLabel = | |
setWorkingDirToProjectDirMenuLabel = プロジェクトのディレクトリへ(_P) | |
setWorkingDirToProjectDirDesc = プロジェクトのルートディレクトリを作業ディレクトリにする | |
# setWorkingDirToActiveDoc | |
setWorkingDirToActiveDocLabel = Set Working Directory to Current Document's Directory | |
setWorkingDirToActiveDocButtonLabel = |
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
#! /usr/bin/env bash | |
sudo apt install -yqq ./rstudio.deb | |
MKRUNUSERDIR_PATH="/usr/sbin/wsl-user-mk-runuserdir" | |
set -e | |
cat > ${MKRUNUSERDIR_PATH} << \EOF | |
### User runtime dir | |
# Executed as part of 00-wsl-user-env.sh | |
RUNUSER_DIR="/run/user" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# multivariate normal Kalman filter | |
require(dplyr) | |
require(tidyr) | |
require(ggplot2) | |
require(animation) | |
# ARIMA(1,1) + 線形トレンド の乱数生成 | |
N <- 50 | |
phi1 <- .5 | |
theta1 <- .2 |
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
require(KFAS) # 1.2.9 | |
require(dplyr) | |
require(tidyr) | |
require(ggplot2) | |
require(data.table) | |
require(zoo) | |
##### read dataset ##### | |
# https://catalog.data.gov/dataset/allegheny-county-crash-data | |
# data description |
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
pacman::p_load_gh("uribo/fgdr", "franapoli/pbarETA") | |
pacman::p_load(sf, raster, tabularaster, tidyverse, broom, ggthemes, plotly, Metrics) | |
plot_surface <- function(mat) plot_ly(x=mat[, 1], y=colnames(mat), z=mat[, -1]) %>% add_surface() | |
options(pillar.sigfig = 10) | |
list_xml <- list.files("data", pattern="FG-GML-5133-36.+DEM5.+.xml", full.names=T) | |
pb <- txtProgressBar(min=2, max=length(list_xml), style=3, char="█", width=getOption("width") - 30) | |
source <- list() | |
for(i in 1:length(list_xml)){ |
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
require(rstan) | |
require(bayesplot) | |
require(ggplot2) | |
require(ggthemes) | |
require(patchwork) | |
require(tidyverse) | |
rstan_options(auto_write = TRUE) | |
options(mc.cores = parallel::detectCores()) | |
#### rstan でモデルをコンパイルしサンプリング #### |
NewerOlder