Open MPI の環境変数を設定
/
以下はバージョンなので適宜変える
module load openmpi/4.0.5
using Distributions | |
using SpecialFunctions | |
using QuadGK | |
using Plots | |
function eqcdf(d::LogNormal, x) | |
mu, sigma = params(d) | |
return 0.5*(1+x*erfc((log(x) - mu)/(sigma*sqrt(2)))*exp(-(mu + (sigma^2)/2)) - erf((mu + sigma^2 - log(x))/(sigma*sqrt(2)))) | |
end |
library(deSolve) | |
library(ggplot2) | |
library(tidyr) | |
LDmod <- function(Time, State, Pars) { | |
with(as.list(c(State, Pars)), { | |
dLiving <- a*living - b*living | |
dDead <- b*living | |
return(list(c(dLiving, dDead))) | |
}) |
\documentclass[dvipdfmx, tikz, margin = 2pt]{standalone} | |
\usetikzlibrary{matrix} | |
\usetikzlibrary{positioning} | |
\begin{document} | |
\begin{tikzpicture}[auto matrix/.style={matrix of nodes, | |
draw,thick,inner sep=0pt, | |
nodes in empty cells,column sep=-0.2pt,row sep=-0.2pt, | |
cells={nodes={minimum width=1.9em,minimum height=1.9em, | |
draw,very thin,anchor=center,fill=white, | |
execute at begin node={} |
#include <RcppArmadillo.h> | |
// [[Rcpp::depends(RcppArmadillo)]] | |
using namespace Rcpp; | |
// [[Rcpp::export]] | |
arma::vec rpg_call(const arma::vec & h, const arma::vec & z){ | |
Environment pkg = Environment::namespace_env("BayesLogit"); | |
Function f = pkg["rpg"]; | |
NumericVector out = f(Rcpp::Named("num", h.n_elem), | |
Rcpp::Named("h",h), |
\documentclass[dvipdfmx, border={2pt 2pt 2pt 2pt}]{standalone} | |
\usepackage{tikz, bm} | |
\usetikzlibrary{bayesnet} | |
\begin{document} | |
\begin{tikzpicture} | |
% Nodes | |
\node[const](alpha){$\alpha$}; | |
\node[latent, right = of alpha](pi){$\bm{\pi}$}; | |
\node[const, below = of alpha](beta){$\bm{\beta}$} ; | |
\node[latent, right = of beta](p){$\bm{p}_l$}; |
library(gganimate) | |
library(dplyr) | |
th <- seq(-1,1,by=0.001) | |
ran <- c(-0.85,-0.2) | |
df <- data.frame(x = sin(th)*cos(th)*log(abs(th)), | |
y = (abs(th)^0.3)*sqrt(abs(cos(th))), | |
theta=th) %>% | |
mutate(f = ran[1]<theta & theta<ran[2]) %>% | |
mutate(time_dummy = row_number()) |
\documentclass[dvipdfmx, margin=5pt]{standalone} | |
\usepackage{tikz} | |
\begin{document} | |
\begin{tikzpicture} | |
\def \gamma{\x, \x * exp(-\x)} | |
\fill [fill=gray!30] (0.5,0) -- plot[domain=0:0.5] (\gamma) -- (0.5, 0) -- cycle; | |
\fill [fill=gray!30] (2,0) -- plot[domain=2:2.5] (\gamma) -- (2.5, 0) -- cycle; | |
\fill [fill=gray!30] (4,0) -- plot[domain=4:5] (\gamma) -- (5, 0) -- cycle; | |
\draw[color=black, domain=0:5, samples=100] plot (\gamma) node[right] {}; | |
\draw[->, very thin] (0,0) -- (5.1,0) node[right] {}; |