How to pass on results from package blockCV to package sdm - r

I am working on species distribution models and I am using the function sdm in package sdm to construct my models. I try to implement a blocked cross-validation using the function spatialBlock in the package BlockCV, but I don't seem to find how to pass on the result of spatialBlock to my sdm function in the sdm package.
Any ideas? thanks!

It doesn't seem that there is an option for it. There should be an argument that accepts the FoldIDs. A workaround is that you write it in a for loop like any other modelling method (see blockCV's vignette) if your goal of using spatial CV is model evaluation.
You can email the maintainer as well.

Related

pgmm function and gmm function in R

I have a very basic question regarding these two functions in R.
When I try to do panel data analysis using generalised moment method, I realised that both gmm and pgmm are functions for this method. What is the difference between them? Should I use pgmm one instead of gmm for panel data(I would like to do difference GMM estimation)?
Thank you in advance!
If you are doing panel analysis, you should use pgmm. It is part of the plm package for R, which is a comprehensive package for panel data econometrics.
I assume the gmm function you refer to is from the package of the same name. It is developed for cross-section GMM estimation, not panel data.

Is there a Julia alternative to R predict() method for the MixedModels package?

I have created a linear mixed model in Julia 1.0.4 using the MixedModels and StatsModels packages because lme4 in R does not seem to run on my dataset. Now that I have the model, however, I have not been able to find a way to apply it to test data so I can gauge the model's accuracy. Is there a Julia alternative to the R predict() method that allows new data? I have tried using the Julia predict() method but it only works to predict the same data I created the model with.
I created the model just like this example:
mm1 = fit(LinearMixedModel, #formula(Y ~ 1 + (1 | G)), dyestuff)
but there does not seem to be a method that would allow something like
predict(mm1, test_data)
to work in Julia. I have also tried using RCall to send the mm1 variable over to R and use the predict() method that way, but it does not seem like #rput can work with that kind of variable. Thanks!

R simulation periodic ARMA(1,1)

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

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)

Deming Regression MCR package

I am using the "mcr" package for deming regression. When i try to use the functions
mc.analytical.ci()
mc.bootstrap()
i get an errer saying "could not find function "(one of the two functions above)" "
But I don't have any trouble using other functions, like
plotDifference()
Stangely they are not available, but the manual don't tell anything about not using them.
Anyway you can use them as:
mcr:::mc.analytical.ci()

Resources