plot.grid.dma: Plots Selected Outcomes from 'grid.DMA' Function.

View source: R/plot.grid.dma.R

plot.grid.dmaR Documentation

Plots Selected Outcomes from grid.DMA Function.

Description

The function plots selected outcomes from grid.DMA.

Usage

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

Arguments

x

an object of grid.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 Root Mean Squared Error (RMSE) for all estimated models,

2 - for plotting Mean Absolute Error (MAE) for all estimated models,

3 - for plotting posterior inclusion probabilities (including constant) for all estimated models, the outcomes are saved in separate png files in the temporary directory, and additionally, plots for different variables are collected into one big plot (also saved as a png file in the temporary directory),

4 - for plotting expected coefficients (including constant) for all estimated models, the outcomes are saved in separate png files in the temporary directory, and additionally, plots for different variables are collected into one big plot (also saved as a png file in the temporary directory).

Chosing 0 exits the plot command.

—————————————

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

1 - for plotting Root Mean Squared Error (RMSE) for all estimated models,

2 - for plotting Mean Absolute Error (MAE) for all estimated models,

3 - for plotting expected coefficients (including constant) for all estimated models, the outcomes are saved in separate png files in the temporary directory, and additionally, plots for different variables are collected into one big plot (also saved as a png file in the temporary directory).

Chosing 0 exits the plot command.

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

Value

Called for making a plot.

Note

It is suggested to execute graphics.off before exectuing plot command for grid.dma object. However, the User should take care to save all other plots before executing this command, as they can be lost.

If graphics.off is not executed before plotting grid.dma object, sometimes a legend might cover the important parts of the plot.

If any of the models comes from using multiple lambda (see fDMA), then RMSE and MAE are not plotted.

Also, if length(grid.alpha) or length(grid.lambda) is less than 2, then RMSE and MAE are not plotted.

Examples


wti <- crudeoil[-1,1]
drivers <- (lag(crudeoil[,-1],k=1))[-1,]
ld.wti <- (diff(log(wti)))[-1,]
ld.drivers <- (diff(log(drivers)))[-1,]
gra <- c(0.99,0.98,0.97)
grl <- c(0.99,0.95)

g1 <- grid.DMA(y=ld.wti,x=ld.drivers,grid.alpha=gra,grid.lambda=grl,initvar=1)
g2 <- grid.DMA(y=ld.wti,x=ld.drivers,grid.alpha=gra,grid.lambda=grl,initvar=1,model="dms")

# graphics.off()
plot(g1)
# graphics.off()
plot(g2)


fDMA documentation built on July 26, 2023, 6:09 p.m.

Related to plot.grid.dma in fDMA...