Plot non-central chi squared PDF's

Hi,

In fable, I have generated forecasts using a SQRT transformation, and the (automatic) back-transformed SQUARED forecasts are:

   fsteps    mean    sd
   <chr>    <dbl> <dbl>
 1 f01_D  164415.  454.
 2 f02_D  164560.  593.
 3 f03_D  164715.  695.
 4 f04_D  164854.  779.
 5 f05_D  165001.  852.
 6 f06_D  165147.  921.

these will be from a non-central-chi squared distribution: the SQUARE of a normal.

Simply, in ggplot2 or otherwise, I would like to plot EACH of the 6 non-central-chi squared PDF's, from the 6 forecasts on 2 plots:
(a) 6 PDF's superimposed
(b) 6 individual PDF's (on the same plot, using library(patchwork))

This I would like in 2 ways:
(1) Generating random variates: let's say 1000000 using rchisq(n, df, ncp = ?) for EACH of the 6 forecasts.
(2) Analytically, using dchisq(x, df, ncp = ?, log = FALSE).

The parameters:
n = 1000000
df = 1: from theory, the square of the standard normal.
ncp = How do I calculate the non-centrality parameter ncp, given the mean's and sd's, for EACH of the 6 forecasts?
x = sequence from/to mean +/- 4*std say?

How do I plot the PDF's?

thanks,
Amarjit

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.