PDF: Probability density function and histogram

Description Usage Arguments Author(s) See Also Examples

Description

A graph showing the marginal distribution of the time series

Usage

1
PDF(x, is = 1, plot=TRUE, ...)

Arguments

x

a time series

is

index for which series to show

plot

true: plot the results

...

arguments passed on to plot

Author(s)

Rasmus.Benestad@met.no

See Also

AC, timeseries

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, is = 1, ...) 
{
    z <- coredata(trend(x[, is], result = "residual"))
    hist(z, col = "grey", freq = FALSE, main = "", ylab = "", 
        xlab = paste(attr(x, "longname")[is], " (", attr(x, "unit")[is], 
            ")", sep = ""), ...)
    x <- seq(-max(abs(z)), max(abs(x)), length = 100)
    lines(x, dnorm(x, mean = mean(z), sd = sd(z)), lwd = 3, col = rgb(1, 
        0, 0, 0.4))
    grid()
    par(new = TRUE, fig = c(0.75, 0.98, 0.75, 0.98), mar = rep(0, 
        4), cex.axis = 0.7)
    qqnorm(z, main = "")
    qqline(z, col = "red")
  }

brasmus/preciparea documentation built on May 7, 2019, 11:11 a.m.