R simulation periodic ARMA(1,1) - r

I'd like to simulate a\ periodic ARMA(1,1) using R. I found the R package perARMA but I don't understand how to use it.
There is the function makeparma that permit to simulated the parma(1,1). But I don't understand the input parameters and the model used to simulate the periodic stuff.
This is the source code provided by the package trying to simulate a parma(2,1):
T=12
nlen=480
p=1
a=matrix(0,T,p)
q=1
b=matrix(0,T,q)
a[1,1]=.8
a[2,1]=.3
phia<-ab2phth(a)
phi0=phia$phi
phi0=as.matrix(phi0)
b[1,1]=-.7
b[2,1]=-.6
thetab<-ab2phth(b)
theta0=thetab$phi
theta0=as.matrix(theta0)
del0=matrix(1,T,1)
PARMA21<-makeparma(nlen,phi0,theta0,del0)
parma<-PARMA21$y
I don't understand why we should specify two beta value. And why del0 is a matrix.

I solved using the R package sarima and for the simulation I used the function prepareSimSarima

Related

R: Forecasting Future Values of Time Series

I am working with the R programming language. In particular, I am using "Markov Switching Models" for the purpose modelling more complicated dataset with varying degrees of volatility. For this problem, I am using the "MSwM" package in R:
https://cran.r-project.org/web/packages/MSwM/MSwM.pdf
https://cran.r-project.org/web/packages/MSwM/vignettes/examples.pdf
I am following the first example from the "vignettes":
#load library
library(MSwM)
#load data
data(example)
#plot data
plot(ts(example))
#fit basic model
mod=lm(y~x,example)
#fit markov switching model:
mod.mswm=msmFit(mod,k=2,p=1,sw=c(TRUE,TRUE,TRUE,TRUE),control=list(parallel=FALSE))
The above code successfully creates the model - 2 "Regimes" have been identified:
Question: I checked the documentation of this package, and there does not seem to be any functions that allow you to predict future values of this time series. I did some research and it seems like the "Markov Switching Model" should allow you to predict future values of a time series, e.g. : https://stats.stackexchange.com/questions/90448/how-to-forecast-a-markov-switching-model
OR:
However, there does not seem to be a straightforward way to do this in R. Can someone please suggest how to resolve this problem?
Thanks

R - Predicting using the arimax funciton of the TSA package

I am trying to fit a transfer function model using R in order to apply the fitted model to a validation set of data, because SPSS doesn't allow me to (or I don't know how to) compute point forecasts just like the function Arima() from forecast package does. It does let me apply the model, but it does not use the dependet variable's lagged values, that's why I am trying R.
Anyone know how I could get those type of "updated" or validation forecasts using the arimax() function? I am not looking for the following type of predictions:
predict(vixari011, n.ahead=12)
But rather these:
Arima(test$VIX, model = vixari)
From what I have been reading there is no prediction function for the arimax() function, any ideas about how I could forecast to evaluate point-by-point performance? I can just think of computing manually using a spreadsheet...
I had the same problem. I know this post is old but this can help someone.
I used this it worked just fine
forecast(fitted(arimax_ts_model), h=11)

How can I make the nnetpredint R package handle a linear transfer function at the output node?

I am working in R, and using the nnet package to train a neural network model. I have been experimenting with the nnetpredint package to compute prediction intervals around the model output. How can I modify the nnetpredint package so that it can handle a linear transfer function at the output node, i.e., when I use the linout=T parameter in the nnet() function?

Has anyone used RNN package in R for Recursive Neural Network? How do I use that for prediction?

rnn() function R has no return statement. It generates synapses for input, hidden and output layer. How to use these for prediction with a test sample of a time series data?
There was just an update of the rnn package, with the version 0.5.0, it can generalize outside of the toy example of binary addition.
You must use the trainr function to train the model and the predictr to predict the values on your data.
So far it only support synchronized many to many learning, understand that each new time point input will produce an output.

how to perform semi-supervised k-mean clustering

I am new in r. I am trying to perform semi-supervised k-means clustering. I plan to divide my 2/3 of my data as a training set, and 1/3 as a test set. My objective is to train a model using the known clusters, and then propagate the training model to the test set. the propagation result will be compare with the prior clusters. my objective is to check the prediction accuracy of kmeans clustering. Therefore I am wondering if there is a way we can do semi-supervised kmeans clustering using r? any package is needed. thank you.
thank you
regards,
Use kmeans(). It should come with the stats package, which you should have if you've installed R correctly. You can read how to use functions by putting a ? before the function call, e.g. ?kmeans().
Search online if you're still lost about how to use the function - there are plenty of guides and toy examples online.
M

Resources