Skip to content

Instantly share code, notes, and snippets.

View SaranjeetKaur's full-sized avatar

Saranjeet Kaur SaranjeetKaur

View GitHub Profile

Introduction

In this Google Summer of Code program I, along with my mentors, aimed to build the polychord nested sampling algorithm and integrate it with Turing using Julia Language. The version 0.5.0 release of NestedSamplers.jl has our work done, to date, included. This would allow users to use the random staggering, slicing and random slicing (or polychord) proposal alogrithms in NestedSamplers.jl. Much of this work was inspired by dynesty and its modular approach to nested sampling, which Julia’s multiple dispatch made even more effective. The majority of the code for the proposal algorithms has already been merged to NestedSamplers.jl. One of the major improvements which would greatly increase its usage would be merging ns.jl with Turing.jl package.

Blog post

The work done in this project is described in this [b

@SaranjeetKaur
SaranjeetKaur / nestedsampexample.jl
Created August 3, 2020 21:34
Example for the ns.jl file, modify later
julia> using NestedSamplers
julia> using Distributions
# eggbox likelihood function
tmax = 3π
julia> function logl(x)
t = @. 2*tmax*x - tmax
return 2 + cos(t[1]/2)*cos(t[2]/2)^5
end
logl (generic function with 1 method)
@SaranjeetKaur
SaranjeetKaur / NFL.R
Created February 6, 2020 04:22
Code for TidyTuesday week 6 (NFL attendance)
install.packages("tidyverse")
library("tidyverse")
attendance <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-02-04/attendance.csv')
standings <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-02-04/standings.csv')
games <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-02-04/games.csv')
attendance <- na.omit(attendance)
attendance_arizona <- subset(attendance, attendance$team == "Arizona")
@SaranjeetKaur
SaranjeetKaur / trees_SF_caretaker.R
Last active January 29, 2020 06:02
Code for TidyTuesday week 5 (A map of trees planted in San Francisco, according to their 'caretaker')
install.packages("tidyverse")
library(tidyverse)
trees_SF <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-01-28/sf_trees.csv')
trees_SF <- na.omit(trees_SF)
trees_map_SF <- ggplot2::ggplot(data = trees_SF, aes(x = longitude, y = latitude, colour = caretaker)) +
geom_point() +
labs(x = 'Longitude', y = 'Latitude', title = 'Trees in San Franscisco & their caretakers') +
xlim(min(trees_SF$longitude), max(trees_SF$longitude)) +
ylim(min(trees_SF$latitude), max(trees_SF$latitude))
@SaranjeetKaur
SaranjeetKaur / acoustics_spotify.R
Created January 27, 2020 18:23
Code for TidyTuesday week 4
install.packages("tidyverse")
library(tidyverse)
spotify <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-01-21/spotify_songs.csv')
acoustics <- ggplot2::ggplot(data = spotify) +
geom_point(mapping = aes(x = 1:nrow(spotify), y = acousticness, colour = playlist_genre)) +
labs(x = 'spotify songs')
acoustics