Pinned Loading
-
A simple procedure for sampling a di...
A simple procedure for sampling a distribution to look like another. A method through binning and another by kde estimation. The binning idea came from this stats exchange question and the kde method came from other studies of mine. 1library(tidyverse)2library(broom)345df <-
-
Little function I created in R for a...
Little function I created in R for adding all lagged values up to n of a variable to a df. Can be improved for handling more than one variable. 1add_lagged <- function(df, var, n = 1) {
2var <- enquo(var)
3names <- map(1:n, ~ paste0(quo_name(var), '_lag_' ,.))
45lagged_cols <- map2(1:n, names, ~ df %>% transmute(!!.y := lag(!!var, n = .x))) %>%
-
A small little idea on implementing ...
A small little idea on implementing bootstrap only using purrr, not dplyr based, after reading a google data science blog 1## http://www.unofficialgoogledatascience.com/2015/08/an-introduction-to-poisson-bootstrap26.html23n <- 10000000
4data <- rnorm(n, mean = 4, sd = 2)
5 -
quick log odds, odds, probability eq...
quick log odds, odds, probability equivalence 1library(dplyr)234tibble(
5prob = seq(0, 1, 0.01),
-
Um simples script que cria 300 variá...
Um simples script que cria 300 variáveis normais de 100 pares de média e variância distintas e calcula suas médias e intervalos de confiança por meio do bootstrap e ainda calcula a proporção de vezes que a verdadeira média esta no intervalo 1library(tidyverse)23### criando 300 váriáveis normais para 20 diferentes4### pares de média e variância distintos5 -
This decorator caches a pandas.DataF...
This decorator caches a pandas.DataFrame returning function. It saves the pandas.DataFrame in a parquet file in the cache_dir. 1import pandas as pd
2from pathlib import Path
3from functools import wraps
45def cache_pandas_result(cache_dir, hard_reset: bool):
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.

