Description Usage Arguments Details Value Examples

Compute the Frechet mean between two curves.

1 | ```
meanFrechet2(Px, Py, Qx, Qy, timeScale = 0.1, FrechetSumOrMax = "sum", weightPQ = c(1,1))
``` |

`Px` |
[ |

`Py` |
[ |

`Qx` |
[ |

`Qy` |
[ |

`timeScale` |
[ |

`FrechetSumOrMax` |
[ |

`weightPQ` |
[ |

Given two curve P and Q

The Frechet distance between P and Q is define as

`distFrechet(P,Q)=inf_{a,b} max_{t} d(P(a(t)),Q(b(t)))`

.The Frechet path is the couple of function

`(a(t),b(t))`

that realize the equality of the Frechet distance:`distFrechet(P,Q)=max_{t} d(P(a(t)),Q(b(t)))`

Frechet mean is the curve define by the sequence of all the center of the segments define by the Frechet path

`[a(t),b(t)]`

. If P and Q have respectively weight p and q, the center is the weighted mean of the segments : $c(t)=(p.a(t)+q.b(t))/(p+q)$.

The Frechet distance, path and means can also be define using a sum instead of a max.

A numeric value.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
traj <- matrix(0,4,5)
traj[1,2] <- 10
traj[2,3] <- 11
traj[3,4] <- 10
traj[4,2] <- 8
matplot(x=1:5,y=t(traj),type="l",col=2:5,lty=1)
m12 <- meanFrechet2(Px=1:5,Py=traj[1,],Qx=1:5,Qy=traj[2,])
m34 <- meanFrechet2(Px=1:5,Py=traj[3,],Qx=1:5,Qy=traj[4,])
lines(m12,col=2,lwd=3)
lines(m34,col=2,lwd=3)
m1234 <- meanFrechet2(Px=m12$times,Py=m12$traj,Qx=m34$times,Qy=m34$traj)
lines(m1234,col=1,lwd=5)
``` |

kmlShape documentation built on May 29, 2017, 10:19 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.