x 및 y 좌표가있는 두 개의 열이있는 행렬이 있습니다. 나는 평균 제곱 변위 - 모든 시간 간격이 동일하다고 가정 할 때, 주어진 시간 동안 시작 지점에서 다른 지점으로 이동 한 제곱 거리를 계산하고 싶다.균일하지 않은 시간 간격으로 MSD 계산
그래서 작업 수식은 다음
MSD=average(r(t)-r(0))^2 where r(t) is position at time t and r(0) is position at time 0.
mat
#Create a vector to save the square of the distance between successive
#locations
distsq<- numeric(length=nrow(mat))
#Calculate and assign these values
for (i in 2:nrow(mat))
{
distsq[i]<-((mat[i,1]-mat[i-1,1])^2)+((mat[i,2]-mat[i-1,2])^2)
}
#Calculate the mean sq distance for this value of n
MSD[k]<- mean(distsq)
는 x 및 y 값의 행렬이다.
따라서이 공식은 2 개의 연속 점 사이의 시간이 일정 할 때 작동합니다. 그러나 매 2 개의 좌표 사이의 시간이 다르다고 가정하면 MSD를 계산하기 위해 해당 구성 요소를 어떻게 통합 할 수 있습니까?
적절한 처리가 특정 애플리케이션에 의존 할 수있다. –
"point-point_before"정보 이상을 사용할 수 있습니다. http://web.mit.edu/savin/Public/.Tutorial_v1.2/Concepts.html#A1 – dani