distribution: Distribution of Time Series Factors Estimates

Description Usage Arguments Author(s) See Also Examples

Description

Plot the distribution of the multiple estimates from EstEval, and possibly multiple EstEval objects.

Usage

1
2
3
    ## S3 method for class 'factorsEstEval'
distribution(obj, ..., bandwidth = "nrd0",
        cumulate=TRUE, graphs.per.page = 5, Title=NULL)

Arguments

obj

EstEval object.

bandwidth

bandwidth for distribution smoothing.

cumulate

logical indicating if the distribution across time and repititions should be plotted (TRUE) or a time series of standard deviation across repititions should be plotted (FALSE).

graphs.per.page

number of graphs on an output page.

Title

string indicating a title for the plot.

...

additional EstEval objects which will be plotted on the same graph.

Author(s)

Paul Gilbert

See Also

distribution, EstEval, estTSF.ML

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
  if (require("CDNmoney")){
    data("CanadianMoneyData.asof.6Feb2004", package="CDNmoney")

    ### Construct data
 
    cpi <- 100 * M1total / M1real
    seriesNames(cpi) <- "CPI"
    popm <- M1total / M1PerCapita
    seriesNames(popm) <- "Population of Canada"
 
    z <- tframed(tbind(
  	MB2001,
  	MB486 + MB452 + MB453 ,
  	NonbankCheq,
  	MB472 + MB473 + MB487p,
  	MB475,
  	NonbankNonCheq + MB454 + NonbankTerm + MB2046 + MB2047 + MB2048 +
  	MB2057 + MB2058 + MB482),
  	names=c("currency", "personal cheq.", "NonbankCheq",
  	"N-P demand & notice", "N-P term", "Investment")
  	)

    z <- tfwindow(z, start=c(1986,1))
    if( all(c(2003,12) ==end(z))) z <-tfwindow(z, end=c(2003,11))
    MBcomponents <- 1e8 * z/matrix(tfwindow(popm * cpi,tf=tframe(z)), Tobs(z),6)
 
    ### Specify "true" parameters and factors
 
    Omega <- diag(c(72.63, 1233, 87.33,
  		629.4, 3968, 12163))
 
    Boblq <- t(matrix(c(
       8.84,   5.20,
      23.82, -12.57,
       5.18,  -1.97,
      36.78,  16.94,
      -2.84,  31.02,
       2.60,  47.63), 2,6))
 
    PhiOblq <- matrix(c( 1.0, 0.00949, 0.00949, 1.0),2,2)

    etaBart <- MBcomponents %*% solve(Omega) %*% Boblq %*% (
  		solve( t(Boblq) %*% solve(Omega) %*% Boblq ) )

    DetaBart <- diff(etaBart, lag=1)
    SDE      <- cov(DetaBart)
    RR1 <- chol(SDE)	  # upper triangular: SDE = RR1' RR1
    RR2 <- chol(PhiOblq)  # ditto
    PP  <- t(RR2) %*% solve(t(RR1))
    Psi       <- 0.5 * Omega

    etaTrue <- tframed(etaBart %*% t(PP), tf=tframe(MBcomponents))

    ### run Monte Carlo  N.B. replications would typically be much larger

    require("EvalEst")
 
    EE.ML5 <- EstEval(TSFmodel(Boblq, f=etaTrue, positive.measures=FALSE),
      replications=5, quiet=FALSE,
      simulation.args=list(Cov=Psi, noIC=TRUE),
      estimation="estTSF.ML", estimation.args=list(2, BpermuteTarget=Boblq),
      criterion ="TSFmodel")
 
    distribution(factors(EE.ML5))
    distribution(factors(EE.ML5), cumulate=FALSE)
    distribution(diff(factors(EE.ML5)))
    distribution(diff(factors(EE.ML5)), cumulate=FALSE)
  }

tsfa documentation built on Jan. 13, 2021, 10:53 a.m.