Fit, Plot, and Manipulate Distributions?

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

cpeter9
Posts: 8
Joined: Tue Jun 16, 2009 11:17 am

Fit, Plot, and Manipulate Distributions?

Postby cpeter9 » Tue Jun 16, 2009 11:37 am

Given a set of data, is there a way to have EVIEWS

a) Fit a normal distribution (based on some kind of best fit / ML estimation)

b) Fit another normal distribution (density) on top of the previous distribution (but with a smaller, user supplied standard deviation)

c) Find the area between the two curves in one tail from the intersection out (to infinity presumably given that it is a density distribution.)

?


Thanks for any help with this!

Chris

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Fit, Plot, and Manipulate Distributions?

Postby startz » Tue Jun 16, 2009 11:50 am

Given a set of data, is there a way to have EVIEWS

a) Fit a normal distribution (based on some kind of best fit / ML estimation)

b) Fit another normal distribution (density) on top of the previous distribution (but with a smaller, user supplied standard deviation)

c) Find the area between the two curves in one tail from the intersection out (to infinity presumably given that it is a density distribution.)

?


Thanks for any help with this!

Chris
Take a look at distribution graphs for (a) and (b).

cpeter9
Posts: 8
Joined: Tue Jun 16, 2009 11:17 am

Re: Fit, Plot, and Manipulate Distributions?

Postby cpeter9 » Tue Jun 16, 2009 1:03 pm

Ok, I see (and have done a), and I see how one might plot b on top of it (I could probably generate a random series in this case to do the trick), but how would I then find the area between the two curves where they intersect in the left tail?

cpeter9
Posts: 8
Joined: Tue Jun 16, 2009 11:17 am

Re: Fit, Plot, and Manipulate Distributions?

Postby cpeter9 » Tue Jun 16, 2009 1:20 pm

To clarify, check out the attached and plotted density function.

I could probably do a heck of a lot of calculus and calculations (give the complexity of the normal dist. function) and get an answer, but is there any easy EVIEWS way to calculate the area below the left tale of the blue line distribution and above the left tale of the red line distribution?
Attachments
DENSITY_COMPARISON.pdf
(13.77 KiB) Downloaded 487 times

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Fit, Plot, and Manipulate Distributions?

Postby EViews Glenn » Tue Jun 16, 2009 2:12 pm

I'm not certain that I understand. Do you want the integral of the difference for the regions to the left and right of the intersection?

cpeter9
Posts: 8
Joined: Tue Jun 16, 2009 11:17 am

Re: Fit, Plot, and Manipulate Distributions?

Postby cpeter9 » Tue Jun 16, 2009 2:46 pm

I'm sorry, that was very poorly worded and explained. Disregard the previous post, I feel like I have a much better grip on my question now.

Again, attached is a graph. What I'm trying to figure out is probably more of a statistics question than EVIEWS question.

I've found the area under the curve of the blue normal distribution left of the black line.

I'm trying to find the area under the blue curve represented by the area under the red curve to the left of the black line.

I can't simply find the area of the red curve (left of the black line) and subtract that from the blue area because each density curve adds to 1, make sense?

Also, is there anyway to extend the blue and red plot lines of the distributions to the x axis in EVIEWS?
Attachments
DENSITY_COMPARISON_TEST.pdf
(13.38 KiB) Downloaded 432 times

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Fit, Plot, and Manipulate Distributions?

Postby EViews Glenn » Tue Jun 16, 2009 3:11 pm

Let's do a couple of quick calculations

Suppose the black line is 133,500,000.
Let the mean be 1.405e+08.
Let the standard deviation of the blue density be 4.575e+06
Let the standard deviation of the red density be 1.00e+06

Code: Select all

scalar black = 133500000 scalar mean = 1.405e+08 scalar bluesd = 4.57e+06 scalar redsd = 1.00e+06
Then the area under the curve to the left of the black line for the blue density is

Code: Select all

scalar bluecdf = @cnorm((black - mean)/bluesd)
The area to the left of the black line for the red density is

Code: Select all

salar redcdf = @cnorm((black - mean)/redsd)
Now since we've got the normal, the blue density is always higher than the corresponding red density beyond the intersections so you can take the difference of the two.

cpeter9
Posts: 8
Joined: Tue Jun 16, 2009 11:17 am

Re: Fit, Plot, and Manipulate Distributions?

Postby cpeter9 » Wed Jun 17, 2009 2:38 pm

Thank you!!! That's exactly what I needed!

COPerezRoman
Posts: 1
Joined: Mon Nov 25, 2013 7:07 am

Re: Fit, Plot, and Manipulate Distributions?

Postby COPerezRoman » Fri Nov 29, 2013 7:26 pm

To CPeter9:

How were you able to fit the normal distribution to your data? I have a set of data, and I'm trying to see which distribution best fits it. It'd be great to at least get a starting point to work with.

Best Regards,

COPerezRoman

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Fit, Plot, and Manipulate Distributions?

Postby trubador » Sat Nov 30, 2013 8:35 am

How were you able to fit the normal distribution to your data? I have a set of data, and I'm trying to see which distribution best fits it. It'd be great to at least get a starting point to work with.
Open your series, then go to View/Descriptive Statistics & Tests/Empirical Distribution Tests...


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests