rwalk {EviewsR} R Documentation

Simulate a random walk process using an EViews engine.

Description

Use this function to simulate a random walk process using an EViews engine from R, R Markdown or Quarto.

Usage

rwalk(
series = "",
wf = "",
page = "",
drift = NA,
rndseed = NA,
frequency = "",
start_date = "",
end_date = "",
num_cross_sections = NA,
num_observations = NA,
class = "df"
)


Arguments

 series Names of series for the random walk. wf Object or a character string representing the name of a workfile to be created page Object or a character string representing the name of a workfile page to be created drift Numeric value as the drift term for random walk. rndseed Set the seed for Eviews random number generator. frequency Object or a character string representing the frequency of a workfile page to be created. Only letters accepted by EViews are allowed. For example u for undated, a for annual, m for monthly and so on. start_date Object or a character string representing the start date. It should be left blank for undated (when the frequency is u). end_date Object or a character string representing the end date. It should be left blank for undated (when the frequency is u). num_cross_sections Optional integer value. Include num_cross_sections in order to create an EViews balanced panel page using integer identifiers for each of the cross-sections. num_observations Numeric value. Specify the number of observations if the frequency="u". class Class of the R object: df for dataframe, or xts for extendable time-series object.

Value

An EViews workfile

Other important functions: EviewsR, create_object(), eng_eviews(), eviews_graph(), eviews_import(), eviews_pagesave(), eviews_wfcreate(), eviews_wfsave(), exec_commands(), export_dataframe(), export(), import_equation(), import_graph(), import_kable(), import_series(), import_table(), import_workfile(), import(), set_eviews_path()

Examples

library(EviewsR)
## Not run:

# Simulate random walk and return as a dataframe object

rwalk(series="a b e",rndseed=12345,start_date = 1990,frequency="m",num_observations=100)

library(ggplot2)

ggplot(eviews$abe,aes(x=date))+geom_line(aes(y=a,color="a"))+ geom_line(aes(y=b,color="b"))+geom_line(aes(y=e,color="e"))+labs(colour='',x="",y="") # To simulate random walk and return as an xts object rwalk(series="X Y Z",rndseed=12345,start_date = 1990,frequency="m",num_observations=100,class="xts") plot(eviews$xyz)

autoplot(eviews$xyz,facet="")+xlab("") plot(eviews$XYZ)

# To simulate random walk series on existing workfile

eviews_wfcreate(wf="rwalk",page="rwalk",frequency="7",start_date=2020,end_date="2022")
rwalk(wf="rwalk",series="rw1 rw2 rw3",rndseed=12345,frequency="M")

## End(Not run)


[Package EviewsR version 0.1.5 Index]