Skip to content

Instantly share code, notes, and snippets.

Nicholas J. Matzke nmatzke

Block or report user

Report or block nmatzke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View BDQ_time_results.jl
# Time results posted to:
# https://gist.github.com/nmatzke/34ba6b3f8b548af92724bcb3f41bbf3d
#
# ODE problem setup here:
# https://gist.github.com/nmatzke/b6332845747d7452b6e3b45564f460e8
@benchmark sol_CVODE = solve(prob, CVODE_BDF(linear_solver=:GMRES), dense=false, save_everystep=false, save_end=true, save_start=true)
# memory estimate: 2.72 GiB
# allocs estimate: 5711652
# --------------
@nmatzke
nmatzke / BDQ_v5.jl
Created Apr 22, 2019
BDQ v5 w help from Chris
View BDQ_v5.jl
using DifferentialEquations
using BenchmarkTools # for @benchmark
using LSODA # for lsoda()
using Sundials # for CVODE_BDF()
# State-dependent birth-death process:
# Problem setup
n = 500 # Number of states
two = 2.0 # Constant (but missing in some published equations)
View BDQ.jl
import Pkg
using Pkg # for Pkg.add, Pkg.PackageSpec
using DifferentialEquations
using Plots
using BenchmarkTools # for @benchmark
using LSODA # for lsoda()
#Pkg.resolve()
using Sundials # for CVODE_BDF() e.g.
@nmatzke
nmatzke / _ex_Eulers_WORKS.jl
Created Apr 18, 2019
Revising Chris Rackauckas's "exp_euler_test.jl" from Julia 0.6 so it works in Julia 1.1
View _ex_Eulers_WORKS.jl
########################################################
# Revising Chris Rackauckas's "exp_euler_test.jl" from
# Julia 0.6 so it works in Julia 1.1
########################################################
#
# Original 0.6 code from:
#
# ChrisRackauckas/exp_euler_test.jl
# https://gist.github.com/ChrisRackauckas/cf91f4575b0587a45c72620384612b82
View prt_alone_v1.R
require("ape")
# print tree in hierarchical format
#######################################################
# prt
#######################################################
#' Print tree in table format
#'
#' Learning and using APE's tree structure can be difficult and confusing because much of the information is
#' implicit. This function prints the entire
View birthdeath_treemodel.R
# Laying out the likelihood equation in ape::birthdeath
# Calculating LnL of a tree under a birth-death process
#######################################################
# Located in:
# /drives/GDrive/z_help/ClaSSE_LnLs/grok_classe_setup/
#######################################################
View R package installs
install.packages("devtools")
library(devtools)
install_github("nmatzke/rexpokit")
install.packages("phytools")
library(phytools)
install.packages("geomorph")
install.packages("BioGeoBEARS")
install.packages("plot3D")
View phylo_vs_cladogram.R
# Simple setup of a human/chimp/etc. phylogeny
# by Nick Matzke
#######################################################
# Phylogeny versus cladogram
#######################################################
# Tree specification
newick_string = "((((human:6,chimp:6):1,gorilla:7):6,orang:13):5,gibbon:18);"
tr = read.tree(file="",text=string)
@nmatzke
nmatzke / Beast2_GeneralSubstitutionModel_v1.R
Created Dec 22, 2016
Figuring out the Beast2 GeneralSubstitutionModel
View Beast2_GeneralSubstitutionModel_v1.R
#######################################################
# Figuring out the Beast2 GeneralSubstitutionModel
#######################################################
# The Beast2 documentation says:
#
# file:///Applications/BEAST_2.4.3/Beast2_XML_as_HTML_help/beast.evolution.substitutionmodel.GeneralSubstitutionModel.html
@nmatzke
nmatzke / data_frame_utilities_v1.R
Created Dec 22, 2016
Utilities to manage annoying features of R data frames (list, factor issues)
View data_frame_utilities_v1.R
#######################################################
# These functions are some utilitys for dealing with
# annoying features of R's use of data.frames, e.g.
# the tendency for some functions to have something that
# looks like a data.frame, but is actually a series of lists.
#
# Also, dfnums_to_numeric semi-intelligently converts
# columns with numeric data to numeric (rather than
# factor or character).
#######################################################
You can’t perform that action at this time.