Plotting 1D Conditional Distributions with kdensity stacked in a 3D figure.
Hi guys. It’s my first time here and I am not a native English speaker. So, first of all, apologize.
Here is my problem: I have a T x 2 Matrix, where in the second column I have some daily financial returns and in the first column I have an indicator, which can assume integer values in the interval [1, 9].
I want to extract 9 different conditional distributions of my returns, conditioned on the values assumed by the indicator. At this point, I want to plot the conditional densities through a Gaussian smoothing with the function ‘ksdensity’ and plot them in the same 3D plot. The final output should be similar to this one:
Image
I tried to reach this result by adapting the answer I found at this thread: function.
Now suppose that x = axis of returns, y = axis of indicator possible values, z = smoothed conditional densities.
My problem is that, while the meshgrid requires for all the values of y to share the same values of x by construction, I have different values of x (the returns) because of the conditioning.
I hope I have been clear.
Thanks you guys in advance, and sorry for any mistake.Hi guys. It’s my first time here and I am not a native English speaker. So, first of all, apologize.
Here is my problem: I have a T x 2 Matrix, where in the second column I have some daily financial returns and in the first column I have an indicator, which can assume integer values in the interval [1, 9].
I want to extract 9 different conditional distributions of my returns, conditioned on the values assumed by the indicator. At this point, I want to plot the conditional densities through a Gaussian smoothing with the function ‘ksdensity’ and plot them in the same 3D plot. The final output should be similar to this one:
Image
I tried to reach this result by adapting the answer I found at this thread: function.
Now suppose that x = axis of returns, y = axis of indicator possible values, z = smoothed conditional densities.
My problem is that, while the meshgrid requires for all the values of y to share the same values of x by construction, I have different values of x (the returns) because of the conditioning.
I hope I have been clear.
Thanks you guys in advance, and sorry for any mistake. Hi guys. It’s my first time here and I am not a native English speaker. So, first of all, apologize.
Here is my problem: I have a T x 2 Matrix, where in the second column I have some daily financial returns and in the first column I have an indicator, which can assume integer values in the interval [1, 9].
I want to extract 9 different conditional distributions of my returns, conditioned on the values assumed by the indicator. At this point, I want to plot the conditional densities through a Gaussian smoothing with the function ‘ksdensity’ and plot them in the same 3D plot. The final output should be similar to this one:
Image
I tried to reach this result by adapting the answer I found at this thread: function.
Now suppose that x = axis of returns, y = axis of indicator possible values, z = smoothed conditional densities.
My problem is that, while the meshgrid requires for all the values of y to share the same values of x by construction, I have different values of x (the returns) because of the conditioning.
I hope I have been clear.
Thanks you guys in advance, and sorry for any mistake. 3d plots MATLAB Answers — New Questions