Nonlinear Estimation1 Formulas A formula is a (possibly) nonlinear mathematical relationship. A SERIES is a vector of numbers Formulas versus SET: –You.

Slides:



Advertisements
Similar presentations
1 Regression as Moment Structure. 2 Regression Equation Y =  X + v Observable Variables Y z = X Moment matrix  YY  YX  =  YX  XX Moment structure.
Advertisements

Brief introduction on Logistic Regression
GENERAL LINEAR MODELS: Estimation algorithms
Markov Decision Process
Part 17: Nonlinear Regression 17-1/26 Econometrics I Professor William Greene Stern School of Business Department of Economics.
1 12. Principles of Parameter Estimation The purpose of this lecture is to illustrate the usefulness of the various concepts introduced and studied in.
FTP Biostatistics II Model parameter estimations: Confronting models with measurements.
Simple Regression. Major Questions Given an economic model involving a relationship between two economic variables, how do we go about specifying the.
Visual Recognition Tutorial
Forecasting JY Le Boudec 1. Contents 1.What is forecasting ? 2.Linear Regression 3.Avoiding Overfitting 4.Differencing 5.ARMA models 6.Sparse ARMA models.
Maximum likelihood (ML) and likelihood ratio (LR) test
Maximum likelihood Conditional distribution and likelihood Maximum likelihood estimations Information in the data and likelihood Observed and Fisher’s.
General Linear Least-Squares and Nonlinear Regression
Maximum likelihood (ML) and likelihood ratio (LR) test
© John M. Abowd 2005, all rights reserved Statistical Tools for Data Integration John M. Abowd April 2005.
Nonlinear Regression Probability and Statistics Boris Gervits.
Lecture 5 Curve fitting by iterative approaches MARINE QB III MARINE QB III Modelling Aquatic Rates In Natural Ecosystems BIOL471 © 2001 School of Biological.
Linear and generalised linear models
Estimating a VAR After making the necessary data transformations, you must define the equations to use in the VAR. Typically, you will use the following.
Linear and generalised linear models
Basics of regression analysis
Linear and generalised linear models Purpose of linear models Least-squares solution for linear models Analysis of diagnostics Exponential family and generalised.
Maximum likelihood (ML)
Christopher Dougherty EC220 - Introduction to econometrics (chapter 4) Slideshow: nonlinear regression Original citation: Dougherty, C. (2012) EC220 -
Non-Linear Simultaneous Equations
Lecture 3-2 Summarizing Relationships among variables ©
Least-Squares Regression
Applied Discrete Mathematics Week 9: Relations
Chapter 19 Linear Programming McGraw-Hill/Irwin
Chapter 6 Finding the Roots of Equations
Model Inference and Averaging
Non-Linear Models. Non-Linear Growth models many models cannot be transformed into a linear model The Mechanistic Growth Model Equation: or (ignoring.
Branching Instructions1 Conditional Statements There are two forms of the IF instruction %if(x,y,z) –if condition x is true, then y, else z –Example: SET.
R. Kass/W03P416/Lecture 7 1 Lecture 7 Some Advanced Topics using Propagation of Errors and Least Squares Fitting Error on the mean (review from Lecture.
SECOND-ORDER DIFFERENTIAL EQUATIONS Series Solutions SECOND-ORDER DIFFERENTIAL EQUATIONS In this section, we will learn how to solve: Certain.
Non-Linear Models. Non-Linear Growth models many models cannot be transformed into a linear model The Mechanistic Growth Model Equation: or (ignoring.
Pure Serial Correlation
Linear Programming McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
Various topics Petter Mostad Overview Epidemiology Study types / data types Econometrics Time series data More about sampling –Estimation.
FORECASTING. Minimum Mean Square Error Forecasting.
Lecture 4: Statistics Review II Date: 9/5/02  Hypothesis tests: power  Estimation: likelihood, moment estimation, least square  Statistical properties.
PROBABILITY AND STATISTICS FOR ENGINEERING Hossein Sameti Department of Computer Engineering Sharif University of Technology Principles of Parameter Estimation.
Numerical Methods.
A comparison between PROC NLP and PROC OPTMODEL Optimization Algorithm Chin Hwa Tan December 3, 2008.
LINREG linreg(options) depvar start end residuals # list where: depvar The dependent variable. start endThe range to use in the regression. The default.
Data Modeling Patrice Koehl Department of Biological Sciences National University of Singapore
Non-Linear Models. Non-Linear Growth models many models cannot be transformed into a linear model The Mechanistic Growth Model Equation: or (ignoring.
KNN Ch. 3 Diagnostics and Remedial Measures Applied Regression Analysis BUSI 6220.
1 NONLINEAR REGRESSION Suppose you believe that a variable Y depends on a variable X according to the relationship shown and you wish to obtain estimates.
Linear Systems Numerical Methods. 2 Jacobi Iterative Method Choose an initial guess (i.e. all zeros) and Iterate until the equality is satisfied. No guarantee.
ESTIMATION METHODS We know how to calculate confidence intervals for estimates of  and  2 Now, we need procedures to calculate  and  2, themselves.
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.
MathematicalMarketing Slide 5.1 OLS Chapter 5: Ordinary Least Square Regression We will be discussing  The Linear Regression Model  Estimation of the.
Computacion Inteligente Least-Square Methods for System Identification.
Maximum Likelihood. Much estimation theory is presented in a rather ad hoc fashion. Minimising squared errors seems a good idea but why not minimise the.
Linear Programming McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
R. Kass/Sp07P416/Lecture 71 More on Least Squares Fit (LSQF) In Lec 5, we discussed how we can fit our data points to a linear function (straight line)
Colorado Center for Astrodynamics Research The University of Colorado 1 STATISTICAL ORBIT DETERMINATION Statistical Interpretation of Least Squares ASEN.
Data Modeling Patrice Koehl Department of Biological Sciences
Chapter 7. Classification and Prediction
12. Principles of Parameter Estimation
Chap 3. The simplex method
Mathematical Foundations of BME Reza Shadmehr
Linear regression Fitting a straight line to observations.
Nonlinear regression.
Simple Linear Regression
Correlation and Regression
Chengyuan Yin School of Mathematics
12. Principles of Parameter Estimation
Pivoting, Perturbation Analysis, Scaling and Equilibration
Presentation transcript:

Nonlinear Estimation1 Formulas A formula is a (possibly) nonlinear mathematical relationship. A SERIES is a vector of numbers Formulas versus SET: –You can use SET to create the variable y as: SET y = 2 +.5*x**2 This creates a new series equal to two plus ½ of the square of x –A FORMULA can be used to express the mathematical relationship: FRML y =  +  x**  No variable is created—the three parameters can now be estimated

Nonlinear Estimation2 NNLS There are 4 statements required for nonlinear least squares: 1.indicate the coefficient to be estimated 2.Create the FRML to estimate 3.Initialize the coefficients 4.NLLS(FRML=name,OPTIONS) depvar start end residuals coeffs Standard Regression Options METHOD=[GAUSS]/SIMPLEX/GENETIC robusterrors iterations = Defined Variables Those of LINREG %FUNCVAL

Nonlinear Estimation3 Example 1 Example 1: Let x and y be series and suppose you want to estimate a, b, and r. nonlin a b r frml z = a + b*x**r compute a =.4, b = -.3, c = 2 nlls(frml=z) y

Nonlinear Estimation4 Since the disturbance term is additive, you cannot simply take the log of each side and estimate the equation using OLS. However, nonlinear least squares allows you to estimate  and  without transforming the variables. In RATS, you use the following structure to estimate a model using nonlinear least squares: NONLIN list of parameters to be estimated FRML formula name the equation to be estimated COMPUTE initial guesses for the parameters NNLS(FRML=formula name) dependent variable For the example at hand, you could use: nonlin alpha beta frml equation_1 y = alpha*x**beta com alpha = 1.0, beta = 0.5 nlls(frml = equation_1) y If the model had the form y t =  x t   t where {  t } is log-normal, it would be appropriate to estimate the regression in logs using LINREG.

Nonlinear Estimation5 NLLS(frml=formula name, other options) depvar start end residuals coeffs where: depvarDependent variable used on the FRML instruction. start endRange to estimate. residuals Series to store the residuals (Optional). coeffsSeries to store the estimated coefficients (Optional). The principal options are: METHOD =[GAUSS]/SIMPLEX/GENETIC. GAUSS requires a twice differential function. USE SIMPLEX if you have convergence problems. It is possible to use SIMPLEX or GENETIC to refine the initial guesses before using GAUSS. iterations = Maximum number of iterations to use. ROBUSTERRORS/As in LINREG, this option calculates a [NOROBUSTERRORS]consistent estimate of the covariance matrix.

Nonlinear Estimation6 Example 2 nonlin a b c frml z =.25*(a*a + b*b)*x{1} + a*sin1 + b*cos1 + c*dx{1} compute a =.4, b = -.3, c = 2 nlls(frml=z) dx Suppose that I want to estimate: dx t = 0.25*  x t-1 + a sin1 t + b cos1 t + c dx t-1 This can be done with LINREG: lin dx # x{1} sin1 cos1 dx{1} But suppose that I want to constrain  to equal a 2 + b 2

Nonlinear Estimation7 Controlling the Estimation NLPAR: You will not need to use NLPAR unless you experience convergence problems or want to obtain more precise numerical answers. Numerical optimization algorithms use iteration routines that cannot guarantee precise solutions for β. NLPAR allows you to select the various criteria RATS uses to determine when (and if) the solution converges. There are two principal options; the syntax is: nlpar(options) CRITERION = In the default mode, CRITERION=COEFFICIENTS. Here, convergence is determined using the change in the numerical value of the coefficients between iterations. Setting CRITERION=VALUE means that convergence is determined using the change in the value of the function being maximized. CVCRIT = Converge is assumed to occur if the change in the COEFFICIENTS or VALUE is less than the number specified. The default is

Nonlinear Estimation8 Examples of NLPAR 1. nlpar(cvcrit=0.0001) Setting CVCRIT= means that RATS will continue to search for the values of the coefficients that maximize f( ) until the change in the coefficients between iterations is not more than nlpar(criterion=value,cvcrit= ) Setting CVCRIT= and CRITERION=VALUE means that RATS will continue to search for the values of the coefficients that maximize f( ) until the change in the value of f( ) between iterations is less than

Nonlinear Estimation9 Maximize Suppose your data set contains T observations of the variables y t and x t and you have used the FRML instruction to define the function: L = f(y t, x t ; β) where: x t and β can be vectors (and x t can represent a lagged value of y t ). MAXIMIZE is able to find the value(s) of β that solve: The syntax and principal options of MAXIMIZE are: maximize(options) frml start end funcval where:frml A previously defined formula start endThe range of the series to use in the estimation funcval(Optional) The series for the computed values of f(y t, x t ; β)

Nonlinear Estimation10 Options for MAXIMIZE The key options for our purposes are: METHOD = RATS is able to use any one of three different algorithms to find the maximum: BFGS, BHHH, or SIMPLEX. The technical details of each maximization algorithm are provided in the RATS manual. Use either the default BFGS method or the BHHH method for twice-differentiable functions and SIMPLEX in other cases. If you have convergence problems with BFGS, try BHHH. Note that SIMPLEX is extremely slow and often requires many iterations. ITERATIONS=The upper limit of the number of iterations used in the maximization. RECURSIVE Use this option if the formula must be solved recursively. It is necessary to use RECURSIVE if the value of the value of f( ) depends on the value of a variable at t-i. Note: You can use TEST and RESTRICT with the BFGS and BHHH options. Coefficients are numbered by their position in the NONLIN statement.

Nonlinear Estimation11 Maximum Likelihood Under the usual normality assumption, the log likelihood of observation t is: With T independent observations: We want to select  and   so as to maximize L

ML II Nonlinear Estimation12 Note that this is the same as maximizing: We want to select  and   so as to maximize L Which we would have obtained by writing the likelihood for obs. t as

Nonlinear Estimation13 Maximum Likelihood in RATS As in NLLS, to use MAXIMIZE, you must first: 1. List the name(s) of the parameters over which RATS is to perform the maximization. This is done using the NONLIN command. 2. Define the likelihood function f( ) using a FRML statement. 3. Set the initial values of the parameters using the COMPUTE command. Consider the following RATS statements used to estimate the linear regression y = a + bx: NONLIN b var FRML L = -log(var) - (y - b*x)**2/var COMPUTE b = initial guess, var = initial guess MAXIMIZE L start end OR, you can use to formulas frml e = y ‑ b*x frml L = ‑ log(var) - e**2/var

Nonlinear Estimation14 Subformulas y t =  t +  1  t-1 Since the {  t } sequence is unobserved, it is not possible to use LINREG or NLLS to estimate the process. To estimate  1 using maximum likelihood techniques, it is necessary to construct a formula of the form  t = y t -  1  t-1. However, the following is an illegal statement because e t is defined in terms of its own lagged value (a nonresolvable recursive expression): frml e = y – b1*e{1} The way to circumvent this problem is to create a “placeholder” series using the SET instruction. Then, define the desired formula in terms of the placeholder series. Finally, use a SUBFORMULA to equate the placeholder and the desired series. For example, a simple way to create the formula for the MA(1) process is: set temp = 0.0 nonlin b1 var frml e = y - b*temp{1} frml L = (temp = e), -log(var) - e**2/var)

Nonlinear Estimation15 Subformulas (cont.) drs t =  1 drs t-1 +  7 drs t-7 +  t +  1  t-1 +  2  t-2 Now, the NONLIN instruction contains the coefficient b2. The first FRML instruction uses temp{1} and temp{2} as placeholders for e t-1 and e t-2. The second FRML instruction creates the desired log likelihood and the COMPUTE instruction provides the initial guesses. Notice that the start date can remain at 9 since no usable observations are lost from the MA terms. set temp = 0. nonlin a1 a7 b1 b2 var frml e = drs - a1*drs{1} - a7*drs{7} - b1*temp{1} - b2*temp{2} frml L = (temp=e), -log(var) - (e)**2/var com a1 = 0.4, a7 = -.3, b1 =.5, b2 = 0.3, var = 1. max L 9 *

Nonlinear Estimation16 The GARCH Likelihood Function

Nonlinear Estimation17 ARMA(1,1)-IGARCH(1,1) set temp = 0. nonlin a0 a1 a2 a3 b0 b1 c1 b0.ge.0. b1.ge.0. c1.ge.0. frml e = spread - a0 - a1*spread{1} - a2*spread{2} - a3*spread{3} frml h = b0 + b1*e{1}**2 + c1*temp{1} frml L = (temp = h), -log(temp) - (e)**2/temp After initializing the parameters with the LINREG and COMPUTE instructions, the first MAXIMIZE instruction refines the initial guesses with the SIMPLEX method. The second obtains the final estimates using to BFGS method: lin(noprint) spread ; # constant spread{1 to 3} com a0 = %beta(1), a1 = %beta(2), a2 = %beta(3), a3 = %beta(4), b0 = %seesq, $ b1 = 0.2, c1 = 0.5 max(method=simplex,iters=5) L 7 * max(iters=200) L 7 *