This file contains hidden or 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
| rcfnorm <- function(n, shape=0, inv_scale=1){ | |
| rnorm(n, shape/inv_scale, 1/sqrt(inv_scale)) | |
| } | |
| dcfnorm <- function(n, shape=0, inv_scale=1, ...){ | |
| dnorm(n, shape/inv_scale, 1/sqrt(inv_scale), ...) | |
| } | |
| pcfnorm <- function(n, shape=0, inv_scale=1, ...){ | |
| pnorm(n, shape/inv_scale, 1/sqrt(inv_scale), ...) |
This file contains hidden or 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
| size_mtx <- function(file_path){ | |
| con <- file(file_path, open = "r") #Open for reading in text mode | |
| size <- scan(con, what=integer(), comment.char = "%", nlines = 1, skip = 1, quiet = TRUE) | |
| close(con) | |
| names(size) <- c("row","column","nonzero") | |
| return(size) | |
| } | |
| take_last <- function(x){ | |
| x[length(x)] |
This file contains hidden or 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
| \documentclass[tikz,border=10pt]{standalone} | |
| \usetikzlibrary{matrix,positioning,quotes} | |
| \begin{document} | |
| \tikzset{ | |
| table/.style={ | |
| matrix of nodes, | |
| row sep=-\pgflinewidth, | |
| column sep=-\pgflinewidth, | |
| nodes={ |
This file contains hidden or 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
| %ref: | |
| %https://tex.stackexchange.com/questions/516073/how-to-draw-3d-matrix-using-tikz | |
| %https://tikz.net/tikz-table/ | |
| %https://tikz.net/conv2d/ | |
| % | |
| \documentclass[tikz,border=10pt]{standalone} | |
| \usepackage[dvipsnames]{xcolor} | |
| \usetikzlibrary{matrix,positioning} | |
| \begin{document} |
This file contains hidden or 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
| %ref: | |
| %https://tex.stackexchange.com/questions/516073/how-to-draw-3d-matrix-using-tikz | |
| %https://tikz.net/tikz-table/ | |
| %https://tikz.net/conv2d/ | |
| % | |
| \documentclass[tikz,border=10pt]{standalone} | |
| \usetikzlibrary{matrix,positioning} | |
| \begin{document} | |
| \tikzset{ |
This file contains hidden or 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
| %ref: | |
| %https://tex.stackexchange.com/questions/516073/how-to-draw-3d-matrix-using-tikz | |
| %https://tikz.net/tikz-table/ | |
| % | |
| \documentclass[tikz,border=10pt]{standalone} | |
| \usetikzlibrary{matrix,positioning} | |
| \begin{document} | |
| \tikzset{ | |
| table/.style={ |
This file contains hidden or 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
| #ref: | |
| #Jan Laukemann et al. (2025) Accelerating Sparse Tensor Decomposition Using Adaptive Linearized Representation | |
| #https://arxiv.org/abs/2403.06348 | |
| ALTO_indexing <- function(object, data = environment(object), ...) { | |
| mf <- model.frame(object, data, ...) | |
| t <- if (missing(data)) terms(object) else terms(object, data = data) | |
| labs <- attr(t, "term.labels") | |
| mf <- lapply(labs, function(x) { |
This file contains hidden or 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(moltenNMF) | |
| library(Matrix) | |
| df = expand.grid(letters[1:2], LETTERS[1:2]) | |
| X = sparse_onehot(~., data = df) | |
| A = matrix( | |
| c(0.5, 0.5, 0.5, 0.5, 0, 1, 0, 0, 0, 0, 0, 1), | |
| nrow = 4, | |
| ncol = 3 |
This file contains hidden or 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
| #ref: | |
| #Jan Laukemann et al. (2025) Accelerating Sparse Tensor Decomposition Using Adaptive Linearized Representation | |
| #https://arxiv.org/abs/2403.06348 | |
| library(dplyr) | |
| ALTO_indexing <- function(object, data = environment(object), ...) { | |
| mf <- model.frame(object, data, ...) | |
| t <- if (missing(data)) terms(object) else terms(object, data = data) | |
| labs <- attr(t, "term.labels") |
This file contains hidden or 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(ggplot2) | |
| library(dplyr) | |
| library(tidyr) | |
| library(rvest) | |
| library(readr) | |
| url = "https://ja.wikipedia.org/wiki/2015年韓国におけるMERSの流行" | |
| taball <- read_html(url) |> | |
| html_table() |
NewerOlder