Assessing inter-annual and seasonal variability Least square fitting with Matlab: Application to SSTs in the vicinity of Cape Town

Similar documents
Statistics MINITAB - Lab 2

Chapter 9: Statistical Inference and the Relationship between Two Variables

Introduction to Regression

17 - LINEAR REGRESSION II

is the calculated value of the dependent variable at point i. The best parameters have values that minimize the squares of the errors

Statistics for Economics & Business

Chapter 3. Two-Variable Regression Model: The Problem of Estimation

Regression Analysis. Regression Analysis

Statistics for Managers Using Microsoft Excel/SPSS Chapter 13 The Simple Linear Regression Model and Correlation

Department of Quantitative Methods & Information Systems. Time Series and Their Components QMIS 320. Chapter 6

2016 Wiley. Study Session 2: Ethical and Professional Standards Application

Chapter 12 Analysis of Covariance

Chapter 2 - The Simple Linear Regression Model S =0. e i is a random error. S β2 β. This is a minimization problem. Solution is a calculus exercise.

Linear Feature Engineering 11

Chapter 11: Simple Linear Regression and Correlation

T E C O L O T E R E S E A R C H, I N C.

The Ordinary Least Squares (OLS) Estimator

Feb 14: Spatial analysis of data fields

STAT 3340 Assignment 1 solutions. 1. Find the equation of the line which passes through the points (1,1) and (4,5).

STAT 3008 Applied Regression Analysis

Generalized Linear Methods

Comparison of Regression Lines

Dr. Shalabh Department of Mathematics and Statistics Indian Institute of Technology Kanpur

Learning Objectives for Chapter 11

Lecture 16 Statistical Analysis in Biomaterials Research (Part II)

Statistics for Business and Economics

RELIABILITY ASSESSMENT

e i is a random error

Turbulence classification of load data by the frequency and severity of wind gusts. Oscar Moñux, DEWI GmbH Kevin Bleibler, DEWI GmbH

JAB Chain. Long-tail claims development. ASTIN - September 2005 B.Verdier A. Klinger

), it produces a response (output function g (x)

Invariant deformation parameters from GPS permanent networks using stochastic interpolation

Some basic statistics and curve fitting techniques

β0 + β1xi. You are interested in estimating the unknown parameters β

Y = β 0 + β 1 X 1 + β 2 X β k X k + ε

LINEAR REGRESSION ANALYSIS. MODULE IX Lecture Multicollinearity

Lecture 6: Introduction to Linear Regression

Polynomial Regression Models

where I = (n x n) diagonal identity matrix with diagonal elements = 1 and off-diagonal elements = 0; and σ 2 e = variance of (Y X).

Development of a Semi-Automated Approach for Regional Corrector Surface Modeling in GPS-Levelling

Chapter 14 Simple Linear Regression

Basic Business Statistics, 10/e

Chapter 14 Simple Linear Regression Page 1. Introduction to regression analysis 14-2

18. SIMPLE LINEAR REGRESSION III

Lecture Notes for STATISTICAL METHODS FOR BUSINESS II BMGT 212. Chapters 14, 15 & 16. Professor Ahmadi, Ph.D. Department of Management

Chapter 13: Multiple Regression

ISQS 6348 Final Open notes, no books. Points out of 100 in parentheses. Y 1 ε 2

/ n ) are compared. The logic is: if the two

3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X

Statistical Evaluation of WATFLOOD

UNIVERSITY OF TORONTO Faculty of Arts and Science. December 2005 Examinations STA437H1F/STA1005HF. Duration - 3 hours

Global Sensitivity. Tuesday 20 th February, 2018

Topic 7: Analysis of Variance

Negative Binomial Regression

8/25/17. Data Modeling. Data Modeling. Data Modeling. Patrice Koehl Department of Biological Sciences National University of Singapore

Correlation and Regression. Correlation 9.1. Correlation. Chapter 9

Psychology 282 Lecture #24 Outline Regression Diagnostics: Outliers

28. SIMPLE LINEAR REGRESSION III

Singular Value Decomposition: Theory and Applications

Biostatistics. Chapter 11 Simple Linear Correlation and Regression. Jing Li

w ). Then use the Cauchy-Schwartz inequality ( v w v w ).] = in R 4. Can you find a vector u 4 in R 4 such that the

p 1 c 2 + p 2 c 2 + p 3 c p m c 2

[The following data appear in Wooldridge Q2.3.] The table below contains the ACT score and college GPA for eight college students.

Numerical Heat and Mass Transfer

MACHINE APPLIED MACHINE LEARNING LEARNING. Gaussian Mixture Regression

Cathy Walker March 5, 2010

GEMINI GEneric Multimedia INdexIng

U.C. Berkeley CS294: Beyond Worst-Case Analysis Luca Trevisan September 5, 2017

Important Instructions to the Examiners:

Lecture 9: Linear regression: centering, hypothesis testing, multiple covariates, and confounding

arxiv:cs.cv/ Jun 2000

First Year Examination Department of Statistics, University of Florida

Durban Watson for Testing the Lack-of-Fit of Polynomial Regression Models without Replications

BIO Lab 2: TWO-LEVEL NORMAL MODELS with school children popularity data

ELASTIC WAVE PROPAGATION IN A CONTINUOUS MEDIUM

Testing for seasonal unit roots in heterogeneous panels

β0 + β1xi. You are interested in estimating the unknown parameters β

Lecture 9: Linear regression: centering, hypothesis testing, multiple covariates, and confounding

Introduction to Analysis of Variance (ANOVA) Part 1

Spatial Statistics and Analysis Methods (for GEOG 104 class).

Econ107 Applied Econometrics Topic 3: Classical Model (Studenmund, Chapter 4)

Cluster Validation Determining Number of Clusters. Umut ORHAN, PhD.

The Geometry of Logit and Probit

Module 9. Lecture 6. Duality in Assignment Problems

IV. Modeling a Mean: Simple Linear Regression

Reduced slides. Introduction to Analysis of Variance (ANOVA) Part 1. Single factor

Week3, Chapter 4. Position and Displacement. Motion in Two Dimensions. Instantaneous Velocity. Average Velocity

= = = (a) Use the MATLAB command rref to solve the system. (b) Let A be the coefficient matrix and B be the right-hand side of the system.

Linear Regression Analysis: Terminology and Notation

829. An adaptive method for inertia force identification in cantilever under moving mass

Numerical Methods. ME Mechanical Lab I. Mechanical Engineering ME Lab I

Feature Selection: Part 1

Quantum Mechanics for Scientists and Engineers. David Miller

Linear Approximation with Regularization and Moving Least Squares

SIMPLE LINEAR REGRESSION

Lecture Notes on Linear Regression

A new Approach for Solving Linear Ordinary Differential Equations

Chapter 15 Student Lecture Notes 15-1

NUMERICAL DIFFERENTIATION

THE ROYAL STATISTICAL SOCIETY 2006 EXAMINATIONS SOLUTIONS HIGHER CERTIFICATE

Transcription:

Assessng nter-annual and seasonal varablty Least square fttng wth Matlab: Applcaton to SSTs n the vcnty of Cape Town Francos Dufos Department of Oceanography/ MARE nsttute Unversty of Cape Town

Introducton 1- Whch data are we usng? 2- What can we do wth SST tme seres (examples n False Bay)... 3- Least square fttng 3-1- Lnear least square fttng 3-2- Non lnear least square fttng 4- How to evaluate models?

1- Whch data are we usng? Monthly SST tme seres Pathfnder (from 1981) Long seres Resoluton (tme, space) http://www.nodc.noaa.gov/sog/pathfnder4km/usergude.html M atlab fle: SST_Pathfnder_1D.mat, SST a poston 16W 40S M ODIS TERRA (from 2000) Spatal resoluton Short seres http://www.afro-sea.org.za/ M atlab fles: SST_upwellng_1D.mat, SST a poston 18W 34.2S SST_FalseBay_1D.mat, SST a poston 18.6W 34.2S SST_CapePennsula_3D.mat, SST around Cape Town tme s n day n Matlab fles: datestr(tme) gves you the date n a readable format... SEVIRI (from 2004) Temporal resoluton Spatal resoluton, flags, short seres

2- Examples of analyss Fast Fourer Transform: decomposes a sequence of values nto components of dfferent frequences. performed usng Sevr data (1h resoluton data) functon fft n matlab + (trcky!!!)

2- Examples of analyss Wavelet: to see how the strength of the key temporal varablty changes over tme. Wavelet transforms a one-dmensonal tme seres to a two-dmensonal mage that portrays the evoluton of scales and frequences wth tme. Very user-frendly matlab packages, wth wavelet coherence as well: http://www.pol.ac.uk/home/research/waveletcoherence/

2- Examples of analyss Emprcal Orthonormal Functon: explans the varance wth the smallest possble number of modes Bascally, the frst EOF s the pattern that represents the most varablty Intra-annual varablty/seasonalty s the frst mode when lookng at EOF decomposton on SST absolute values... 1- Seasonalty needs to be assessed... 2- When usng EOF to assess nter-annual varablty, seasonal cycle has to be removed by usng anomales to the clmatology User-frendly matlab packages? http://www.mathworks.com/matlabcentral/

2- Examples of analyss Emprcal Orthonormal Functon (on SST anomales) to answer : What are the domnant modes of the nter-annual varablty? Usng 3-monthly runnng mean of SST from TERRA

2- Example of analyss Composte: a good way to look at the patterns of anomales for specfc perods Anomaly durng La Nña ( 2000/2001/2008 ) Mean SST durng summer Anomaly durng El Nño ( 2003/05/08/10 )

3- Least square fttng How to assess the seasonalty? We need to fnd a model for the monthly SST tme seres... All models are wrong, but some are useful George E.P. Box We need to : 1- Identfy a useful model 2- Fnd the parameters of the model (wth a least square fttng) 3- Evaluate the model

3- Least square fttng Prncple of the least square fttng: y s the measured value at the tme step (N tme step n total) yˆ s the modeled value at the same tme step Measure = model y yˆ +resdual We want to fnd a model dependant on an explanatory varable (x ) by mnmsng the sum of the squared resduals: SS N 1 The basc dea of any least square ft s to fnd the model whch mnmzes the sum of the vertcal dstances squared between all data pont and the least square model. 2

response varable (e.g. SST) 3-1- Lnear least square fttng Lnear least square fttng or lnear regresson y ax b ˆ model ( yˆ ) measure (y ) explanatory varable (e.g. tme) An analytcal soluton exsts for the lnear regresson: 2 2 y x 1/ n y x a b y ax x 1/ n x

3-1- Lnear least square fttng Example: How to fnd the temperature trend on Pathfnder tme seres In Matlab we can use operator \ or functon polyft... %% LOAD fle load( SST_Pathfnder_1D.mat ) %% Remove bad values (-1) tme(sst==-1)=[]; sst(sst==-1)=[]; %% Lnear Least square fttng % frst method [a]=polyft(tme,sst,1); %2 nd method [a1]=[tme ones(length(sst),1)]\sst;

3-2- Non lnear least square fttng If the model that we want to ft s not just a straght lne, we have to mnmze SS N 1 2 on our own... Example: How to assess the seasonalty of an SST MODIS tme seres... We chose the followng model: SST=mean(SST)+A*cos(2π/T*(tme-wd)) We need to fnd: wth T=365 days A=ampltude of the seasonal cycle wd=warmer day of the year

3-2- Non lnear least square fttng We can use Matlab functon fmnsearch for ths purpose: FMINSEARCH Multdmensonal unconstraned nonlnear mnmzaton (Nelder-Mead). X = FMINSEARCH(FUN,X0) starts at X0 and attempts to fnd a local mnmzer X of the functon FUN. FUN s a functon handle. FUN accepts nput X and returns a scalar functon value F evaluated at X. X0 can be a scalar, vector or matrx. Man program: global sst tme f1 f1=1/365.2523; a0=10;%ampltude close to the soluton wd0=0; %warmer day close to the soluton parameters=... fmnsearch( SquaredResdualSum',[a0 wd0]); A=parameters(1); wd=parameters(2); Functon: functon SS=... SquaredResdualSum(parameters) global sst tme f1 A=parameters(1); wd=parameters(2); sst_model=a*cos(2*p*f1*(tme-wd)); SS=sum((sst_model-sst).^2);

3-2- Non lnear least square fttng What does the seasonal cycle look lke wthn False Bay? SST(TERRA)=mean(SST)+A*cos(2π/T*(tme-wd)) wth T=365 days usefularesomebut, wrongaremodelsall George E.P. Box How good s our model?

4- How to evaluate models? Several ndex can help evaluatng a model, and among them: Correlaton Coeffcent (COR), the Bas, the Root Mean Square Error (RMSE) and the Relatve Root Mean Square Error also called Scatter Index (SI). y y If s the measured value at the tme step, the modeled value at the same tme step, and are respectvely ther mean for the N tme step, then we have : ŷ y ˆ SI N 1 ( yˆ y ) N 1 BIAS yˆ y y 2 2 COR RMSE N 1 ( y y)( yˆ yˆ) N N 2 2 ( y ) ( ˆ ˆ y y y) 1 1 N 1 ( yˆ y ) N 2

4- How to evaluate models? For ths knd of applcaton, a good ndex s the correlaton coeffcent... R 2 2 yˆ COR var( ) var( y) provde a clear budget of how much of the total varance can be explaned by the model

4- How to evaluate models? The model could also smply be the clmatology Is the clmatology representatve n ths regon? Varance of the monthly SST(TERRA) explaned (%) by the seasonal cycle/monthly clmatology

5- Practcal 1- Compute the lnear trend of Pathfnder SST south of Cape Town at lattude 40S and longtude 16W (usng SST_Pathfnder_1D.mat) 2- Fnd warmer day and ampltude of a snusodal seasonal model (a*cos(wt+ph)) n False Bay (SST_FalseBay_1D.mat) and west of Cape Town n the upwellng (SST_upwellng_1D.mat). Whch part of the total varance s explaned by the model? 3- Compute mean SST, warmer day and ampltude of the seasonal cycle, and R 2 n the vcnty of Cape Town usng the 3D fle (tme,lat,lon) SST_CapePennsula_3D.mat.