c++ | assignment代写 | lab | matlab代写 – Estimation & Statistical Testing lab # 0

Estimation & Statistical Testing lab # 0

c++ | assignment代写 | lab | matlab代写 – 这是一个关于c++的题目, 主要考察了关于c++的内容,是一个比较经典的题目, 包括了c++等方面, 这个项目是lab代写的代写题目

lab代写 代写lab

1

Lab # 0 : Numerical computations in C/C++, and data visualization in Matlab

You are given the following mathematical model:

= ^2 + +

where is treated as an observable, is considered a constant (i.e., an errorless coefficient), and , and are the desired unknown parameters. A sample data set (i.e., pairs of and values) is given in Table 1 below:

Table 1: k and y values
k y k y k y

– 1.56 08 – 2.6285 – 0.4 712 5.5303 0.6283 4.

– 1.4137 – 2.0562 – 0.3142 7.04 68 0.786 4 2.62 77

– 1.2566 – 1.7 129 – 0.1571 7.2272 0.9425 1.

– 1.0996 – 0.3 523 0.0000 7.1109 1.0996 – 0.

– 0.9425 1.1526 0.1571 7.7341 1.2566 – 1.

– 0.7854 2.5719 0.3142 6.596 5 1.4137 – 2.

– 0 .6283 4.0459 0.4712 5.277 9 1.5708 – 2.4 057

Perform the following tasks in C/C++:
 Read in  and  from a text file
 Populate design matrix , where each row  of  is [^2  1 ]
 Populate misclosure vector , where each row  of  is []
 Compute the normal equation matrix =
 Compute the normal equation vector =
 Estimate the desired unknown parameters , , and  in the vector =^0 +, where ^0 = 0 ,
and =^1 
 Estimate the vector of residuals =+
 Compute the a-posteriori variance factor (scalar value)  02 =()/(), where  is the
number of observations, and  is the number of unknown parameters

Winter 201 9 ENGO 36 3 : Estimation & Statistical Testing Lab # 0

2

 Output the estimated vector of unknown parameters and the estimated vector of residuals to
text files
Perform the following tasks in Matlab:
 Plot  vs.  for [ 1. 6 to 1. 6 ] based on the estimated unknown parameters (this should be
a smooth curve)
 On the same figure, plot the observed  vs. the given  in Table 1 as individual data points
 On a separate figure, plot a time series of the residuals (this could either be a line plot or
individual scattered points)

Write-up / Deliverables

The write-up should include the results for the required steps (presented in a tabular and/or graphical format) and the answers to any questions.

Program Source Code

 This is an individual lab  assignment and as such all results presented in the write-up must be
obtained from your own program(s).
 Computations must be performed in the C/ c++ language using the Eigen library.
 Data visualization should be performed in Matlab.
 Source code will be evaluated on modularity, style, readability, and use of comments. The use of
functions is mandatory. Do not underestimate the value of good, well documented code in terms
of long term usefulness, and contribution to your grade.
 Data for the program(s) must come from external files. Hard coding of data should be avoided.