Skip to content

Instantly share code, notes, and snippets.

@idrissrasheed
idrissrasheed / Markov Chain.py
Last active August 14, 2017 02:22
Markov chain with application to shuffling a music playlist
# coding: utf-8
#Libraries
import scipy.stats as stat
import numpy as np
from __future__ import division
import math
import matplotlib.pyplot as plt
%matplotlib inline
@idrissrasheed
idrissrasheed / Panjer's Algorithm.py
Last active August 14, 2017 02:25
Compound distributions and Panjer's algorithm in Python
# coding: utf-8
# In[1]:
#libraries
import scipy.stats as stat
import numpy as np
from __future__ import division
import math
@idrissrasheed
idrissrasheed / Ruin Probability.py
Last active August 13, 2017 22:39
Central limit theorem and Monte Carlo approximation with applications to insurance in Python
# coding: utf-8
# In[1]:
#Import libraries
import scipy.stats as stat
import numpy as np
from __future__ import division
get_ipython().magic(u'matplotlib inline')
@idrissrasheed
idrissrasheed / Uniform and Exponential Distribution.py
Last active April 5, 2024 15:08
Exponential and uniform distributions in Python
```python
#Import libraries
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from __future__ import division
%matplotlib inline
```
@idrissrasheed
idrissrasheed / Time Series HW 1.Rmd
Last active August 13, 2017 22:42
Time Series HW assignments in R
library(tseries)
# Simulate Gaussian white noise, find the sample acf, and compare with theoretical acf
x <- rnorm(300, 0, 1)
# Calculate and plot sample acf
myacf = acf(x,plot=FALSE)
# Simulate from an MA(1) process, e.g. X_t = Z_t + .8 Z_{t-1}
y <- arima.sim(list(ma=1), n = 300, sd = 1)
---
title: "PSTAT 131 HW1"
author: "Idris Rasheed and Faraz Farooq"
date: "April 12, 2017"
output: pdf_document
---
###1
(a) Looking up customers of a company according to their profitability.
No. This is a simple accounting calculation.
@idrissrasheed
idrissrasheed / SAS HW 1.sas
Last active August 13, 2017 20:58
SAS HW assignments
/* exercise 1 */
/* set library location */
LIBNAME "C:\Users\SSMS1301-14\Desktop\PSTAT 130 M17"
/* reads airport data with three variables*/
data work.airports;
infile 'airports.dat';
input @ 1 Code $3.
@ 4 City $50.
@54 Country $15.;
run;
@idrissrasheed
idrissrasheed / MC.py
Last active August 13, 2017 22:43
Short Monte Carlo Approximation in Python
#Import libraries
import numpy as np
import math as math
n = 10000
def Monte_Carlo(n):
return np.mean(np.exp(np.random.uniform(0,1,n)))
print Monte_Carlo(n)
---
title: "Bitcoins Market"
author: "Idris Rasheed"
date: "August 12, 2017"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
---
title: "Pima Indian Women Code"
author: "Idris Rasheed"
date: "August 12, 2017"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```