Random Thoughts 2012 (COMP 066)
-
Upload
gray-burks -
Category
Documents
-
view
36 -
download
4
description
Transcript of Random Thoughts 2012 (COMP 066)
2
Last class• t-distribution (Excel: T.DIST. ) if:
unknown standard deviation if low number of samples
3
Last Class
1. For each pair take the first value minus the second value to get the paired difference
2. Calculate the mean difference and the standard deviation σ of all samples
3. Calculate the standard error of the sample
4. z-value
5. Determine the p-value
4
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)
5
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
6
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
7
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
8
Discrete Variables 1. A Bernoulli Random Variable: generate a single random variable between (0,1)
Baby
Boy
Girl
1/2
1/2IF ( RAND( ) <1/2, ‘boy’,’girl’)
2. A Binomial Random Variable with n trials:
BINOMINV(RAND(.),n,p)
9
Continuous Distributions
• Uniform distribution RAND()
• Normal distribution NORMSINV(RAND())
• STUDENT (T) distribution TINV(RAND(),degrees of freedom)
10
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 …
12
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%
14
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)
15
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
16
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%
17
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
18
Simulation
• Simulate by using random variable zt to predict daily stock price
1 15 29 43 57 71 85 99 113127141155169183197211225239253$0
$50
$100
$150
$200
19
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
Select m samples
Compute n-parameter solution
Evaluate on {potential line points}
Best solution so far?
Keep it
{potential line points}
yes no
good solution probability >0.99
no
Best solution, {inlier}, {outlier}
{inliersamples}
21
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
24
Epipolar geometry estimation• Typically done with RANSAC [RANSAC Fishler &
Bolles ‘81]
• Camera motion can be described through 3x3 matrix F
(Step 1) Extract features
(Step 2) Set of potential correspondences
(Step 3) do(Step 3.1) select minimal sample (i.e. 7 matches)
(Step 3.2) compute solution(s) for F
(Step 3.3) count inliers, if not promising stop
until (#inliers,#samples)<95%
#inliers 90% 80% 70% 50% 10%
#samples 5 13 35 382 ~30 millio
n
(generate hypothesis)
(verify hypothesis)
[Raguram, Frahm, Pollefeys, ECCV’08] [Raguram, Frahm, Pollefeys, ICCV’09]