This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************** A simple MC integrator **************/ | |
#include<iostream> | |
#include<boost/random.hpp> | |
using namespace std ; | |
double f(double); // to be integrated | |
double w(double); // probab. dens. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************** A simple MC integrator **************/ | |
#include<iostream> | |
#include<boost/random.hpp> | |
/************************************************ | |
In order to calculate $\int f(x) dx$ we write | |
(all integrals are from 0 to $\infty$, but this doesn't matter much) | |
$$ | |
\int f(x) dx = \int w(x)dx \frac{ \int f/w w(x)dx }{ \int w(x)dx } \;. | |
$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy.stats as stats | |
g = stats.gamma.pdf(8., 3.) | |
# no consequences for 'regular' distributions | |
print "\nregular @df=5:", stats.t.pdf(1., df=5) | |
print "\nregular @df=25:", stats.t.pdf(1., df=25) | |
print "\nregular @df=5:", stats.t.pdf(1., df=5) | |
#freeze |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''script to test expect and moments in distributions.stats method | |
not written as a test, prints results, renamed to prevent nose from running it | |
''' | |
import numpy as np | |
from scipy import stats | |
#from statsmodels.stats.moment_helpers import mnc2mvsk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division, print_function, absolute_import | |
import numpy as np | |
from scipy.interpolate import BPoly, PPoly | |
class MixinAsympt(object): | |
def _evaluate(self, x, nu, extrapolate, out): | |
super(MixinAsympt, self)._evaluate(x, nu, False, out) | |
below, above = x < self.x[0], x > self.x[-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numpy.polynomial.hermite_e import HermiteE | |
from scipy.stats import norm, chi2 | |
from scipy.misc import factorial | |
import matplotlib.pyplot as plt | |
def gram_chandler_series(cum): | |
"""Construct the 4th order Gram-Chandler expansion given cumulants. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# <nbformat>3.0</nbformat> | |
# <codecell> | |
from scipy.interpolate import pchip, Akima | |
import numpy as np | |
# <codecell> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "Untitled1" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
OlderNewer