Outline. Third Programming Project Two-Dimensional Arrays. Files You Can Download. Exercise 8 Linear Regression. General Regression

Similar documents
Solutions to Programming Assignment Five Interpolation and Numerical Differentiation

Programming Assignment Six. Semester Calendar. 1D Excel Worksheet Arrays. Review VBA Arrays from Excel. Programming Assignment Six May 2, 2017

Optimization Methods: Integer Programming Integer Linear Programming 1. Module 7 Lecture Notes 1. Integer Linear Programming

LOOP ANALYSIS. The second systematic technique to determine all currents and voltages in a circuit

Programming in Fortran 90 : 2017/2018

Support Vector Machines

OPL: a modelling language

THE PHYSICS 23 LAB BOOK 23 Lab 03: Conservation of Linear Momentum

KFUPM. SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture (Term 101) Section 04. Read

Machine Learning 9. week

Pattern Classification of Back-Propagation Algorithm Using Exclusive Connecting Network

Generating Fuzzy Term Sets for Software Project Attributes using and Real Coded Genetic Algorithms

Support Vector Machines. CS534 - Machine Learning

Polyhedral Compilation Foundations

Gaussian elimination. System of Linear Equations. Gaussian elimination. System of Linear Equations

User Behavior Recognition based on Clustering for the Smart Home

LU Decomposition Method Jamie Trahan, Autar Kaw, Kevin Martin University of South Florida United States of America

Measuring Cohesion of Packages in Ada95

Compiler Design. Spring Register Allocation. Sample Exercises and Solutions. Prof. Pedro C. Diniz

2x x l. Module 3: Element Properties Lecture 4: Lagrange and Serendipity Elements

Human Face Recognition Using Radial Basis Function Neural Network

AMath 483/583 Lecture 21 May 13, Notes: Notes: Jacobi iteration. Notes: Jacobi with OpenMP coarse grain

Hermite Splines in Lie Groups as Products of Geodesics

Alternating Minimization Multigrid Algorithms for Transmission Tomography

A New Approach For the Ranking of Fuzzy Sets With Different Heights

Lecture #15 Lecture Notes

Exercises (Part 4) Introduction to R UCLA/CCPR. John Fox, February 2005

Sum of Linear and Fractional Multiobjective Programming Problem under Fuzzy Rules Constraints

Multiple Instance Learning via Multiple Kernel Learning *

Low training strength high capacity classifiers for accurate ensembles using Walsh Coefficients

Outline. Midterm Review. Declaring Variables. Main Variable Data Types. Symbolic Constants. Arithmetic Operators. Midterm Review March 24, 2014

LECTURE NOTES Duality Theory, Sensitivity Analysis, and Parametric Programming

Determination of Body Sway Area by Fourier Analysis of its Contour

LESSON 15: BODE PLOTS OF TRANSFER FUNCTIONS

Pose Invariant Face Recognition using Hybrid DWT-DCT Frequency Features with Support Vector Machines

On-line Scheduling Algorithm with Precedence Constraint in Embeded Real-time System

Radial Basis Functions

An Efficient Fault-Tolerant Multi-Bus Data Scheduling Algorithm Based on Replication and Deallocation

Biostatistics 615/815

News. Recap: While Loop Example. Reading. Recap: Do Loop Example. Recap: For Loop Example

What is Object Detection? Face Detection using AdaBoost. Detection as Classification. Principle of Boosting (Schapire 90)

Parallel Numerics. 1 Preconditioning & Iterative Solvers (From 2016)

Design for Reliability: Case Studies in Manufacturing Process Synthesis

A Bayesian Mixture Model for Multi-view Face Alignment

AP PHYSICS B 2008 SCORING GUIDELINES

Large Margin Nearest Neighbor Classifiers

NAG Fortran Library Chapter Introduction. G10 Smoothing in Statistics

Introduction to Geometrical Optics - a 2D ray tracing Excel model for spherical mirrors - Part 2

A NEW APPROACH FOR SOLVING LINEAR FUZZY FRACTIONAL TRANSPORTATION PROBLEM

TN348: Openlab Module - Colocalization

UrbaWind, a Computational Fluid Dynamics tool to predict wind resource in urban area

Problem Set 3 Solutions

NUMERICAL SOLVING OPTIMAL CONTROL PROBLEMS BY THE METHOD OF VARIATIONS

Introduction. Leslie Lamports Time, Clocks & the Ordering of Events in a Distributed System. Overview. Introduction Concepts: Time

Realistic 3D Face Modeling by Fusing Multiple 2D Images

CMPS 10 Introduction to Computer Science Lecture Notes

RESISTIVE CIRCUITS MULTI NODE/LOOP CIRCUIT ANALYSIS

ELEC 377 Operating Systems. Week 6 Class 3

Handwritten English Character Recognition Using Logistic Regression and Neural Network

Motivation. Matching, Alignment, and Registration. Components in Matching. Image Alignment

Aircraft Engine Gas Path Fault Diagnosis Based on Fuzzy Inference

Modeling and Solving Nontraditional Optimization Problems Session 2a: Conic Constraints

A Fast Dictionary Learning Algorithm for Image Denoising Hai-yang LI *, Chao YUAN and Heng-yuan WANG

LOOP ANALYSIS. determine all currents and Voltages in IT IS DUAL TO NODE ANALYSIS - IT FIRST DETERMINES ALL CURRENTS IN A CIRCUIT

Harmonic Coordinates for Character Articulation PIXAR

Support Vector Machines

X- Chart Using ANOM Approach

ECONOMICS 452* -- Stata 11 Tutorial 6. Stata 11 Tutorial 6. TOPIC: Representing Multi-Category Categorical Variables with Dummy Variable Regressors

EXTENDED FORMAL SPECIFICATIONS OF 3D SPATIAL DATA TYPES

The BGLR (Bayesian Generalized Linear Regression) R- Package. Gustavo de los Campos, Amit Pataki & Paulino Pérez. (August- 2013)

AN ALGORITHM FOR ODD GRACEFULNESS OF THE TENSOR PRODUCT OF TWO LINE GRAPHS

y and the total sum of

A Simple and Efficient Goal Programming Model for Computing of Fuzzy Linear Regression Parameters with Considering Outliers

RESEARCH ON CLOSE-RANGE PHOTOGRAMMETRY WITH BIG ROTATION ANGLE

The Go4 Analysis Framework Fit Tutorial v2.2

Lecture 4: Principal components

Virtual Memory. Background. No. 10. Virtual Memory: concept. Logical Memory Space (review) Demand Paging(1) Virtual Memory

Multi-stable Perception. Necker Cube

The ray density estimation of a CT system by a supervised learning algorithm

Intra-Parametric Analysis of a Fuzzy MOLP

Adaptive Transfer Learning

STATIC MAPPING FOR OPENCL WORKLOADS IN HETEROGENEOUS COMPUTER SYSTEMS

SVM-based Learning for Multiple Model Estimation

Quality Improvement Algorithm for Tetrahedral Mesh Based on Optimal Delaunay Triangulation

Analysis of Continuous Beams in General

Mathematics 256 a course in differential equations for engineering students

Poly-energetic Reconstructions in X-ray CT Scanners

Nachos Project 3. Speaker: Sheng-Wei Cheng 2010/12/16

An Application of LFP Method for Sintering Ore Ratio

Subdividing Barycentric Coordinates

CURVE FITTING AND DATA REGRESSION

ECONOMICS 452* -- Stata 12 Tutorial 6. Stata 12 Tutorial 6. TOPIC: Representing Multi-Category Categorical Variables with Dummy Variable Regressors

Evaluation of Fuzzy Labor Market by Fuzzy Neural Network


A New Scheduling Algorithm for Servers

Modeling of the Absorption of the Electromagnetic Wave Energy in the Human Head Induced by Cell Phone

Loop Transformations, Dependences, and Parallelization

Sequential search. Building Java Programs Chapter 13. Sequential search. Sequential search

Proper Choice of Data Used for the Estimation of Datum Transformation Parameters

Assignment # 2. Farrukh Jabeen Algorithms 510 Assignment #2 Due Date: June 15, 2009.

Transcription:

Project 3 Two-densonal arras Ma 9, 6 Thrd Prograng Project Two-Densonal Arras Larr Caretto Coputer Scence 6 Coputng n Engneerng and Scence Ma 9, 6 Outlne Quz three on Thursda for full lab perod See saple quz on hoe page of course web ste Project three Multlnear regresson Equatons to be solved Data structures to be used Lbrar progra use n separate code fle Fles You Can Download Eercse 8 Lnear Regresson Project nstructons on hoe page and projects page Other fles on projects page onl Data fle for project Lbrar progra for solvng sultaneous lnear equatons Ecel fle wth answers Ths lecture on hoe page and laborator presentatons page Ft lnear relatonshp to easured data pars (, ) a + b Have equatons to deterne a and b Get goodness-offt easures ŷ Ftted Lne ndcates data ponts Ftted value at s ŷ a + b 3 4 Project Three Regresson Have a result that depends on ore than one varable Eaple s essons fro desel engne that depends on fuel propertes essons b + b (cetane) + b (aroatcs) + b 3 (denst) Use easured data on essons, cetane, aroatcs to fnd b, b, b, b 3 General Regresson Use notaton so that we can wrte code for an nuber of predctve varables Call predctve varables,, 3, etc. Call response varable In prevous eaple, cetane, aroatcs, 3 denst, and essons For three varables the equaton s b + b + b + b 3 3 5 6

Project 3 Two-densonal arras Ma 9, 6 General Equaton and Data Data Set wth 3 and 8 In general we can have predctve varables, to k General odel equaton: b b + j j How do we represent the data? j Each data set conssts of one value of and one value for each of the j varables For data set, we can call the value of,, and we can call the value of j for data set j 7 3.55 3. 44 5.95 3.47 35 4.89 3.4 44 54 3.4 3.46 35 37 4.3 3.59 45 48 5.74.75 3 6.87 3.3 3 47 7.83 3.8 9 4 Each data set,, has a value for and each j 35 What are 4, 3, 3? 8 Suar of Data We use dfferent varables ( to ) to predct the value of another varable, We have sets of data nubered fro to - each data set has one value of, called, and one value of each j, called j all and values fro fle nput all data used to deterne b to b How do we fnd b j? Defne for all,..., - ote that there s no n odel Settng used to splf equatons Values of b,..., b found b solvng set of + sultaneous lnear equatons A b + A b + A b +...+ A b c Copute A j and c fro nput data Use lbrar progra to solve equatons 9 Equatons to be Used Copute the A j coeffcents Aj Copute the c coeffcents Use the lbrar routne provded to solve for b j c j j Aj bj c,, Coputng one A[][j] (A[][]) 3.55 3. 44 5.95 3.47 35 4.89 3.4 44 54 3.4 3.46 35 37 4.3 3.59 45 48 5.74.75 3 6.87 3.3 3 47 7.83 3.8 9 4 Aj j A + + 3 3 + 4 4 + 5 5 + 6 6 + 6 6 + 7 7 A

Project 3 Two-densonal arras Ma 9, 6 Coputng A[][] A[][] Coputng A[][] A[][] 3.55 3. 44 5.95 3.47 35 4.89 3.4 44 54 3.4 3.46 35 37 4.3 3.59 45 48 5.74.75 3 6.87 3.3 3 47 7.83 3.8 9 4 A A A (3.)(44) + (3.47)(35) + (3.4)(44) + (3.46)(35) + (3.59)(45) + 3.55 3. 44 5.95 3.47 35 4.89 3.4 44 54 3.4 3.46 35 37 4.3 3.59 45 48 5.74.75 3 6.87 3.3 3 47 7.83 3.8 9 4 A A (3.)(44) + (3.47)(35) + (3.4)(44) + (3.46)(35) + (3.59)(45) + (.75)() + (3.3)(3) + (3.8)(9) 3 4 Coputng one c[] c[] More Equatons to be Used 3.55 3. 44 5.95 3.47 35 4.89 3.4 44 54 3.4 3.46 35 37 4.3 3.59 45 48 5.74.75 3 6.87 3.3 3 47 7.83 3.8 9 4 c c + + 3 3 + 4 4 + 5 5 + 6 6 + 6 6 + 7 7 (3.)(.55) + 5 Copute estated values ˆ Copute the R value R b + ( j b j ˆ ) j ( ) 6 Requred Code Steps Input data on,,, and j Set each Copute A j and c (as A[][j] and c[]) Use lbrar progra that takes A j and c as nputs and returns soluton for b j Use b j to copute predcted values: ŷ Copute R and output results Gettng the Input Data Download data fle fro course web ste Data on fle start wth value of followed b sets of data Each data set starts wth followed b,, 3, etc. Can odf eercse eght nput functon Deterne b end of fle condton Reeber to set 7 8 3

Project 3 Two-densonal arras Ma 9, 6 Arras for Coputng A j and c Aj j c A j s D arra wth both densons at least the nuber of varables plus two c s D arra wth sae denson as A j s D arra wth dfferent densons Frst s the nuber of varables plus one Second s au data ponts s D arra; denson s au data ponts Code for Coputng A[][j] Aj j Use tpcal code for coputng a su A[][j] + [][] * [j][] What s the for loop for ths su? for ( ; < ; ++ ) How do we copute all the A[][j]? We need to place the coputaton of one A[][j] nsde two for loops over and j 9 Lbrar Functon to Get b j j a j j b,, Code varables use tpcal notaton for sste of lnear equatons shown above a j are left-hand sde coeffcents b are rght-hand-sde coeffcents j are unknowns There are equatons to be solved Lbrar Functon Defnton Functon prototpe (second denson requred for passng D arras to functons) bool GaussanEl( double a[][max_var], double b[], double [], nt _eqn ); a[][max_var] s left-hand sde arra (a j ) b[] s rght hand sde arra (b ) [] s unknown arra ( j ) _eqn s the nuber of equatons () Usng bool GaussanEl Functon returns an error flag n the functon nae True ndcates an error False ndcates a vald soluton f ( GaussanEl( A, c, b, + ) ) { cout << o soluton for b[j] ; return EXIT_FAILURE; } // reander of code 3 Copare prototpe and call Prototpe bool GaussanEl( double a[][max_var], double b[], double [], nt _eqn ); Rght-sde uber of Left-sde Unknowns equatons f ( GaussanEl( A, c, b, + ) ) { cout << o soluton for b[j] ; return EXIT_FAILURE; } 4 4

Project 3 Two-densonal arras Ma 9, 6 Passng the Second Denson Project Three Code Suar Use two fles: our code and the lbrar progra Place prototpe for lbrar progra n our code Make sure that the second denson for a[][j] (or A[][j]) s the sae for three cases The header n the lbrar progra The prototpe n our code Your declaraton of the A[][j] arra Input data on,,, and j Set each Copute A j and c Use lbrar progra that takes A j and c as nputs and returns soluton for b j Use b j to copute predcted values: ŷ Copute R and output results 5 6 5