Comments (2)
I am currently with a model with about 29 variables. Currently I have to create one bimet object for each variable in order to use them on a model. Each of these variable have the same arguments, so it makes the code longer than it needs to be.
This issue might be solved (or improved) if there were a way that I could convert a data frame into a bimets object.
Is it possible to create a bimets data frame?
Hi Juansqw.
I appreciate your interest in the bimets package.
I'm not sure I understand this correctly, but if you want to convert a data.frame into a time series list suitable to a bimets model, you may want to try the following:
library(bimets)
#create a simple monthly dataframe
my_df <- data.frame(dates=c("1/1/2000","1/2/2000","1/3/2000","1/4/2000","1/5/2000","1/6/2000")
,ts1=(1:6)
,ts2=pi*(1:6)
,ts3=seq(0,-1,length.out=6)
)
#check df data
print(my_df)
#convert to bimets model data
my_bimets_modeldata <- lapply(as.list(xts(my_df[,-1], order.by=as.Date(my_df[,1],"%m/%d/%Y"))), as.bimets)
#the data.frame is now loadable into a bimets model
my_model_mdl <- "
MODEL
BEHAVIORAL>ts1
EQ>ts1 = c0 + c1*ts2 + c2*ts3
COEFF>c0 c1 c2
END
"
my_model <- LOAD_MODEL(modelText = my_model_mdl)
my_model <- LOAD_MODEL_DATA(my_model, my_bimets_modeldata)
my_model <- ESTIMATE(my_model, TSRANGE = c(2000,1,2000,6))
from bimets.
Hola Andrea
This is not what I was thinking, but it certainly does the trick.
Thank you for your help.
from bimets.
Related Issues (10)
- TSLEAD seems not recognized HOT 1
- How to extend the data of seasonal dummy variables in bimets HOT 4
- How to read a regular data set into bimets HOT 5
- TSEXTEND() function does not work as expected. HOT 9
- Cannot find STORE> in manual HOT 2
- Print estimate output, again HOT 1
- LOG and EXP tranformations or with TABIT HOT 1
- Full incidence matrix HOT 3
- Out of sample residuals HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bimets.