Having this task:
Perform a regression model over the normalized active cases in China using the model.....(long assignment that I'm not worried about). Tip: To convert from datetime to a numeric variable for the regression, use x=day(date-min(date(:)))+1; being “date” the datetime vector return from getdata function.
This is what I have until now:
data = readtable('COVID-19.csv');
[active_res, confirmed_res, death_res, recovered_res, date] = getdata(data, 'China', 93/147);
y = active_res;
yp = log(y./x);
a = [x ones(size(x))];
sol = inv(a'*a)*(a'*yp);
b = sol(1);
c = sol(2);
a = exp(c);
I'm getting an error in this line
and I don't get it. From getdata function I'm getting successfully a 1x50 datetime array fulled with dates and stored in my date variable. What am I doing wrong?