Learn R Programming

fDMA (version 2.2.7)

plot.dma: Plots Selected Outcomes from fDMA Function.

Description

The function plots selected outcomes from fDMA.

Usage

# S3 method for dma
plot(x,non.interactive=NULL, ...)

Value

Called for making a plot.

Arguments

x

an object of dma class

non.interactive

optional, logical, indicate whether plots should be made in non-interactive mode, by default non.interactive=FALSE, i.e., the user specifies in the interactive menu which plots will be made

...

not used

Details

If x comes from estimation of Dynamic Model Averaging (DMA), after executing the command, the User is asked to choose

1 - for plotting actual and predicted values,

2 - for plotting residuals,

3 - for plotting the expected number of variables (including constant),

4 - for plotting posterior inclusion probabilities (including constant) on one plot,

5 - for plotting posterior inclusion probabilities (including constant) in separate png files, saved in the temporary directory, and moreover, to paste them into one big plot (also saved as a png file in the temporary directory),

6 - for plotting expected coefficients (including constant) on one plot,

7 - for plotting expected coefficients (including constant) in separate png files, saved in the temporary directory, and moreover, to paste them into one big plot (also saved as a png file in the temporary directory),

8 - for plotting the expected value of lambda,

9 - for plotting posterior model probabilities, if Dynamic Occam's Window method has not been selected, or plotting the number of models used in Dynamic Model Averaging, if Dynamic Occam's Window method has been selected.

Chosing 0 exits the plot command.

---------------------------------------

If x comes from estimation of Dynamic Model Selection (DMS) or Median Probability Model (MED), after executing plot the User is asked to choose

1 - for plotting actual and predicted values,

2 - for plotting residuals,

3 - for plotting the expected number of variables (including constant),

4 - for producing a plot showing which variables (including constant) are included in the DMS or MED model in each time,

5 - for plotting expected coefficients (including constant) on one plot,

6 - for plotting expected coefficients (including constant) in separate png files, saved in the temporary directory, and moreover, to paste them into one big plot (also saved as a png file in the temporary directory),

7 - for plotting the expected value of lambda (only for DMS).

Chosing 0 exits the plot command.

If non.interactive=TRUE all the above plots are made.

Examples

Run this code
# \donttest{
wti <- crudeoil[-1,1]
drivers <- (lag(crudeoil[,-1],k=1))[-1,]
ld.wti <- (diff(log(wti)))[-1,]
ld.drivers <- (diff(log(drivers)))[-1,]

m1 <- fDMA(y=ld.wti,x=ld.drivers,alpha=0.99,lambda=0.99,initvar=1,model="dma")
m2 <- fDMA(y=ld.wti,x=ld.drivers,alpha=0.99,lambda=0.99,initvar=1,model="dms")

# graphics.off()
plot(m1)
# graphics.off()
plot(m2)
# }

Run the code above in your browser using DataLab