Документ взят из кэша поисковой машины. Адрес оригинального документа : http://hea-www.harvard.edu/AstroStat/HEAD2004/presentation_loredo.pdf
Дата изменения: Sat Sep 11 08:03:05 2004
Дата индексирования: Tue Oct 2 05:23:47 2012
Кодировка:

Поисковые слова: п п п п п
Inference: A Python Package for Astrostatistics A NASA AISR Project
Tom Loredo, Alanna Connors, Travis Oliphant Cornell/Eureka Scientific/BYU


Motivation
Many advanced methods are conceptually simple but computationally complex. Competing methods of ver y different levels of sophistication are often similar from end-user's perspective. Principal obstacle to understanding/use is the ar t of statistical computing. Eliminate this obstacle!


The Inference Project

·

The Inference package Librar y: Deep and broad collection of self-contained tools tailored to astronomers' needs; multiple methods
Parametric Inference Engine: Framework for

parametric modeling; multiple methodologies (2 , likelihood, Bayes) with unified interface

·

Use of a modern VHL language: Python Single implementation facilitates depth/breadth
VHL features speed development, facilitate testing Easy access for new users and PyRAF users

·

Outreach Astrostatistics speakers and sessions at conferences
Selected methods from sessions in the package


A Bit About Python

· · · · · · · ·

A general purpose language with a rich standard library Sophisticated and fast scientific computing capability Simple syntax--resembles "pseudo code," Matlab/IDL Use interactively, or via scripts/modules Object oriented, with a very simple object model--facilitates high level interfaces, modularity Practical rather than "pure"--Selected capabilities of various paradigms (e.g., functional programming, list comprehensions, metaclasses) Easily extendible/embeddable with C/C++/For tran Open source, cross-platform, active & growing user community


Scientific Computing With Python

·

Array computations Syntax inspired by Matlab/IDL/For tran90
Performance near that of C/For tran Numeric: Developed by LLNL/MIT scientists numarray: Numeric's successor from STScI

· · ·

PyRAF -- The IRAF command line in Python (STScI) SciPy (par tly suppor ted by Enthought, NASA)-- special functions, linear algebra, FFTs, DSP, quadrature, ODE solvers, optimizers, basic stats Plotting: matplotlib, Chaco, various libraries


Simple Example: The Rayleigh Statistic
Search for periodic signals in arrival time series, {ti }.

1 R( ) = N



2

2

sin ti
i

+
i

cos ti




Sample Source Code
Python source code C source code

from Numeric import *

#include

def Rayleigh (data, w): double Rayleigh (int n, double *data, wd = w*data double w) { return (sum(sin(wd))**2 + double S, C, wt; sum(cos(wd))**2)/len(data) int i; S = 0.; C = 0.; for (i=0; i

Library: Tools for Continuous Data
Sampled functions with additive noise, di = f (ti ) + ei

· ·

Linear & nonlinear regression: Bershady/Isobe packages, Bayesian EVM, correlated errors Detection/measurement of periodic signals Standard approaches: Power spectrum, Schuster periodogram, Lomb-Scargle
Bretthorst algorithm (Bayesian periodograms); Kepler

periodogram
Bayesian piecewise-constant modeling (Gregor y

me th o d )

· ·

Nonperiodic time series analysis: ARMA, BB, long-mem. Robust estimation/outlier detection


Library: Tools for Discrete Data

· ·

Intervals and limits for rates and ratios from counting: Feldman-Cousins likelihood ordering, Bayes, ABC, profile likelihood Periodic point processes (period searching in arrival time 2 data): Rayleigh statistic, ZN , Bayes log-Fourier models, Gregory-Loredo, adaptive 1-d grid, accelerated (P ,P ) searching, fractional transforms Inhomogeneous point process models for local event detection: Bayes blocks, Poisson "Haar" wavelets Survey analyses: Survival analysis (ASURV), Bayes point process + noise Nonparametric methods: Adaptive splines, neural nets (interfaces to Max Planck PPI methods), mixture models

· · ·


Parametric Inference Engine

· · ·

Three methodologies: 2 , likelihood, Bayes Data types: Point samples, binned, folded; on/off; surveys Automate standard parameter exploration tasks
Exploration on equispaced & logarithmic grids Optimization (unconstrained and with boundar y constraints) Exploration of subsets of parameter space (profiling/projection) Hessian/information matrix calculation

·

Bayesian computation
Marginalization and Bayes factors via adaptive quadrature & Laplace approximation Calculation of 1-d, 2-d, 3-d credible region boundaries Basic Markov chain Monte Carlo (MCMC) suppor t

·

Simulate data


Build a model:
class PowerLawModel(ParametricModel): A = RealParameter(1., 'Amplitude') alpha = RealParameter(range=(-5,-1), 'Index') def signal(self,E): return self.A*E**(self.alpha)

Associate data with predictor :
p1 = SampledChisqrPred(data1) p2 = BinnedChisqrPred(data2)


Make inferences:
inf = ChisqrInference(PowerLawModel, p1, p2) inf.A.logStep(1., 10., 50) inf.alpha.vary() grid = inf.opt()

Returns a grid object w/ projected 2 (A)