198 questions
-1
votes
0
answers
52
views
Accounting for temporal autocorrelation with irregular time lags with GAM model in R [closed]
I am running a GAM model with bam in the mgcv package in R.
The dataset in the model is calculated from mean hourly speeds for individual fish from position data (x,y, datetime).
AR_hourly <- ...
3
votes
0
answers
92
views
Error calculation for a time series using autocorrelation
I'm trying to calculate the autocorrelation time for a time series generated from molecular-dynamics trajectory frames. I used several methods to estimate the autocorrelation time because I need it to ...
3
votes
1
answer
152
views
How to compute the power spectral density of a vector-valued process without mirroring the autocorrelation function?
I'm simulating a 2D Ornstein-Uhlenbeck process (Langevin equation for velocity), and I'm interested in computing the power spectral density (PSD) of the vector-valued velocity process.
Following the ...
1
vote
0
answers
75
views
How to deal with autocorrelation in piecewise growth curve model (linear mixed effect approach)
I'm running a piecewise growth curve model in R using nlme. I have nested data with seven repeated measures (saliva cortisol levels) for each of my subjects (no missing data). I have a "classic&...
0
votes
0
answers
34
views
Autocorrelation model for network diffusion with incomplete network attributes
I have daily call/text data from college students over the course of a semester as well as their daily sleep logs; I made networks in igraph using this data for a different paper I'm working on.
I'm ...
0
votes
0
answers
48
views
plot_acf vs acf (graphical vs numerical way of finding significal coefficients in autocorrelation function)
I'm following along a book that shows how to plot the autocorrelation function (using plot_acf) to investigate the coefficients for the various lags, to see with which lag they abruptly become non-...
1
vote
1
answer
82
views
Variogram per group
I'm using a variogram to try and detect un-accounted for temporal auto-correlation in my model, but it shows the same pattern for all group levels (fSite). I allowed each fSite to have it's own trend, ...
0
votes
0
answers
53
views
error when doing lm test for spatial autocorrelation in error terms
Below is an image of the data for some variables in pdata.frame format. The panel is for 166 municipalities in RN for 4 years, generating a total of 664 observations.Can I make the panel available on ...
0
votes
1
answer
292
views
How to model temporal autocorrelation with brms in R? Error: Time points within groups must be unique
I have a dataset of qPCR reads (relative density) from eDNA for seven species at two sites. The samples were taken over a period of two days. I anticipate some autocorrelation between samples due to ...
1
vote
1
answer
260
views
How to format a random effect (i.e., + 0 vs. + 1) in my glmmTMB models
I am working on creating GLMMs to determine the effect of in-air noise on harbor seals. I have a couple other fixed predictor variables (current velocity and time) and some random effects. As I am ...
1
vote
0
answers
222
views
ar1() or ou() for my glmmTMB models in RStudio?
I am working on creating GLMMs to determine the effect of in-air noise on harbor seals (specifically the number present). I have a couple other fixed predictor variables (current velocity and time) ...
0
votes
1
answer
52
views
PACF built-in plot utils returning different result compared to manual plot
Using packages:
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
from statsmodels.tsa.stattools import acf, pacf
Performing manual and built-in plot utils, give different values. No, I ...
1
vote
0
answers
71
views
adaptive ATR with dominant cycle period
I created a function that computes an adaptive ATR with the period coming from estimations using fft on a certain window. the highpass and supersmoother functions come from Jhon Ehlers work; they ...
1
vote
1
answer
102
views
How to correct error in gamm for modGI hierarchical model (and thus how to visualise and correct for autocorrelation more than AR1 in time series)?
I have blood biochemistry markers measured in 28 subjects, where samples were collected every month.
I can run a simple modG with gamm and get the acf and pacf plots.
modG <- gamm(Met1 ~ s(...
0
votes
1
answer
369
views
Confidence interval for ACF plot
Is it possible to modify the straight-line confidence interval that is automatically displayed in the ACF plot in R? Instead of a straight line (Picture 1), I want the CI to be computed at every point,...
0
votes
1
answer
47
views
Having issues with autocorrelation of a lagged time series in python
I am trying to do a lagged autocorrelation of some data. The data is filled with random nans. The data is an NxN array where eke_array[i,i] is lag zero,...eke_array[i,i+n] is lag n. At some point ...
1
vote
2
answers
746
views
Autocorrelation in GAM (R)
I am fitting a GAM to a time series, to check for any trend and seasonality. I expect my data to be autocorrelated and as I am fitting some models I need to check if there is autocorrelation in the ...
1
vote
1
answer
179
views
How can I apply FFT in the case of vector data?
I wrote the following class to compute autocorrelation of a List of 3d vectors.
I took the formula from this link
public static class AutocorrVec3
{
private static double C(int t, List<Vec3> ...
0
votes
0
answers
58
views
Autocorrelation within day within person in R
I am new to working with multilevel data. I have multilevel data, nested within day within person. I'm working in R, and I need the average autocorrelation of mood within a day for each person. How ...
1
vote
1
answer
205
views
What am I missing in the vector case?
I obtained two sets of data from a Monte Carlo simulation of polymer movement.
One is a list of $r^2_{end-to-end}$,
#r-end-squared
58617.14512069625
55606.1082220041
51244.724846185505
65344....
0
votes
3
answers
415
views
Why am I getting different autocorrelation results from different libraries?
Why am I getting different autocorrelation results from different libraries?
Which one is correct?
import numpy as np
from scipy import signal
# Given data
data = np.array([1.0, 1.25, 1.5, 1.75, 2.0,...
1
vote
0
answers
58
views
What is incorrect in my autocorrelation computation?
In the following source codes, Python and R are giving the same result.
However, C# is giving an incorrect result.
How can I fix the C# code?
Input data:
[1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 3.33]
...
0
votes
0
answers
81
views
Python - Trying to calculate ACF by hand and comparing with acf from statsmodels
I am getting different results when calculating ACF using my own code in 2 versions and acf from statsmodels.
The code is given by the following function where x is the series and lag is the chosen ...
1
vote
0
answers
31
views
Handling missing values in grid-based data for Geary's C
I would like to compute Geary's C or Moran's I indices of spatial autocorrelation for a set of grid-based datasets. I have a bunch of 12x3 grids such as this one:
## Define a 12x3 grid:
loc <- ...
0
votes
0
answers
159
views
Accurate pitch measurement with microcontrollers
My goal is to measure the pitch of my violin with a small computer/microcontroller very accurately (a Raspberry Pi would be too big). I'm aiming for an accuracy of 0.1 Hz; 0.5 Hz could also work. The ...
2
votes
0
answers
422
views
Ljung_box test and its interpretation
I don't understand how to obtain a single test statistic Q and a single p-value, as it happens in software like Gretl, instead of getting all the statistics for each lags.
lb_test = acorr_ljungbox(...
0
votes
0
answers
412
views
Spatial autocorrelation in residuals of spaMM model after controlling for it
I am trying to control for spatial variation which I suspect to be strong in my dataset. I am comparing a linear model from lme4 with 3 explanatory variables - 1 continuous fixed effect, 1 discrete ...
1
vote
1
answer
1k
views
Proper GAM specification in the case of spatial autocorrelation
I am working to understand the effects of spatial predictors (e.g., tree canopy cover, impervious surface cover) on air temperature anomalies in cities. We, and others before, do this with GAMs.
In ...
0
votes
1
answer
523
views
How do I simulate autocorrelated count data in R using arima.sim?
I'm trying to simulate a time series of 25 years of autocorrelated count data in R based on the properties of some observed counts. Through model fitting, I've established that the observed data is AR(...
2
votes
1
answer
308
views
Overhead in parallel tasks in C++
I have the following function:
#include <iostream>
#include <vector>
#include <cmath>
const int numRows = 10000;
const int numCols = 1000;
void myFunc(int tau, const std::vector<...
2
votes
2
answers
229
views
How can I obtain the same result as pandas.autocorr() by numpy?
I need to use numpy functions to replace all Pandas functions, but the Pandas package did not explain well how pd.autocorr() is implemented.
import numpy as np
import pandas as pd
df = pd.DataFrame....
0
votes
0
answers
193
views
GAM correcting for spatial autocorrelation with repeated measurements with a nested block design
I want to model the species counts across a range of environmental conditions (continuous and categorical variables) from a field experiment. Across the area's nested treatment blocks (4 species/block)...
0
votes
0
answers
85
views
Auto-correlation-like algorithm for detecting periods in non-numeric data?
In the past I've used auto-correlation to detect periodic structures in numeric data. This algorithm works even if the data isn't repeated (exact copies) but just follows a general periodic structure. ...
0
votes
1
answer
246
views
R imputation of missing value using autocorrelation
I'm trying to fill in 2 missing values. My lecturer suggests using the results of the largest autocorrelation with the following stages:
Find minimal and maximum data from the dataset. Suppose I use ...
1
vote
3
answers
167
views
error in R when using a for-loop to extract the list of significant coefficients of autocorrelation - time series
I am trying to run a for-loop in order to create a list/ dataframe object that would give me the set of ACF coefficients that are significantly different to 0 (that are outside of the confidence ...
0
votes
1
answer
447
views
How do I suppress random effect but retain AR(1) correlation structure in R's lme mixed model
I am trying to re-create some SAS mixed model analyses using the lme function of R. The following SAS code:
proc mixed data = df noclprint covtest;
class patid visno;
model va = cst va0 cst0 / ...
-1
votes
2
answers
52
views
How can I create a Regex exp for enter button followed by 4digits in a span tag?
Referring to above image I need to create a regex expression in JMeter for correlation of the 4 digit number which is dynamically changing.
Can someone help me to create expression for the same?
I ...
0
votes
1
answer
369
views
Python: Why is FFT giving different results for the same data?
I have a datafile named 'yclip.txt' which is just a 1-column data. The program finds the the gradient of the autocorrelation function (here, dacf) of this data using the function ps.acf_dacf(). It ...
0
votes
0
answers
188
views
How to do spatial autocorrelation for 2 raster data of different spatial resolution
How to create spatial autocorrelation map showing the relation between 2 raster data with different spatial resolution?
I am encountering neighborhood list error after resampling and giving moran test ...
1
vote
0
answers
54
views
How to construct a time vector for autocorrelation?
I computed the Power Spectral Density of a signal Gxx. Then I selected a range of elements and computed the Inverse Fourier Transform of those elements.
How can I construct a time vector for these ...
1
vote
0
answers
92
views
Autocorrelation: Error Message 'lag.max' must be at least 0, even though I set a lag.max
I have a error in R, which I cant repair.
I have a nested dataframe "dfNEST" with ID's and the data from each person.
In the data I have the column "steps", which have some NA's. ...
1
vote
0
answers
306
views
How to account for temporal autocorrelation in beta regression fitted with betareg R package?
I have time series data where I calculated disease severity in plants at different intervals. My response variable is between 0 & 1 (both exclusive), so beta regression seem to be the most ...
0
votes
0
answers
41
views
Freq Response Error "Float Object is not subscriptable"
So I'm currently working on a code for linear prediction, where we apply the various concepts of linear prediction into a raw audio signal
In this code I have m as the len of the audio that i inputted,...
1
vote
0
answers
907
views
How to plot random effects in glmmTMB when modelling autocorrelation of irregular times (covariance structure)
The code below shows how the random effects (intercepts) of mixed models without autocorrelation terms can be extracted and plotted. However, this approach does not work when modelling autocorrelation ...
0
votes
1
answer
1k
views
Autocorrelation function in matlab without using built-in function
I am trying to write a code for the colculate autocorrelation function. Could you suggest what I'm doing wrong.
Thanks in advance
i = 1:199;
U =sin(0.3*i);
sum_1 = 0;
for tau = 1:length(U)...
1
vote
1
answer
187
views
Array Performing XOR On Itself With Offset
Trying to implement an autocorrelation algorithm, meaning, for example:
let exampleData: [Float] = [1, 2, 3, 4, 5]
Trying to find the fastest way to evaluate 1 ^ 2 + 2 ^ 3 + 3 ^ 4 + 4 ^ 5.
...
2
votes
1
answer
2k
views
lme specifying correlation structure for three-level model
I'm new to R and to multilevel modeling. I have a data set where I have a dependent variable y and predictor x, both of which are measured one time per day over a number of days within subjects. In ...
0
votes
0
answers
186
views
Range of partial autocorrelation function
What is the range of the pacf function in python? I'd assumed it'd be [-1,1] like Pearson's correlation and autocorrelation, but on trying on my data, I see it has values like -5.
Can anyone tell me ...
0
votes
1
answer
75
views
Is there a faster way to perform this neighbour finding operation
I'm trying to calculate Moran's I in Python (This is the underlying equation). My inputs are a coords Nx3 array containing the coordinates of each point and a Nx3 array z which contains the values ...
0
votes
0
answers
73
views
Master thesis: Autocorrelation/lagrange test for master thesis in political science
I'm currently trying to detect how many lags I should include in my linear regression analysis in R.
The study is about whether the presence of commercial military actors (CMA) correlates/causes more ...