Skip to content
Back to formatted view

Raw Message

Message-ID: <4186AC1D.4040004@pdf.com>
Date: 2004-11-01T21:35:25Z
From: Spencer Graves
Subject: How to plot PDF which is in the form of orthogonal polynomial
In-Reply-To: <Pine.LNX.4.61.0411011442050.5905@aitken.uchicago.edu>

Have you considered "cumsum(exp(-polynomial))"? 

      Consider for example the following: 

library(polynom)
b. <- polynomial(1:5)

x <- seq(-2, 2, length=101)
b.p <- predict(b., x)

plot(x, b.p)
plot(x, exp(-b.p))

cdf <- cumsum(exp(-b.p))
plot(cdf/cdf[101])
  
      hope this helps.  spencer graves

Yong Wang wrote:

> Dear all
> using the orthogonal polymial on a set of data, I get an approximate 
> density
> which basically is in the form: exp(-polynomial),
>  as you know, the parameters are the converged coeeficients.
> obviously, It is hard, if not impossible, to use the inverse CDF 
> method to get
> a sample and then plot density. then how can I plot the approximated 
> density in
> order to have a graphical comparision with the real data's histogram.
>
> any hint is appreciated
>
> thanks
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html


-- 
Spencer Graves, PhD, Senior Development Engineer
O:  (408)938-4420;  mobile:  (408)655-4567