View source: R/fit_vectorfield.R
fit_2d_vf | R Documentation |
Estimate a 2D vector field from intensive longitudinal data. Two methods can be used: Multivariate Vector Field Kernel Estimator (MVKE, using MVKE()
), or Sparse Vector Field Consensus (SparseVFC, using SparseVFC::SparseVFC()
). Note that the input data are automatically normalized before being sent to the estimation engines to make sure the default parameter settings are close to the optimal. Therefore, you do not need to scale up or down the parameters of MVKE()
or SparseVFC::SparseVFC()
. We suggest the MVKE method to be used for psychological data because it has more realistic assumptions and produces more reasonable output.
fit_2d_vf( data, x, y, lims, n = 20, vector_position = "start", na_action = "omit_data_points", method = c("MVKE", "MVKE"), ... )
data |
The data set used for estimating the vector field. Should be a data frame or a matrix. |
x, y |
Characters to indicate the name of the two variables. |
lims |
The limits of the range for the vector field estimation as |
n |
The number of equally spaced points in each axis, at which the vectors are to be estimated. |
vector_position |
Only useful if |
na_action |
One of "omit_data_points" or "omit_vectors". If using "omit_data_points", then only the |
method |
One of "MVKE" or "VFC". |
... |
Other parameters to be passed to |
A vectorfield
object.
plot.vectorfield()
# generate data single_output_grad <- simlandr::sim_fun_grad(length = 200, seed = 1614) # fit the vector field v2 <- fit_2d_vf(single_output_grad, x = "x", y = "y", method = "MVKE") plot(v2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.