Clear Filters
Clear Filters

Plotting a 4D graph with the fourth dimension using color (a 3D graph with the fourth dimension represented using colors)

5 views (last 30 days)
I would like to know how to plot R0 (basic reproduction number of a disease) against three given parameters on a 3D plot where the x-, y-, and z- axes represent the three parameters and a color scheme represents R0. So, the graph should essentially be a 3D plot, but the fourth dimension (depicting R0) should be in terms of a color scheme.
In the current example, I wish to plot R0 against the three parameters beta, p, and phi which could all vary between 0 and 1. The formula for R0 and the parameters are given below.
c = 0.01;
%beta = 0.4;
gamma = 0.2;
theta = 0.2778;
%p = 0.05;
%phi = 0.95;
epsilon = 0.084;
delta = 0.011;
mu = 0.000027;
R0 = (epsilon*c*beta*theta*(mu+(1-phi)*p))/(mu*(mu+p)*(mu+epsilon)*(mu+gamma+delta))
I would highly appreciate if someone could help me on this. Thanks a lot in advance!

Answers (1)

Torsten
Torsten on 15 Jan 2023
Edited: Torsten on 15 Jan 2023
Use "slice".
This will display R0 on predefined planes in 3d space.
  12 Comments
Bas123
Bas123 on 17 Jan 2023
Hi again, thanks for the great question. Yes, you're right. I am not sure if I was using accurate terminology when I made it look like R0 values as high as 450 are "epidemiologically meaningless" because any non-negative value of R0 is theoretically possible. That said, there might be a problem with the model when it gives such large values for R0. However, I don't think that there is anything erroneous with my model or the parameter values to the best of my knowledge, on which I might well be wrong as well. In fact, none of the other simulations that I did pertaining to R0 gave results like these. So, I drew similar plots of R0 for three other models that I found in the literature and examined what those graphs look like. Surprisingly, those plots also produced substantially large values for R0 as mine did. I was hence wondering if there are issues with those models as well or if this is a typical phenomenon. May be they didn't figure it out as they didn't go about producing a graph like this, nor did I until I came up with the current graph. Therefore, I believe that this is a question which is worthy of a discussion on its own, perhaps on a separate platform. Thanks for all your inputs.
Bas123
Bas123 on 17 Jan 2023
Edited: Bas123 on 17 Jan 2023
Another thought that just came to my mind is that we are mainly concerned not so much about the actual value/s of R0 as the behavior of the parameters of interest at/near the threshold R0=1. So, restricting R0 on a smaller interval like [0,2] or [0,5] would help us get a better sense of (closer look at) how the three parameters affect R0 near the threshold (which, in fact, is the purpose of such a graph). If the graph was based on data, then truncating a part of it would certainly constitute an act of cheating, but a case like this, in my opinion, doesn't seem to do so.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!