STFDF vs. STARIMA - r

I'm working on spatio-temporal anomaly analysis using R.
I found a lot tutorials talking about converting data into STFDF( space-time full data frame) and use variogram method and then use stkrige function for prediction. And so I did. However, I found some research papers talking about STARIMA model , which is basically, ARIMA model but for space time data.
Couldn't find any example how to implement it using R.
Does anyone have an idea how to implement it?
Also, how does STARIMA is related to variogram?
The reason why I'm asking is because when I used variogram and pull the plot for the time series of my data, I see outliers, and I couldn't find tutorials explains how to detect outliers with variogram. Anyone went through this topic before?
Thanks

Related

Specification of a mixed model using glmmLasso package

I have a dataset containing repeated measures and quite a lot of variables per observation. Therefore, I need to find a way to select explanatory variables in a smart way. Regularized Regression methods sound good to me to address this problem.
Upon looking for a solution, I found out about the glmmLasso package quite recently. However, I have difficulties defining a model. I found a demo file online, but since I'm a beginner with R, I had a hard time understanding it.
(demo: https://rdrr.io/cran/glmmLasso/src/demo/glmmLasso-soccer.r)
Since I cannot share the original data, I would suggest you use the soccer dataset (the same dataset used in glmmLasso demo file). The variable team is repeated in observations and should be taken as a random effect.
# sample data
library(glmmLasso)
data("soccer")
I would appreciate if you can explain the parameters lambda and family, and how to tune them.

How do I find the exact equation for a Caret model in R?

I used Caret to create a regression model of a dataset in R, and I wish to find this equation for usage in other websites (e.g. Desmos). I am unable to find info anywhere on how to do this, so if anyone has answers, that would be much appreciated! :D

How to run Longitudinal Ordinal Logistic Regression in R

I'm working with a large data set with repeated patients over multiple months with ordered outcomes on a severity scale from 1 to 5. I was able to analyze the first set of patients using the polr function to run a basic ordinal logistic regression model, but now want to analyze association across all the time points using a longitudinal ordinal logistic model. I can't seem to find any clear documentation online or on this site so far explaining which package to use and how to use it. I am also an R novice so any simple explanations would be incredibly useful. Based on some initial searching it seems like the mixor function might be what I need though I am not sure how it works. I found it on this site
https://cran.r-project.org/web/packages/mixor/vignettes/mixor.pdf
Would appreciate a simple explanation of how to use this function if this is the right one, or would happily take any alternate suggestions with an explanation.
Thank you in advance for your help!

R - replicate weight survey

Currently I'm interested in learning how to obtain information from the American Community Survey PUMS files. I have read some of the the ACS documentation and found that to replicate weights I must use the following formula:
And thanks to google I also found that there's the SURVEY package and the svrepdesign function to help me get this done
https://www.rdocumentation.org/packages/survey/versions/3.33-2/topics/svrepdesign
Now, even though I'm getting into R and learning statistics and have a SQL background, there are two BIG problems:
1 - I have no idea what that formula means and I would really like to understand it before going any further
2 - I don't understand how the SVREPDESIGN function works nor how to use it.
I'm not looking for someone to solve my life/problems, but I would really appreciate if someone points me in the right direction and gives a jump start.
Thank you for your time.
When you are using svyrepdesign, you are specifying that it is a design with replicated weights, and it uses the formula you provided to calculate the standard errors.
The American Community Survey has 80 replicate weights, so it first calculates the statistic you are interested in with the full sample weights (X), then it calculates the same statistic with all 80 replicate weights (X_r).
You should read this: https://usa.ipums.org/usa/repwt.shtml

Markov Switching-Autoregressive in R

I'm trying to replicate this paper but using different time period
https://www.dropbox.com/s/edwdpgwsbli93f1/SM35%282%29-09-modelling.pdf?dl=0.
This paper is about detecting regime shifts in Malaysian currency i.e the ringgit. From what I understand it uses Markov Switching-Autoregressive method (MS-AR). I've been trying to replicate this method in R, but to no success. There has been some question asking about it lately which can be found here
Error when using msmFit in R
Basically I'm having the same problem. When I tried to do the MS-AR the error came out. I'm not sure what the exact calculation for the msmFit, but from some examples online they use this to get the fit for MS-AR. So my question is, is it actually possible to do MS-AR(p) in R? Is there any other software besides R or Eviews 8 (since I don't have this at the moment) that can actually do this?
Thank you. Really appreciate your insight.
link msmFit: http://cran.r-project.org/web/packages/msm/msm.pdf
There is a package for MATLAB called MS_Regress, it should do the job:
https://sites.google.com/site/marceloperlin/matlab-code/ms_regress---a-package-for-markov-regime-switching-models-in-matlab
I was trying to fit the MS-AR model in R, but I get the same error message. Could you provide us with a link to the examples you found about getting the fit in R?

Resources