250 likes | 389 Views
Random Thoughts 2012 (COMP 066). Jan-Michael Frahm Jared Heinly. Last class. t-distribution (Excel: T.DIST. ) if: unknown standard deviation if low number of samples. Last Class. For each pair take the first value minus the second value to get the paired difference
E N D
Random Thoughts 2012(COMP 066) Jan-Michael Frahm Jared Heinly
Last class • t-distribution (Excel: T.DIST. ) if: • unknown standard deviation • if low number of samples
Last Class • For each pair take the first value minus the second value to get the paired difference • Calculate the mean difference and the standard deviation σ of all samples • Calculate the standard error of the sample • z-value • Determine the p-value
Last Class • Random number generators (code for random number generator at www.cs.unc.edu/~jmf/teaching/fall2012/Random.xlsx • hardware generators produce truly random numbers but are slow • Pseudo random number generator is fast but not truly random which can be a problem with security applications • Slot machine simulation (assignment for Monday)
What do Statistics Mean? • How to we know how to interpret a poll of Obama 50%±3% and Romney 48%±3%? • How do we interpret an average grows of 10% of the stock market? Average depth 3ft
Monte Carlo Simulation • Simulation allows us to imitate a real world situation to obtain an understanding of it • Monte Carlo Simulation is one of the frequently used simulations • Monte Carlo simulation was named for Monte Carlo, Monaco, where the primary attractions are casinos containing games of chance.Games of chance such as roulette wheels, dice, and slot machines, exhibit random behavior. • Chance is how the simulation choses its variable values
Monte Carlo Simulation: Random Variables • Random variables are used to model the uncertainties in the real-world • Define range and distribution of the variable • Discrete • Bernoulli (success and failure) • Binomial distribution • Continous • uniform distribution • normal distribution • student distribution
Discrete Variables 1. A Bernoulli Random Variable: generate a single random variable between (0,1) Boy 1/2 Baby IF ( RAND( ) <1/2, ‘boy’,’girl’) 1/2 Girl 2. A Binomial Random Variable with n trials: BINOMINV(RAND(.),n,p)
Continuous Distributions • Uniform distribution • RAND() • Normal distribution • NORMSINV(RAND()) • STUDENT (T) distribution • TINV(RAND(),degrees of freedom)
Simulation • For simulation evaluate the problem for many different values of the random variables • The results of the simulation can then be analyzed to obtain summary statistics • mean • variance • medium • …
Polls • How can we simulate: “a poll of Obama 50%±3% and Romney 48%±3%?”
Polls • the mean value of the poll for Obama is 50% • the standard deviation is? • with 95% confidence level z*=1.96 • this mean that for the z-distribution 3% are within 1.96 standard deviations. • hence standard deviation is 1.53%=3%/1.96 • the mean value of the poll for Romney is 48% • standard deviation is also 1.53%
Vote Distributions • Hence the possible votes are distributed in the following manner
Simulate voting • To simulate the voting we can now draw random samples from the vote distribution of the candidates • random number generator with standard normal distribution • scale the value by the standard deviation • shift to mean value of the desired distribution (50% Obama, 48% Romney)
Stock Market • How do we interpret an average grows of 10% of the stock market? • Again the average grows of 10% only applies for long periods of time • Stock market is often described by Brownian motion • the presumably random moving of particles suspended in a fluid • random motion driven by random events
Model for Stock Market • Drift annually is 10%, which is the average increase in value • The standard deviation is called volatility and it is 405 annually • Often expressed in daily values: • driftdaily= 0.0397% (assuming 252 trading days) • volatilitydaily= 2.52%
Model for Stock Market • The daily value St behaves in the following way: • μ is daily drift • σ is valatility • T is time between the t and t-1 • Simplified version
Simulation • Simulate by using random variable zt to predict daily stock price
Using Randomness to Estimate Models • Estimating models from measurement data • line fitting • finding a model to explain the data • Least squares fitting • sensitive to outliers • Using Randomness to find the correct model
Robust data selection: RANSAC • Estimation of line from point data {potential line points} Select m samples Compute n-parameter solution Evaluate on {potential line points} {inliersamples} Best solution so far? yes no no Keep it good solution probability >0.99 Best solution, {inlier}, {outlier}
How many iterations are needed? • We want to be sure to have a good line with 99% probability • depends on ratio ε of good points to bad points • depends on size s of sample • depends on number of iterations i • What is the probability of a good sample? es • What is the probability of no good sample in i iterations? (1-es)i • So probability of good solution is 1-(1-es)i
Camera Motion Estimation • Where where the cameras upon photo taking?
3D from images Camera 3 Camera 1 Camera 2
Epipolar geometry estimation • Typically done with RANSAC [RANSAC Fishler & Bolles ‘81] • Camera motion can be described through 3x3 matrix F (Step 1)Extractfeatures (Step 2)Set of potentialcorrespondences (Step 3) do (Step 3.1) select minimal sample (i.e. 7 matches) (Step 3.2) computesolution(s) for F (Step 3.3) countinliers, ifnotpromisingstop until(#inliers,#samples)<95% (generate hypothesis) (verify hypothesis) [Raguram, Frahm, Pollefeys, ECCV’08] [Raguram, Frahm, Pollefeys, ICCV’09]
Reading Assignment for Monday • Moldinov Chapter 9