Skip to content

Instantly share code, notes, and snippets.

https://www.yomiuri.co.jp/culture/book/column/20230411-OYT8T50001/ に書かれた、太刀川氏による文章をもとにChatGPTと会話した記録

次の文章に誤りもしくは不自然な点があれば指摘してください:  まず気候変動の緩和とは、二酸化炭素などの温室効果ガスを削減して気候変動を和らげる戦略だ。これは具体的でわかりやすい。一方で気候変動への適応は、起こった気候の変化に社会を合わせる戦略だ。うむ…わかる気もするが、一体どうすれば適応できるのか。生活の全てが適応の手段なので、指標も測りづらい。適応策はこの複雑さ故に、緩和策ほどには進んでいない。

ChatGPT

文章に誤りや不自然な点は見受けられませんが、一部表現をより明確にする提案があります。

現在の文章:

@kagaya
kagaya / read_raw_pkl.R
Last active December 10, 2022 10:42
read raw.pkl file from soft_skeleton_solver (https://github.com/katsuma-inoue/soft_skeleton_solver)
library(tidyverse)
library(reticulate)
read_raw_pkl <- function(file_path="/path/to/raw.pkl"){
# https://gist.github.com/kagaya/32706c38404c99431669ba34b8bccbac
j <- import("joblib") # python package joblib is loaded via {reticulate}
arm_xy <- j$load(file_path)
tibble(t=1:length(arm_xy$path), path=arm_xy$path) %>%
group_by(t) %>%
@kagaya
kagaya / Supplementary_Information.rmd
Last active February 4, 2020 16:01
Supplementary information for the paper entitled "Customizing material into embodied cap by sponge crab" by Harada and Kagaya (https://doi.org/10.1101/330787)
---
title: Supplementary information for the paper 'Individual behavioral type captured by a Bayesian model comparison in cap making by sponge crab'
---
This document is the supplementary information for the paper 'Individual behavioral type captured by a Bayesian framework in cap making by sponge crab' by Harada, Hayashi and Kagaya.
The basic conceptural framework for data analysis in the paper is a Bayesian framework based on the mathematical theory founded by Dr. Akaike and Dr. Watanabe (Watanabe, 'Mathematical Theory of Bayesian Statistics', 2018). The author of this document wrote an example of model selection by Widely Applicable Information Criterion (WAIC) using the data of 'artificial case' (http://rpubs.com/katzkagaya/460937). It may be of help for clarifying what the analysis of this document is doing, by using numerically generated 'artificial' data and several relatively simple hierarchical models.
In this study, we deal with the behavioral data of a 'natural case'. Therefore, we do not know
@kagaya
kagaya / random_variable_with_Tidyeval.ipynb
Last active September 26, 2019 16:51
Tidyevalで関数としての確率変数を表現してみる
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kagaya
kagaya / model_selection_by_WAIC.rmd
Last active March 5, 2019 01:15
an example of model selection of hierarchical Bayesian model by WAIC / draft
---
title: "an example of model comparison by WAIC (draft)"
author: "Katsushi Kagaya"
date: "`r Sys.time()`"
output:
html_document: default
---
# motivation and aims
@kagaya
kagaya / main.rmd
Last active February 1, 2019 11:33
Harada and Kagaya, Customizing material into embodied cap by sponge crab, https://doi.org/10.1101/330787
---
header-includes:
- \usepackage{setspace}
- \doublespacing
- \usepackage{lineno}
- \linenumbers
output:
pdf_document: default
html_document:
df_print: paged
functions {
vector my_student_t_rng(int N, real nu, real mu, real sigma){
vector[N] Y;
for (n in 1:N){
Y[n] = student_t_rng(nu, mu, sigma);
}
return(Y);
}
vector my_ZIP_rng(int N, real q, real lambda){
@kagaya
kagaya / plot_f.R
Last active January 30, 2019 06:53
plot functions for Harada and Kagaya, https://doi.org/10.1101/330787
library(tidyverse)
library(ggrepel)
library(rstan)
rstan::expose_stan_functions("my_stan_functions.stan") # https://gist.github.com/kagaya/c726f16d82b80026bb1924b408a72b5c
source("utility.R")
###### choice #####
waic <- function(log_likelihood) {
# from https://gist.github.com/MatsuuraKentaro/3f6ae5863e700f5039c19e36a9bdf646
training_error <- - mean(log(colMeans(exp(log_likelihood))))
functional_variance_div_N <- mean(colMeans(log_likelihood^2) - colMeans(log_likelihood)^2)
waic <- training_error + functional_variance_div_N
return(waic)
}
@kagaya
kagaya / across_facet_plot.R
Last active August 14, 2018 10:13
plot a segment connecting points across facets in ggplot
library(tidyverse)
library(grid)
library(gtable)
plot_segment_across_facets <- function(p, from=1, to=2,
from_point_id=1,
to_point_id=1,
plotout = F,
gp=gpar(lty=1, alpha=0.5)){