state_space_distances_for_sve: State Space Distance Matrix for Single View Embedding

View source: R/state_space_distances_for_sve.R

state_space_distances_for_sveR Documentation

State Space Distance Matrix for Single View Embedding

Description

Given a state-space reconstruction, return the distances between focal points (rows) and each candidate nearest neighbour, having ruled out non-candidate potential neighbours. Adapted from 'state_space_distances()'.

Usage

state_space_distances_for_sve(ssr)

Arguments

ssr

[matrix()] a state space reconstruction in which the rows are points in the state space, each row is a time

Value

[matrix()] of allowed neighbour distances, rows corresponding to focal point time, columns to neighbour point time. The value represents the distance from the focal point to the neighbour point. Disallowed focal point and neighbour combinations have value NA. Original 'state_space_distances()' had an upper triangular matrix to exclude future points, but not doing that here – want to utilise the full state-space reconstruction.

Author(s)

Luke A. Rogers

Examples

## Not run: 
# From vignette:
simulated <- EDMsimulate::salmon_sim()
ssr_5 <- state_space_reconstruction_for_sve(data = simulated[1:15, ], lags = list(S_t = 1))
# TODO - correc this after correcting function, need to better deal with
  neighbours that don't hav a projection - hadn't thought of possibility of
  being the final row.

# So no lag of 0, so final row is complete, so distances come out with only
  NA's in first column and first row, not final row like when we have a lag
  of 0 --- may be wrong once correct it).
ssr_5
So just the S_t_s_1 column, which is correct.
'distances_5 <- state_space_distances_for_sve(ssr_5)

## End(Not run)


luke-a-rogers/pbsedm documentation built on June 3, 2024, 5:20 a.m.