Page 1 of 1

Has the curve flattened? During the Coronavirus pandemic, statistics such as number of new daily cases are gathered to h

Posted: Tue Jul 12, 2022 8:10 am
by answerhappygod
Has The Curve Flattened During The Coronavirus Pandemic Statistics Such As Number Of New Daily Cases Are Gathered To H 1
Has The Curve Flattened During The Coronavirus Pandemic Statistics Such As Number Of New Daily Cases Are Gathered To H 1 (77.66 KiB) Viewed 25 times
This is In matlab. I need help!
Has the curve flattened? During the Coronavirus pandemic, statistics such as number of new daily cases are gathered to help study the growth or decline of the spread of the virus. A country's cumulative new case data after 100 cases is provided for this problem. The data is taken from https://informationisbeautiful.net/data/ and shows accumulative data for 128 days. The data plot is shown in the figure below. No. cases 2 1.5 T 0.5 0 ×105 0 20 Accumulative Case Number 40 60 Days 80 100 120 140
One important statistical parameter is the maximum value. Finding the maximum value and the relative location of the maximum in data, like the date of the occuracne of the maximum number of cases, can help in further studies of the progression or digression of the disease. From the above, data can be modeled with an exponential function in the form of Y(x) = C*(1-exp(-X/D)), where C and D are constant parameters of the model. However an exponential model can be hard to work with. An exponential model can be linearized using the Taylor expansion. In other words: For Y(x): pt * = { ¹ + x + $/ + ² + + 5 n! n=0 _X Y(x) = C * (1 - e 5) = C * [- The output is: *[-+ D 2! ▪ polyNomOrder: the order of polynomial best fitting data. ▪ polyNomCoeff: the coefficients of the polynomial equation. (X)3 D 3! Write a program that finds the linearization parameters for this data set. Between orders 2 to 5, which polynomial order is the best fit for the data? The dataset is accumultive data, so no negative data points exist. However, some polynomial models may have some negative data points due to modeling error. The nonphysical data points don't have any significant effect in the modeling for the purpose of this problem. The best polynomial fit order can be decided visually by plotting the original data and the linearized model, and doing a visual comparison. Given: + ....] ▪ accumNum: a 1D array containing accumulative number of cases for 128 days. Restrictions: polyfit() cannot be used for this problem, as this system is an overdetermined system of linear equations. The polynomial coefficients should be found solving the system of linear euqations.
1 accumNum = importdata('cData.txt'); 2 X= [0: length (accumNum)-1]'; 3 4 % To recreate the plot in the description of the problem. 5 figure (1); 6 plot( X, accumNum, 'r. ' ); 7 title('Infection'); 8 hold on; 9 10 % polyNomOrder is the plolynomial order that best fits the data. 11 % Visually check to guess an order between 2-5 12 polyNomOrder = 13 14 % Write the coefficent model Xc*A = AccumNum 15 Xc = zeros( length(accumNum), polyNomOrder); 16 17 % Use for loops or another means to calculate Xc = [X(i), X(i)^2, X(i)^3 ...]; 18 XC = 19 20% Write the coefficent model Xc* PolyNomCoeff = AccumNum |21 %% Xc = [X(i), X(i)^2, X(i)^3 ...]; 22 polyNomCoeff = 23 24 % Shows the data and the model in one figure and can be compared. 25 % How closely does the model match the data? Experiment with changing PolynomOrder 26 plot( X, Xc*polyNomCoeff, 'b-' ); 27 hold off; Assessment: Is the order of the polynomial determined correctly? Are the coefficients calculated correctly? polyfit() should not be used.