
Last chance! 50% off unlimited learning
Sale ends in
EViews
engine.Use this function to simulate a random walk process using an EViews
engine from R, R Markdown or Quarto.
rwalk(
series = "",
wf = "",
page = "",
drift = NA,
rndseed = NA,
frequency = "",
start_date = "",
end_date = "",
num_cross_sections = NA,
num_observations = NA,
class = "df"
)
An EViews workfile
Names of series for the random walk.
Object or a character string representing the name of a workfile to be created
Object or a character string representing the name of a workfile page to be created
Numeric value as the drift term for random walk.
Set the seed
for Eviews
random number generator.
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.
Object or a character string representing the start date
. It should be left blank for undated (when the frequency
is u
).
Object or a character string representing the end date
. It should be left blank for undated (when the frequency
is u
).
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.
Numeric value. Specify the number of observations if the frequency="u"
.
Class of the R object: df
for dataframe, or xts
for extendable time-series object.
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()
library(EviewsR)
if (FALSE) {
# 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")
head(eviews$rw1rw2rw3)
}
Run the code above in your browser using DataLab