SlideShare a Scribd company logo
Stochastic Section # 6
Linear Estimation, Model Selection & Hypothesis Test
Eslam Adel
April 10, 2018
1 Parameters Estimation of Model
Estimation of model parameters is an optimization problem. There is different methods for parameter estima-
tion. We talked about minimizing mean square error criteria. Here we have another one which is maximum
likelihood criteria.
1.1 Maximum Likelihood method (ML)
• Maximize the likelihood function or joint probability density function (jPDF).
• jPDF f(x) = f(x0, x1, x2, . . . , xN−1)
• For uncorrelated gaussian vector (independent)
f(x) = f(x0, x1, x2, . . . , xN ) = f(x0)f(x1)f(x2) . . . f(xN−1)
• For correlated signals use conditional probability
f(x) = f(x0, x1, x2, . . . , xN ) = f(xn|xn−1)f(xn−1|xn−2) . . . f(x2|x1)f(x1|x0)f(x0)
• We actually maximize the log(f(x)) where log operator converts multiplication to summation.
• Note: Solving optimization problem to find values of unknowns is out of study.
1.1.1 Example 1
Find the jPDF for the following MA(1) model.
x(n) = (n) + b1 (n − 1) (1)
Solution
n = 0, x0 = 0
n = 1, x1 = 1 + b1 0
n = 2, x2 = 2 + b1 1
In Matrix form







x0
x1
x2
...
xN−1







=







1 0 0 . . . 0
b1 1 0 . . . 0
0 b1 1 . . . 0
...
...
...
...
...
0 0 . . . b1 1














0
1
2
...
N−1







B =







1 0 0 . . . 0
b1 1 0 . . . 0
0 b1 1 . . . 0
...
...
...
...
...
0 0 . . . b1 1







1
So the model will be x = B where ∼ N(0, ) (uncorrelated White gaussian noise).
So x ∼ N(mx, x)
mx = E[x] = E[B ] = BE[ ] = 0
x = E[xxT
] − mxmT
x
x = E[B (B )T
] − 0
x = BE[ T
]BT
= B BT
Therefore
x ∼ N(0, x), x = B BT
And jPDF (likelihood function) :
f(x) =
1
(2π)
N
2 (det( x))
1
2
e
−1
2 (xT −1
x x)
(2)
1.1.2 Example 2
Find the jPDF for the following ARMA(1, 1) model.
x(n) = a1x(n − 1) + (n) + b1 (n − 1) (3)
Solution
Let y(n) = x(n) − a1x(n − k)
n = 0, y0 = x0
n = 1, y1 = x1 − a1x0
n = 2, y2 = x2 − a1x1
In Matrix form







y0
y1
y2
...
yN−1







=







1 0 0 . . . 0
−a1 1 0 . . . 0
0 −a1 1 . . . 0
...
...
...
...
...
0 0 . . . −a1 1














x0
x1
x2
...
xN−1







A =







1 0 0 . . . 0
−a1 1 0 . . . 0
0 −a1 1 . . . 0
...
...
...
...
...
0 0 . . . −a1 1







So y = Ax
And also y(n) = (n) + b1 (n − 1)
n = 0, y0 = 0
n = 1, y1 = 1 + b1 0
n = 2, y2 = 2 + b1 1
In Matrix form







y0
y1
y2
...
yN−1







=







1 0 0 . . . 0
b1 1 0 . . . 0
0 b1 1 . . . 0
...
...
...
...
...
0 0 . . . b1 1














0
1
2
...
N−1







B =







1 0 0 . . . 0
b1 1 0 . . . 0
0 b1 1 . . . 0
...
...
...
...
...
0 0 . . . b1 1







2
y = Ax = B → x = A−1
B where ∼ N(0, ) (uncorrelated White gaussian noise).
So x ∼ N(mx, x)
mx = E[x] = E[A−1
B ] = A−1
BE[ ] = 0
x = E[xxT
] − mxmT
x
x = E[A−1
B (A−1
B )T
] − 0
x = A−1
BE[ T
]BT
(A−1
)T
= A−1
B BT
(A−1
)T
Therefore
x ∼ N(0, x), x = A−1
B BT
(A−1
)T
And jPDF (likelihood function) :
f(x) =
1
(2π)
N
2 (det( x))
1
2
e
−1
2 (xT −1
x x)
(4)
2 Model Selection
Model selection is the next step after estimation of different models for the same signal. We will study a method
to compare different models and select best one of them.
2.1 AIC
• Akaik’s Information Criteria
• Gives a measure of relative quality of statistical models.
• It gives an estimate of relative information loss using such model.
• Best model has minimum information loss (Minimum AIC value)
AIC = 2k − 2ln(ˆL) (5)
where k is number of model parameters. ˆL is an estimate value of likelihood.
3 Hypothesis test
We have two or more different classes of signals. Each class is modeled with a specific model. For a new un-
known signal. We need to determine which class it belongs to. The idea is to calculate likelihood (probability)
of this signal given models of all classes and select most probable class (Max likelihood value).
For unknown signal x with N class data calculate
f1(x|Model1), f2(x|Model2), f3(x|Model3) , . . . , fN (x|ModelN )
signal x belongs to class with maximum likelihood value.
4 Demo
This is a simple example that demonstrates how to estimate different models for your signal, select on of
estimated models based on its AIC value, and apply hypothesis test to determine the class of unknown signal
using predefined models. So steps are
• Model estimation
• Model selection
• Hypothesis test
3
1 c l o s e a l l
2 clc , c l e a r
3 %% Load EEG Dataset
4 % t h i s i s a motor imagery dataset . We have two c l a s s e s .
5 % Class 1 where subject imagines moving h i s r i g h t arm .
6 % Class 2 where subject imagines moving h i s l e f t arm .
7 % There i s d i f f e r e n t EEG channels C3 , C4 and Cz
8 % We w i l l s e l e c t only one of them .
9 load ( ’ dataset BCIcomp1 . mat ’ )
10
11 % We w i l l use f i r s t Channel from c l a s s 1
12 % Note : detrend −> makes the s i g n a l zero mean
13 dataClass1 = detrend ( x t r a i n (500:800 ,1 ,1) ) ;
14 %f i r s t Channel from c l a s s 2
15 dataClass2 = detrend ( x t r a i n (500:800 ,1 ,2) ) ;
16 data = [ dataClass1 , dataClass2 ] ;
17 %Test data from c l a s s 1
18 testData = detrend ( x t r a i n (801:1000 ,1 ,1) ) ;
19
20 % Empty c e l l array to be updated with s e l e c t e d models f o r both c l a s s 1 and 2
21 selectedModels = c e l l (2 ,1) ;
22 %% [ 1 ] Models Estimation
23 % MA(2) , AR(2) , ARMA(1 ,2) Models
24 % We have two c l a s s e s so we w i l l estimate models and s e l e c t one f o r each c l a s s .
25 f o r i = 1:2
26 [ model MA2 , ˜ , logL MA2 ] = estimate ( arima (0 ,0 ,2) , data ( : , i ) ) ;
27 [ model AR2 , ˜ , logL AR2 ] = estimate ( arima (2 ,0 ,0) , data ( : , i ) ) ;
28 [ model ARMA12 , ˜ , logL ARMA12 ] = estimate ( arima (1 ,0 ,2) , data ( : , i ) ) ;
29 models = {model MA2 , model AR2 , model ARMA12 };
30
31 %% [ 2 ] Model S e l e c t i o n based on AIC value
32 %Calculte Akiak ’ s information c r i t e r i a f o r a l l models
33 aic MA2 = 2∗2 − 2∗logL MA2 ;
34 aic AR2 = 2∗2 − 2∗logL AR2 ;
35 aic ARMA12 = 2∗3 − 2∗logL ARMA12 ;
36
37 % S e l e c t model with minimum a i c
38 [ ˜ , idx ] = min ( [ aic MA2 , aic AR2 , aic ARMA12 ] ) ;
39 % Update s e l e c t e d models
40 selectedModels { i } = models{ idx };
41 end
42
43 % I n i t i a l i z e an array to be updated with l i k e l i h o o d values f o r each c l a s s
44 l i k e l i h o o d V a l s = zeros (1 ,2) ;
45 %% [ 3 ] Hypothesis t e s t
46 f o r i = 1:2
47 % Calculate l i k e l i h o o d estimate f o r testData using s e l e c t e d model of each
48 % c l a s s
49 [ ˜ , ˜ , logL ] = estimate ( selectedModels { i } , testData ) ;
50 l i k e l i h o o d V a l s ( i ) = logL ;
51 end
52 %S e l e c t c l a s s with maximum l i k e l i h o o d value
53 [ ˜ , testDataClass ] = max( l i k e l i h o o d V a l s ) ;
54 display ( testDataClass )
Listing 1: Section Demo
You can download section demo from repository
5 Useful links
• System Identification Toolbox examples
• Different Model estimation methods
• estimate function
4

More Related Content

What's hot

Ch 06 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
Ch 06 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片Ch 06 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
Ch 06 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
Chyi-Tsong Chen
 
Mat lab
Mat labMat lab
Recommender Systems
Recommender SystemsRecommender Systems
Basic concepts in_matlab
Basic concepts in_matlabBasic concepts in_matlab
Basic concepts in_matlab
Mohammad Alauddin
 
MATLAB - Arrays and Matrices
MATLAB - Arrays and MatricesMATLAB - Arrays and Matrices
MATLAB - Arrays and Matrices
Shameer Ahmed Koya
 
Numerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equationsNumerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equations
Scilab
 
MATLAB - Aplication of Arrays and Matrices in Electrical Systems
MATLAB - Aplication of Arrays and Matrices in Electrical SystemsMATLAB - Aplication of Arrays and Matrices in Electrical Systems
MATLAB - Aplication of Arrays and Matrices in Electrical Systems
Shameer Ahmed Koya
 
ADAPTIVE CONTROL AND SYNCHRONIZATION OF SPROTT-I SYSTEM WITH UNKNOWN PARAMETERS
ADAPTIVE CONTROL AND SYNCHRONIZATION OF SPROTT-I SYSTEM WITH UNKNOWN PARAMETERSADAPTIVE CONTROL AND SYNCHRONIZATION OF SPROTT-I SYSTEM WITH UNKNOWN PARAMETERS
ADAPTIVE CONTROL AND SYNCHRONIZATION OF SPROTT-I SYSTEM WITH UNKNOWN PARAMETERS
ijscai
 
statistics assignment help
statistics assignment helpstatistics assignment help
statistics assignment help
Statistics Homework Helper
 
PCA and LDA in machine learning
PCA and LDA in machine learningPCA and LDA in machine learning
PCA and LDA in machine learning
Akhilesh Joshi
 
Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2
Scilab
 
STABILITY ANALYSIS AND CONTROL OF A 3-D AUTONOMOUS AI-YUAN-ZHI-HAO HYPERCHAOT...
STABILITY ANALYSIS AND CONTROL OF A 3-D AUTONOMOUS AI-YUAN-ZHI-HAO HYPERCHAOT...STABILITY ANALYSIS AND CONTROL OF A 3-D AUTONOMOUS AI-YUAN-ZHI-HAO HYPERCHAOT...
STABILITY ANALYSIS AND CONTROL OF A 3-D AUTONOMOUS AI-YUAN-ZHI-HAO HYPERCHAOT...
ijscai
 
The fundamentals of regression
The fundamentals of regressionThe fundamentals of regression
The fundamentals of regression
Stephanie Locke
 
Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4
Randa Elanwar
 
Intro matlab and convolution islam
Intro matlab and convolution islamIntro matlab and convolution islam
Intro matlab and convolution islamIslam Alabbasy
 
Psychtoolbox (PTB) practical course by Volodymyr B. Bogdanov, Kyiv 2017, Day 1
Psychtoolbox (PTB) practical course  by Volodymyr B. Bogdanov, Kyiv 2017, Day 1Psychtoolbox (PTB) practical course  by Volodymyr B. Bogdanov, Kyiv 2017, Day 1
Psychtoolbox (PTB) practical course by Volodymyr B. Bogdanov, Kyiv 2017, Day 1
Volodymyr Bogdanov
 
Curvefitting
CurvefittingCurvefitting
Curvefitting
Philberto Saroni
 
Statistics Assignment Help
Statistics Assignment HelpStatistics Assignment Help
Statistics Assignment Help
Statistics Assignment Help
 
Matlab practice
Matlab practiceMatlab practice
Matlab practice
ZunAib Ali
 

What's hot (20)

Ch 06 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
Ch 06 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片Ch 06 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
Ch 06 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
 
Mat lab
Mat labMat lab
Mat lab
 
Recommender Systems
Recommender SystemsRecommender Systems
Recommender Systems
 
Basic concepts in_matlab
Basic concepts in_matlabBasic concepts in_matlab
Basic concepts in_matlab
 
MATLAB - Arrays and Matrices
MATLAB - Arrays and MatricesMATLAB - Arrays and Matrices
MATLAB - Arrays and Matrices
 
Numerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equationsNumerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equations
 
MATLAB - Aplication of Arrays and Matrices in Electrical Systems
MATLAB - Aplication of Arrays and Matrices in Electrical SystemsMATLAB - Aplication of Arrays and Matrices in Electrical Systems
MATLAB - Aplication of Arrays and Matrices in Electrical Systems
 
ADAPTIVE CONTROL AND SYNCHRONIZATION OF SPROTT-I SYSTEM WITH UNKNOWN PARAMETERS
ADAPTIVE CONTROL AND SYNCHRONIZATION OF SPROTT-I SYSTEM WITH UNKNOWN PARAMETERSADAPTIVE CONTROL AND SYNCHRONIZATION OF SPROTT-I SYSTEM WITH UNKNOWN PARAMETERS
ADAPTIVE CONTROL AND SYNCHRONIZATION OF SPROTT-I SYSTEM WITH UNKNOWN PARAMETERS
 
statistics assignment help
statistics assignment helpstatistics assignment help
statistics assignment help
 
PCA and LDA in machine learning
PCA and LDA in machine learningPCA and LDA in machine learning
PCA and LDA in machine learning
 
Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2
 
STABILITY ANALYSIS AND CONTROL OF A 3-D AUTONOMOUS AI-YUAN-ZHI-HAO HYPERCHAOT...
STABILITY ANALYSIS AND CONTROL OF A 3-D AUTONOMOUS AI-YUAN-ZHI-HAO HYPERCHAOT...STABILITY ANALYSIS AND CONTROL OF A 3-D AUTONOMOUS AI-YUAN-ZHI-HAO HYPERCHAOT...
STABILITY ANALYSIS AND CONTROL OF A 3-D AUTONOMOUS AI-YUAN-ZHI-HAO HYPERCHAOT...
 
The fundamentals of regression
The fundamentals of regressionThe fundamentals of regression
The fundamentals of regression
 
Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4
 
Intro matlab and convolution islam
Intro matlab and convolution islamIntro matlab and convolution islam
Intro matlab and convolution islam
 
Psychtoolbox (PTB) practical course by Volodymyr B. Bogdanov, Kyiv 2017, Day 1
Psychtoolbox (PTB) practical course  by Volodymyr B. Bogdanov, Kyiv 2017, Day 1Psychtoolbox (PTB) practical course  by Volodymyr B. Bogdanov, Kyiv 2017, Day 1
Psychtoolbox (PTB) practical course by Volodymyr B. Bogdanov, Kyiv 2017, Day 1
 
Curvefitting
CurvefittingCurvefitting
Curvefitting
 
Statistics Assignment Help
Statistics Assignment HelpStatistics Assignment Help
Statistics Assignment Help
 
Matlab practice
Matlab practiceMatlab practice
Matlab practice
 
Lab 3
Lab 3Lab 3
Lab 3
 

Similar to Section6 stochastic

Maneuvering target track prediction model
Maneuvering target track prediction modelManeuvering target track prediction model
Maneuvering target track prediction model
IJCI JOURNAL
 
Paper computer
Paper computerPaper computer
Paper computerbikram ...
 
Paper computer
Paper computerPaper computer
Paper computerbikram ...
 
Count-Distinct Problem
Count-Distinct ProblemCount-Distinct Problem
Count-Distinct Problem
Kai Zhang
 
Principal Components Analysis, Calculation and Visualization
Principal Components Analysis, Calculation and VisualizationPrincipal Components Analysis, Calculation and Visualization
Principal Components Analysis, Calculation and Visualization
Marjan Sterjev
 
Conditional Random Fields
Conditional Random FieldsConditional Random Fields
Conditional Random Fieldslswing
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
Dr. C.V. Suresh Babu
 
Functional Regression Analysis
Functional Regression AnalysisFunctional Regression Analysis
Functional Regression Analysis
NeuroMat
 
2012 mdsp pr06  hmm
2012 mdsp pr06  hmm2012 mdsp pr06  hmm
2012 mdsp pr06  hmmnozomuhamada
 
Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...
Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...
Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...
Michael Lie
 
Introduction to Artificial Neural Networks
Introduction to Artificial Neural NetworksIntroduction to Artificial Neural Networks
Introduction to Artificial Neural Networks
Stratio
 
Quatum fridge
Quatum fridgeQuatum fridge
Quatum fridge
Jun Steed Huang
 
Computational Intelligence Assisted Engineering Design Optimization (using MA...
Computational Intelligence Assisted Engineering Design Optimization (using MA...Computational Intelligence Assisted Engineering Design Optimization (using MA...
Computational Intelligence Assisted Engineering Design Optimization (using MA...
AmirParnianifard1
 
Vu_HPSC2012_02.pptx
Vu_HPSC2012_02.pptxVu_HPSC2012_02.pptx
Vu_HPSC2012_02.pptx
QucngV
 
chapter10
chapter10chapter10
chapter10butest
 
Conference poster 6
Conference poster 6Conference poster 6
Conference poster 6
NTNU
 
assignemts.pdf
assignemts.pdfassignemts.pdf
assignemts.pdf
ramish32
 
Rfid presentation in internet
Rfid presentation in internetRfid presentation in internet
Rfid presentation in internetAli Azarnia
 
Chapter_09_ParameterEstimation.pptx
Chapter_09_ParameterEstimation.pptxChapter_09_ParameterEstimation.pptx
Chapter_09_ParameterEstimation.pptx
VimalMehta19
 

Similar to Section6 stochastic (20)

Maneuvering target track prediction model
Maneuvering target track prediction modelManeuvering target track prediction model
Maneuvering target track prediction model
 
Paper computer
Paper computerPaper computer
Paper computer
 
Paper computer
Paper computerPaper computer
Paper computer
 
Count-Distinct Problem
Count-Distinct ProblemCount-Distinct Problem
Count-Distinct Problem
 
Principal Components Analysis, Calculation and Visualization
Principal Components Analysis, Calculation and VisualizationPrincipal Components Analysis, Calculation and Visualization
Principal Components Analysis, Calculation and Visualization
 
Conditional Random Fields
Conditional Random FieldsConditional Random Fields
Conditional Random Fields
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
 
Functional Regression Analysis
Functional Regression AnalysisFunctional Regression Analysis
Functional Regression Analysis
 
2012 mdsp pr06  hmm
2012 mdsp pr06  hmm2012 mdsp pr06  hmm
2012 mdsp pr06  hmm
 
Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...
Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...
Time-Series Analysis on Multiperiodic Conditional Correlation by Sparse Covar...
 
Introduction to Artificial Neural Networks
Introduction to Artificial Neural NetworksIntroduction to Artificial Neural Networks
Introduction to Artificial Neural Networks
 
Quatum fridge
Quatum fridgeQuatum fridge
Quatum fridge
 
Computational Intelligence Assisted Engineering Design Optimization (using MA...
Computational Intelligence Assisted Engineering Design Optimization (using MA...Computational Intelligence Assisted Engineering Design Optimization (using MA...
Computational Intelligence Assisted Engineering Design Optimization (using MA...
 
Vu_HPSC2012_02.pptx
Vu_HPSC2012_02.pptxVu_HPSC2012_02.pptx
Vu_HPSC2012_02.pptx
 
chapter10
chapter10chapter10
chapter10
 
Conference poster 6
Conference poster 6Conference poster 6
Conference poster 6
 
Project2
Project2Project2
Project2
 
assignemts.pdf
assignemts.pdfassignemts.pdf
assignemts.pdf
 
Rfid presentation in internet
Rfid presentation in internetRfid presentation in internet
Rfid presentation in internet
 
Chapter_09_ParameterEstimation.pptx
Chapter_09_ParameterEstimation.pptxChapter_09_ParameterEstimation.pptx
Chapter_09_ParameterEstimation.pptx
 

More from cairo university

Tocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extendedTocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extended
cairo university
 
Tocci chapter 12 memory devices
Tocci chapter 12 memory devicesTocci chapter 12 memory devices
Tocci chapter 12 memory devices
cairo university
 
Tocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuitsTocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuits
cairo university
 
Tocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified xTocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified x
cairo university
 
Tocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuitsTocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuits
cairo university
 
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
cairo university
 
A15 sedra ch 15 memory circuits
A15  sedra ch 15 memory circuitsA15  sedra ch 15 memory circuits
A15 sedra ch 15 memory circuits
cairo university
 
A14 sedra ch 14 advanced mos and bipolar logic circuits
A14  sedra ch 14 advanced mos and bipolar logic circuitsA14  sedra ch 14 advanced mos and bipolar logic circuits
A14 sedra ch 14 advanced mos and bipolar logic circuits
cairo university
 
A13 sedra ch 13 cmos digital logic circuits
A13  sedra ch 13 cmos digital logic circuitsA13  sedra ch 13 cmos digital logic circuits
A13 sedra ch 13 cmos digital logic circuits
cairo university
 
A09 sedra ch 9 frequency response
A09  sedra ch 9 frequency responseA09  sedra ch 9 frequency response
A09 sedra ch 9 frequency response
cairo university
 
5 sedra ch 05 mosfet.ppsx
5  sedra ch 05  mosfet.ppsx5  sedra ch 05  mosfet.ppsx
5 sedra ch 05 mosfet.ppsx
cairo university
 
5 sedra ch 05 mosfet
5  sedra ch 05  mosfet5  sedra ch 05  mosfet
5 sedra ch 05 mosfet
cairo university
 
5 sedra ch 05 mosfet revision
5  sedra ch 05  mosfet revision5  sedra ch 05  mosfet revision
5 sedra ch 05 mosfet revision
cairo university
 
Fields Lec 2
Fields Lec 2Fields Lec 2
Fields Lec 2
cairo university
 
Fields Lec 1
Fields Lec 1Fields Lec 1
Fields Lec 1
cairo university
 
Fields Lec 5&6
Fields Lec 5&6Fields Lec 5&6
Fields Lec 5&6
cairo university
 
Fields Lec 4
Fields Lec 4Fields Lec 4
Fields Lec 4
cairo university
 
Fields Lec 3
Fields Lec 3Fields Lec 3
Fields Lec 3
cairo university
 
Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01
cairo university
 
Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01
cairo university
 

More from cairo university (20)

Tocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extendedTocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extended
 
Tocci chapter 12 memory devices
Tocci chapter 12 memory devicesTocci chapter 12 memory devices
Tocci chapter 12 memory devices
 
Tocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuitsTocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuits
 
Tocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified xTocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified x
 
Tocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuitsTocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuits
 
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
 
A15 sedra ch 15 memory circuits
A15  sedra ch 15 memory circuitsA15  sedra ch 15 memory circuits
A15 sedra ch 15 memory circuits
 
A14 sedra ch 14 advanced mos and bipolar logic circuits
A14  sedra ch 14 advanced mos and bipolar logic circuitsA14  sedra ch 14 advanced mos and bipolar logic circuits
A14 sedra ch 14 advanced mos and bipolar logic circuits
 
A13 sedra ch 13 cmos digital logic circuits
A13  sedra ch 13 cmos digital logic circuitsA13  sedra ch 13 cmos digital logic circuits
A13 sedra ch 13 cmos digital logic circuits
 
A09 sedra ch 9 frequency response
A09  sedra ch 9 frequency responseA09  sedra ch 9 frequency response
A09 sedra ch 9 frequency response
 
5 sedra ch 05 mosfet.ppsx
5  sedra ch 05  mosfet.ppsx5  sedra ch 05  mosfet.ppsx
5 sedra ch 05 mosfet.ppsx
 
5 sedra ch 05 mosfet
5  sedra ch 05  mosfet5  sedra ch 05  mosfet
5 sedra ch 05 mosfet
 
5 sedra ch 05 mosfet revision
5  sedra ch 05  mosfet revision5  sedra ch 05  mosfet revision
5 sedra ch 05 mosfet revision
 
Fields Lec 2
Fields Lec 2Fields Lec 2
Fields Lec 2
 
Fields Lec 1
Fields Lec 1Fields Lec 1
Fields Lec 1
 
Fields Lec 5&6
Fields Lec 5&6Fields Lec 5&6
Fields Lec 5&6
 
Fields Lec 4
Fields Lec 4Fields Lec 4
Fields Lec 4
 
Fields Lec 3
Fields Lec 3Fields Lec 3
Fields Lec 3
 
Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01
 
Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01
 

Recently uploaded

Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 

Recently uploaded (20)

Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 

Section6 stochastic

  • 1. Stochastic Section # 6 Linear Estimation, Model Selection & Hypothesis Test Eslam Adel April 10, 2018 1 Parameters Estimation of Model Estimation of model parameters is an optimization problem. There is different methods for parameter estima- tion. We talked about minimizing mean square error criteria. Here we have another one which is maximum likelihood criteria. 1.1 Maximum Likelihood method (ML) • Maximize the likelihood function or joint probability density function (jPDF). • jPDF f(x) = f(x0, x1, x2, . . . , xN−1) • For uncorrelated gaussian vector (independent) f(x) = f(x0, x1, x2, . . . , xN ) = f(x0)f(x1)f(x2) . . . f(xN−1) • For correlated signals use conditional probability f(x) = f(x0, x1, x2, . . . , xN ) = f(xn|xn−1)f(xn−1|xn−2) . . . f(x2|x1)f(x1|x0)f(x0) • We actually maximize the log(f(x)) where log operator converts multiplication to summation. • Note: Solving optimization problem to find values of unknowns is out of study. 1.1.1 Example 1 Find the jPDF for the following MA(1) model. x(n) = (n) + b1 (n − 1) (1) Solution n = 0, x0 = 0 n = 1, x1 = 1 + b1 0 n = 2, x2 = 2 + b1 1 In Matrix form        x0 x1 x2 ... xN−1        =        1 0 0 . . . 0 b1 1 0 . . . 0 0 b1 1 . . . 0 ... ... ... ... ... 0 0 . . . b1 1               0 1 2 ... N−1        B =        1 0 0 . . . 0 b1 1 0 . . . 0 0 b1 1 . . . 0 ... ... ... ... ... 0 0 . . . b1 1        1
  • 2. So the model will be x = B where ∼ N(0, ) (uncorrelated White gaussian noise). So x ∼ N(mx, x) mx = E[x] = E[B ] = BE[ ] = 0 x = E[xxT ] − mxmT x x = E[B (B )T ] − 0 x = BE[ T ]BT = B BT Therefore x ∼ N(0, x), x = B BT And jPDF (likelihood function) : f(x) = 1 (2π) N 2 (det( x)) 1 2 e −1 2 (xT −1 x x) (2) 1.1.2 Example 2 Find the jPDF for the following ARMA(1, 1) model. x(n) = a1x(n − 1) + (n) + b1 (n − 1) (3) Solution Let y(n) = x(n) − a1x(n − k) n = 0, y0 = x0 n = 1, y1 = x1 − a1x0 n = 2, y2 = x2 − a1x1 In Matrix form        y0 y1 y2 ... yN−1        =        1 0 0 . . . 0 −a1 1 0 . . . 0 0 −a1 1 . . . 0 ... ... ... ... ... 0 0 . . . −a1 1               x0 x1 x2 ... xN−1        A =        1 0 0 . . . 0 −a1 1 0 . . . 0 0 −a1 1 . . . 0 ... ... ... ... ... 0 0 . . . −a1 1        So y = Ax And also y(n) = (n) + b1 (n − 1) n = 0, y0 = 0 n = 1, y1 = 1 + b1 0 n = 2, y2 = 2 + b1 1 In Matrix form        y0 y1 y2 ... yN−1        =        1 0 0 . . . 0 b1 1 0 . . . 0 0 b1 1 . . . 0 ... ... ... ... ... 0 0 . . . b1 1               0 1 2 ... N−1        B =        1 0 0 . . . 0 b1 1 0 . . . 0 0 b1 1 . . . 0 ... ... ... ... ... 0 0 . . . b1 1        2
  • 3. y = Ax = B → x = A−1 B where ∼ N(0, ) (uncorrelated White gaussian noise). So x ∼ N(mx, x) mx = E[x] = E[A−1 B ] = A−1 BE[ ] = 0 x = E[xxT ] − mxmT x x = E[A−1 B (A−1 B )T ] − 0 x = A−1 BE[ T ]BT (A−1 )T = A−1 B BT (A−1 )T Therefore x ∼ N(0, x), x = A−1 B BT (A−1 )T And jPDF (likelihood function) : f(x) = 1 (2π) N 2 (det( x)) 1 2 e −1 2 (xT −1 x x) (4) 2 Model Selection Model selection is the next step after estimation of different models for the same signal. We will study a method to compare different models and select best one of them. 2.1 AIC • Akaik’s Information Criteria • Gives a measure of relative quality of statistical models. • It gives an estimate of relative information loss using such model. • Best model has minimum information loss (Minimum AIC value) AIC = 2k − 2ln(ˆL) (5) where k is number of model parameters. ˆL is an estimate value of likelihood. 3 Hypothesis test We have two or more different classes of signals. Each class is modeled with a specific model. For a new un- known signal. We need to determine which class it belongs to. The idea is to calculate likelihood (probability) of this signal given models of all classes and select most probable class (Max likelihood value). For unknown signal x with N class data calculate f1(x|Model1), f2(x|Model2), f3(x|Model3) , . . . , fN (x|ModelN ) signal x belongs to class with maximum likelihood value. 4 Demo This is a simple example that demonstrates how to estimate different models for your signal, select on of estimated models based on its AIC value, and apply hypothesis test to determine the class of unknown signal using predefined models. So steps are • Model estimation • Model selection • Hypothesis test 3
  • 4. 1 c l o s e a l l 2 clc , c l e a r 3 %% Load EEG Dataset 4 % t h i s i s a motor imagery dataset . We have two c l a s s e s . 5 % Class 1 where subject imagines moving h i s r i g h t arm . 6 % Class 2 where subject imagines moving h i s l e f t arm . 7 % There i s d i f f e r e n t EEG channels C3 , C4 and Cz 8 % We w i l l s e l e c t only one of them . 9 load ( ’ dataset BCIcomp1 . mat ’ ) 10 11 % We w i l l use f i r s t Channel from c l a s s 1 12 % Note : detrend −> makes the s i g n a l zero mean 13 dataClass1 = detrend ( x t r a i n (500:800 ,1 ,1) ) ; 14 %f i r s t Channel from c l a s s 2 15 dataClass2 = detrend ( x t r a i n (500:800 ,1 ,2) ) ; 16 data = [ dataClass1 , dataClass2 ] ; 17 %Test data from c l a s s 1 18 testData = detrend ( x t r a i n (801:1000 ,1 ,1) ) ; 19 20 % Empty c e l l array to be updated with s e l e c t e d models f o r both c l a s s 1 and 2 21 selectedModels = c e l l (2 ,1) ; 22 %% [ 1 ] Models Estimation 23 % MA(2) , AR(2) , ARMA(1 ,2) Models 24 % We have two c l a s s e s so we w i l l estimate models and s e l e c t one f o r each c l a s s . 25 f o r i = 1:2 26 [ model MA2 , ˜ , logL MA2 ] = estimate ( arima (0 ,0 ,2) , data ( : , i ) ) ; 27 [ model AR2 , ˜ , logL AR2 ] = estimate ( arima (2 ,0 ,0) , data ( : , i ) ) ; 28 [ model ARMA12 , ˜ , logL ARMA12 ] = estimate ( arima (1 ,0 ,2) , data ( : , i ) ) ; 29 models = {model MA2 , model AR2 , model ARMA12 }; 30 31 %% [ 2 ] Model S e l e c t i o n based on AIC value 32 %Calculte Akiak ’ s information c r i t e r i a f o r a l l models 33 aic MA2 = 2∗2 − 2∗logL MA2 ; 34 aic AR2 = 2∗2 − 2∗logL AR2 ; 35 aic ARMA12 = 2∗3 − 2∗logL ARMA12 ; 36 37 % S e l e c t model with minimum a i c 38 [ ˜ , idx ] = min ( [ aic MA2 , aic AR2 , aic ARMA12 ] ) ; 39 % Update s e l e c t e d models 40 selectedModels { i } = models{ idx }; 41 end 42 43 % I n i t i a l i z e an array to be updated with l i k e l i h o o d values f o r each c l a s s 44 l i k e l i h o o d V a l s = zeros (1 ,2) ; 45 %% [ 3 ] Hypothesis t e s t 46 f o r i = 1:2 47 % Calculate l i k e l i h o o d estimate f o r testData using s e l e c t e d model of each 48 % c l a s s 49 [ ˜ , ˜ , logL ] = estimate ( selectedModels { i } , testData ) ; 50 l i k e l i h o o d V a l s ( i ) = logL ; 51 end 52 %S e l e c t c l a s s with maximum l i k e l i h o o d value 53 [ ˜ , testDataClass ] = max( l i k e l i h o o d V a l s ) ; 54 display ( testDataClass ) Listing 1: Section Demo You can download section demo from repository 5 Useful links • System Identification Toolbox examples • Different Model estimation methods • estimate function 4