Skip to content

Instantly share code, notes, and snippets.

View sadatnfs's full-sized avatar

Nafis Sadat sadatnfs

  • Microsoft
  • Seattle, WA
View GitHub Profile
@sadatnfs
sadatnfs / Makefile
Last active March 25, 2019 16:14
Makefile for building INLA in Debian:Stretch
## Makefile for downloading the source code and building
## a binary package of R-INLA on Debian:Stretch
## using a custom version of R and Intel MKL
## Intended for use by : Institute for Health Metrics and Evaluation
##
## Maintained by : Nafis Sadat, sadatnfs@uw.edu
##
#### 2018/01/28 Update: removing r-mathlib and adding metis5
@sadatnfs
sadatnfs / Makefile
Last active February 10, 2018 23:02
INLA build for latest tag
## Makefile for downloading the source code and building
## a binary package of R-INLA on Debian/Buster
## using a custom version of R and Intel MKL
## Intended for use by : Institute for Health Metrics and Evaulation
##
## Maintained by : Nafis Sadat, sadatnfs@uw.edu
##
## Run 'make' with no arguments for usage instructions
##
## This Makefile has been tested under Debian GNU/Linux
@sadatnfs
sadatnfs / amelia_demo.r
Created February 14, 2018 04:02
A quick example of using Amelia
################################################
## Author : Nafis Sadat
## Purpose : Testing out Multiple Imputation with Amelia
## Created: Feb 13, 2018
################################################
@sadatnfs
sadatnfs / edward_RE_test_Iris.ipynb
Last active April 9, 2018 22:08
Testing a random effect model in Edward
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sadatnfs
sadatnfs / GPFlow_Coregion_example.ipynb
Created April 14, 2018 00:39
Fit a Multiclass Gaussian Process Regression with a coregionalization kernel
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sadatnfs
sadatnfs / GPFlow_Coregion_HEvars.ipynb
Last active April 17, 2018 22:02
Fit a multidimensional GPR on a coregionalization based kernel (using health financing data)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sadatnfs
sadatnfs / Makefile
Last active May 13, 2018 21:45
Makefile for building INLA in Debian:Buster
## Makefile for downloading the source code and building
## a binary package of R-INLA on Debian/Buster
## using a custom version of R and Intel MKL
## Intended for use by : Institute for Health Metrics and Evaulation
##
## Maintained by : Nafis Sadat, sadatnfs@uw.edu
##
## Run 'make' with no arguments for usage instructions
##
## This Makefile has been tested under Debian GNU/Linux
@sadatnfs
sadatnfs / xarray_to_r.r
Last active January 6, 2023 10:49
Extracting an xarray based netcdf file to use in R
require(ncdf4)
require(ncdf4.helpers)
require(data.table)
## Get the name of the value vars in the nc file
get_nc_value_name <- function(nc_file) {
## Get names
nc_obj <- nc_open(nc_file)
name<-names(nc_obj$var)
@sadatnfs
sadatnfs / AFModel.cpp
Created June 14, 2018 16:09
Automated Forecasting Model TMB Template
////////////////////////////////////////////////////////////////
// Author: Nafis Sadat
// Purpose: Forecasting model base across countries, incorporating ARIMA components
// Created: Sometime in 2017
////////////////////////////////////////////////////////////////
#include <TMB.hpp>
#include <Eigen/Sparse>
#include <vector>
@sadatnfs
sadatnfs / GPR_mods.cpp
Created June 14, 2018 16:10
1-D Gaussian Process Regression using various different methods in TMB
#include <TMB.hpp>
#include <Eigen/Sparse>
#include <vector>
using namespace density;
using Eigen::SparseMatrix;
// helper function to make sparse SPDE precision matrix
// Inputs:
// logkappa: log(kappa) parameter value
// logtau: log(tau) parameter value