Skip to content
View GuiMarthe's full-sized avatar

Block or report GuiMarthe

Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

  1. 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.
    1
    library(tidyverse)
    2
    library(broom)
    3
    
                  
    4
    
                  
    5
    df <- 
  2. 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.
    1
    add_lagged <- function(df, var, n = 1) {
    2
      var <- enquo(var)
    3
      names <- map(1:n, ~ paste0(quo_name(var), '_lag_' ,.))
    4
    
                  
    5
      lagged_cols <- map2(1:n, names, ~ df %>% transmute(!!.y := lag(!!var, n = .x))) %>% 
  3. 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.html
    2
    
                  
    3
    n <- 10000000
    4
    data <- rnorm(n, mean = 4, sd = 2)
    5
    
                  
  4. quick log odds, odds, probability eq... quick log odds, odds, probability equivalence
    1
    library(dplyr)
    2
    
                  
    3
    
                  
    4
    tibble(
    5
    	prob = seq(0, 1, 0.01), 
  5. 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
    1
    library(tidyverse)
    2
    
                  
    3
    ### criando 300 váriáveis normais para 20 diferentes 
    4
    ### pares de média e variância distintos 
    5
    
                  
  6. 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.
    1
    import pandas as pd
    2
    from pathlib import Path
    3
    from functools import wraps
    4
    
                  
    5
    def cache_pandas_result(cache_dir, hard_reset: bool):