1/18/2016Atomic Scale Simulation1 Definition of Simulation What is a simulation? –It has an internal state “S” In classical mechanics, the state = positions.

Slides:



Advertisements
Similar presentations
Random Processes Introduction (2)
Advertisements

Sampling Distributions and Sample Proportions
Modeling and Simulation Monte carlo simulation 1 Arwa Ibrahim Ahmed Princess Nora University.
Random variable Distribution. 200 trials where I flipped the coin 50 times and counted heads no_of_heads in a trial.
STAT 497 APPLIED TIME SERIES ANALYSIS
Corporate Banking and Investment Mathematical issues with volatility modelling Marek Musiela BNP Paribas 25th May 2005.
Observers and Kalman Filters
Lecture 3: Markov processes, master equation
DEPARTMENT OF HEALTH SCIENCE AND TECHNOLOGY STOCHASTIC SIGNALS AND PROCESSES Lecture 1 WELCOME.
Resampling techniques Why resampling? Jacknife Cross-validation Bootstrap Examples of application of bootstrap.
Dimensional reduction, PCA
#9 SIMULATION OUTPUT ANALYSIS Systems Fall 2000 Instructor: Peter M. Hahn
Statistics.
Independent Component Analysis (ICA) and Factor Analysis (FA)
CS Pattern Recognition Review of Prerequisites in Math and Statistics Prepared by Li Yang Based on Appendix chapters of Pattern Recognition, 4.
Lecture II-2: Probability Review
Modern Navigation Thomas Herring
Principles of the Global Positioning System Lecture 10 Prof. Thomas Herring Room A;
Review of Probability.
Introduction l Example: Suppose we measure the current (I) and resistance (R) of a resistor. u Ohm's law relates V and I: V = IR u If we know the uncertainties.
Component Reliability Analysis
1 CE 530 Molecular Simulation Lecture 7 David A. Kofke Department of Chemical Engineering SUNY Buffalo
© Copyright McGraw-Hill CHAPTER 6 The Normal Distribution.
Simulation of Random Walk How do we investigate this numerically? Choose the step length to be a=1 Use a computer to generate random numbers r i uniformly.
1 Physical Chemistry III Molecular Simulations Piti Treesukol Chemistry Department Faculty of Liberal Arts and Science Kasetsart University :
880.P20 Winter 2006 Richard Kass Propagation of Errors Suppose we measure the branching fraction BR(Higgs  +  - ) using the number of produced Higgs.
Short Resume of Statistical Terms Fall 2013 By Yaohang Li, Ph.D.
STA Lecture 161 STA 291 Lecture 16 Normal distributions: ( mean and SD ) use table or web page. The sampling distribution of and are both (approximately)
1 CSI5388: Functional Elements of Statistics for Machine Learning Part I.
Javier Junquera Molecular dynamics in the microcanonical (NVE) ensemble: the Verlet algorithm.
Traffic Modeling.
Population All members of a set which have a given characteristic. Population Data Data associated with a certain population. Population Parameter A measure.
1 LES of Turbulent Flows: Lecture 1 Supplement (ME EN ) Prof. Rob Stoll Department of Mechanical Engineering University of Utah Fall 2014.
Monte Carlo Simulation CWR 6536 Stochastic Subsurface Hydrology.
Physics 270 – Experimental Physics. Standard Deviation of the Mean (Standard Error) When we report the average value of n measurements, the uncertainty.
R Kass/SP07 P416 Lecture 4 1 Propagation of Errors ( Chapter 3, Taylor ) Introduction Example: Suppose we measure the current (I) and resistance (R) of.
9. Convergence and Monte Carlo Errors. Measuring Convergence to Equilibrium Variation distance where P 1 and P 2 are two probability distributions, A.
Module 1: Statistical Issues in Micro simulation Paul Sousa.
Week 21 Stochastic Process - Introduction Stochastic processes are processes that proceed randomly in time. Rather than consider fixed random variables.
Risk Analysis & Modelling Lecture 2: Measuring Risk.
M ONTE C ARLO SIMULATION Modeling and Simulation CS
CHAPTER 5 SIGNAL SPACE ANALYSIS
1 OUTPUT ANALYSIS FOR SIMULATIONS. 2 Introduction Analysis of One System Terminating vs. Steady-State Simulations Analysis of Terminating Simulations.
Review of Probability. Important Topics 1 Random Variables and Probability Distributions 2 Expected Values, Mean, and Variance 3 Two Random Variables.
Discrete-time Random Signals
1 EE571 PART 3 Random Processes Huseyin Bilgekul Eeng571 Probability and astochastic Processes Department of Electrical and Electronic Engineering Eastern.
Tutorial I: Missing Value Analysis
ECE-7000: Nonlinear Dynamical Systems 2. Linear tools and general considerations 2.1 Stationarity and sampling - In principle, the more a scientific measurement.
R.Kass/F02 P416 Lecture 1 1 Lecture 1 Probability and Statistics Introduction: l The understanding of many physical phenomena depend on statistical and.
1 Chapter 8: Model Inference and Averaging Presented by Hui Fang.
Surveying II. Lecture 1.. Types of errors There are several types of error that can occur, with different characteristics. Mistakes Such as miscounting.
Lecture 8: Measurement Errors 1. Objectives List some sources of measurement errors. Classify measurement errors into systematic and random errors. Study.
Intro. ANN & Fuzzy Systems Lecture 16. Classification (II): Practical Considerations.
R. Kass/W03 P416 Lecture 5 l Suppose we are trying to measure the true value of some quantity (x T ). u We make repeated measurements of this quantity.
Kevin Stevenson AST 4762/5765. What is MCMC?  Random sampling algorithm  Estimates model parameters and their uncertainty  Only samples regions of.
6/11/2016Atomic Scale Simulation1 Definition of Simulation What is a simulation? –It has an internal state “S” In classical mechanics, the state = positions.
Computational Physics (Lecture 10) PHY4370. Simulation Details To simulate Ising models First step is to choose a lattice. For example, we can us SC,
Stochastic Process - Introduction
CHEM-E7130 Process Modeling Lecture 6
(5) Notes on the Least Squares Estimate
Advanced Statistical Computing Fall 2016
Outline Introduction Signal, random variable, random process and spectra Analog modulation Analog to digital conversion Digital transmission through baseband.
The Maximum Likelihood Method
Chapter 3 Component Reliability Analysis of Structures.
Introduction to Instrumentation Engineering
The regression model in matrix form
STOCHASTIC HYDROLOGY Random Processes
Lecture 4 Propagation of errors
Lecturer Dr. Veronika Alhanaqtah
Lecture 16. Classification (II): Practical Considerations
Presentation transcript:

1/18/2016Atomic Scale Simulation1 Definition of Simulation What is a simulation? –It has an internal state “S” In classical mechanics, the state = positions {q i } and velocities {p i } of the particles. In Ising model, they are the spins (up or down {  i }) of the particles. –A rule for changing the state S n+1 = T (S n ) In a random case, the new state is sampled from a distribution T(S n+1 |S n ). –From initial state S 0, we repeat the iteration many times: n  ∞ S 0  S 1  S 2  S 3  S 4  S 5  ….. S n  S n+1  Sometimes we call the iteration index “n” “time.” It could be either “real time” or an iteration count, a pseudo-time, sometimes called Monte Carlo time. Simulations can be: –Deterministic (e.g. Newton’s equations via Molecular Dynamics) –Stochastic (Monte Carlo, Brownian motion,…) –Combination of the two Nonetheless, you analyze the errors the same way. As with experiment: the rules of the simulation can be simple but output can be unpredictable.

1/18/2016Atomic Scale Simulation2 Ergodicity Typically simulations are assumed to be ergodic: –after a certain time the system loses memory of its initial state, S 0, except possibly for certain conserved quantities such as the energy, momentum. –The correlation time κ (which we will define soon) is the number of iterations it takes to forget. –If you look at (non-conserved) properties for times much longer κ, they are unpredictable as if randomly sampled from some distribution. –Ergodicity is often easy to prove for the random transition but usually difficult for the deterministic simulation. More later. –The assumption of egodicity is used for: Warm up period at the beginning (or equilibration) To get independent samples for computing errors.

1/18/2016Atomic Scale Simulation3 Equilibrium Statistical Distribution Let F t (S|S 0 ) be the distribution of state after time t. If the system is ergodic, no matter what the initial state, one can characterize the state of the system for t >> κ by a unique probability distribution: the equilibrium state F * (S). In classical case, this is the canonical Boltzmann distribution: F * (S)=exp(-V(S)/kT)/Z One goal is to compute averages to get properties in equilibrium. e.g. the internal energy: Another is to compute dynamics: e.g., the diffusion constant.

1/18/2016Atomic Scale Simulation4 Estimated Errors In what sense do we calculate exact properties? Answer: if we average long enough the error goes to zero. Hence the error is under control. Next, how accurate is the estimate of the exact value? –Simulation results without error bars are only suggestive. All homework exercises must include errors estimates Without error bars one has no idea of its significance. You should understand formulas and be able to make an “eye- ball” estimate. Error bar: the estimated error in the estimated mean. –Error estimates based on Gauss’ Central Limit Theorem. –Average of statistical processes has normal (Gaussian) distribution. –Error bars: square root of the variance of the distribution divided by the number of uncorrelated steps. Histogram of E

1/18/2016Atomic Scale Simulation5 Central Limit Theorem (Gauss) Sample N independent values from F * (x)dx, i.e. (x 1, x 2, x 3, …,x N ). Calculate mean as y = (1/N)∑ x i. What is the pdf of mean?Solve by fourier transforms Characteristic function: Cumulants: Mean = κ 1 Variance= κ 2 Skewness = κ 3 Kurtosis= κ 4 The n=1 moment remains invariant but the rest get reduced by higher powers of N. Given enough averaging almost anything becomes a Gaussian distribution.

1/18/2016Atomic Scale Simulation6 Conditions on Central Limit Theorem We need the first three moments to exist. –If I 0 is not defined => not a pdf (probability distribution fct.) –If I 1 does not exist => not mathematically well-posed. –If I 2 does not exist => infinite variance. Important to know if variance is finite for simulations. Divergence could happen because of tails of distribution We need: Divergence because of singular behavior of F * at finite x:

1/18/2016Atomic Scale Simulation7 Approach to normality

1/18/2016Atomic Scale Simulation8 Multidimensional Generalization of the central limit theorem Suppose r is an m dimensional vector from a multidimensional pdf: p(r)d m r. The mean is defined as before. The variance becomes the covariance, a positive symmetric m x m matrix : V i,j = )(x j - )> For sufficiently large N, the estimated mean (y) will approach the distribution:

1/18/2016Atomic Scale Simulation9 2d histogram of occurrences of means Off-diagonal components of ν ij are called the co-variance. Data can be uncorrelated, positively or negatively correlated depending on sign of ν ij Like a moment of inertia tensor: there are 2 principal axes with variances Find axes with diagonalization or singular value decomposition Individual error bars on x 1 and x 2 can be misleading if correlated. x1x1 x2x2

1/18/2016Atomic Scale Simulation10 Estimate of errors t t’ κ

1/18/2016Atomic Scale Simulation11 Estimating Errors Uncorrelated data Correlated data Problem: How to cut off the summation for κ? Blocking method: Average together data in blocks longer than the correlation time until it is uncorrelated.

1/18/2016Atomic Scale Simulation12 DataSpork Interactive code to perform statistical analysis of data

1/18/2016Atomic Scale Simulation13 Correlated dataUncorrelated data

1/18/2016Atomic Scale Simulation14 Statistical vs. Systematic Errors What are statistical errors? –Statistical error measures the distribution of the averages about their avg. –Statistical error can be reduced by extending or repeating runs, increase N. The efficiency is how we measure the rate of convergence of the statistical errors. –It depends on the computer, the algorithm, the property etc. But not on the length of the run. What are systematic errors ? –Systematic error measures the error which is not sampling error. Even if you sample forever you do not get rid of systematic errors. – Systematic error is caused by round-off error, non-linearities, bugs, non- equilibrium, etc.

1/18/2016Atomic Scale Simulation15 Recap: problems with estimating errors Any good simulation quotes systematic and statistical errors for anything important. The error and mean are simultaneously determined from the same data. HOW? Central limit theorem: the distribution of an average approaches a normal distribution (if the variance is finite). –One standard deviation means ~2/3 of the time the correct answer is within σ of the sample average. Problem in simulations is that data is correlated in time. –It takes a “correlation” time κ to be “ergodic” –Correction errors for autocorrelation. – throw away the initial transient. We need about 20 independent data points to estimate errors. (so error of error is only 20%)

1/18/2016Atomic Scale Simulation16 Statistical Vocabulary  Trace of A(t):  Equilibration time.  Histogram of values of A ( P(A) ).  Mean of A (a).  Variance of A ( v ).  estimate of the mean: Σ A(t)/N  estimate of the variance  Autocorrelation of A (C(t)).  Correlation time .  The (estimated) error of the (estimated) mean (  ).  Efficiency [= 1/(CPU time * error 2 )]

1/18/2016Atomic Scale Simulation17 Statistical thinking is slippery: be careful “Shouldn’t the energy settle down to a constant” –NO. It fluctuates forever. It is the overall mean which converges. “The cumulative energy has converged”. –BEWARE. Even pathological cases have smooth cumulative energy curves. “Data set A differs from B by 2 error bars. Therefore it must be different”. –This is normal in 1 out of 10 cases. If things agree too well, something is wrong! “My procedure is too complicated to compute errors” –NO! Run your whole code 10 times and compute the mean and variance from the different runs. If a quantity is important, you MUST estimate its errors.

1/18/2016Atomic Scale Simulation18 Homework On computing error bars and using dataspork. See the web site for the assignment. Due: See website. Python tutorial next: See website.