Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You really do not need the previous questions information as it was unrelated. Now, we will try to predict how the disease will be spreaded

You really do not need the previous questions information as it was unrelated.

Now, we will try to predict how the disease will be spreaded if it continues the same way. Let's return to the total number of cases per day T.total_cases. From the first plot we ploted in this lab, we could guess that the shape of this function is exponential. We can try to fit the exponential model to the data points to compute the model.

[xData, yData] = prepareCurveData( [], T.total_cases ); opts = fitoptions( 'Method', 'NonlinearLeastSquares' ); opts.Display = 'Off'; f = fit( xData, yData, fittype('exp1'), opts ); figure plot(f, xData, yData); legend('Total cases', 'Fitted model') xlabel('Days') ylabel('Total Cases') grid on

Note that the fitted function is not always precisely replicating the data points, but it is close enough. Now, we need to extract the constant coeeficients and of the exponential model by reading the fields fitresult.a and fitresult.b:

f.a: YOUR CODE

f.b: YOUR CODE

In conclusion, . After 600 days the model would predict 40,195,522 total cases in the US, which is close to the actual number around 40 million. After 700 days the model predicts the total number to be while the actual number is over 53 million. As you may see, this simple model has pretty robust predicting power. Assuming that the trend will continue, and the population of the USA is 330 million people, compute how many days it will take to infect us all?... Yep, about 1,202 days, which is slightly more than one year from now (this was computed on 707th day). Luckily, we can break this model by social distancing and wearing masks, and hopefully medical help will arrive soon enough. Also, the transmission rates slow down when majority of a population have antibodies in their immune system. Now, we will try using another model, which is called Fourier Series model. We will learn about Fourier series in future lectures, but now you could take a brief glimpse at it by fitting truncated Fourier series to our COVID data. The truncated model is given by: , where are the parameters that we need to fit. Repeat the fitting code above (all code in this section) with fittype('fourier3'):

[xData, yData] = prepareCurveData( [], T.total_cases ); opts = fitoptions( 'Method', 'NonlinearLeastSquares' ); opts.Display = 'Off'; f = fit( xData, yData, fittype('fourier3'), opts ); figure plot(f, xData, yData); legend('Total cases', 'Fitted model') xlabel('Days') ylabel('Total Cases') grid on

As you may see, the fit is much better now. Compute the predicted value at 1,202 day given by the model using the following code:

% write your code here for predicting a value at 1202

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Outlook 2023

Authors: James Holler

1st Edition

B0BP9P1VWJ, 979-8367217322

More Books

Students also viewed these Databases questions

Question

How and why do governments encourage foreign investment

Answered: 1 week ago