predDfuncs: predDfuncs - Predict distance functions

View source: R/predDfuncs.R

predDfuncsR Documentation

predDfuncs - Predict distance functions

Description

An internal prediction function to predict a distance function. This version allows for matrix inputs and uses matrix operations, and is thus faster than earlier looping versions.

Usage

predDfuncs(object, params, distances, isSmooth)

Arguments

object

An Rdistance model frame or fitted distance function, normally produced by a call to dfuncEstim.

params

A matrix of distance function parameters. Rows are observations, columns contain the set of parameters (canonical and expansion) for each observation.

distances

A vector or 1-column matrix of distances at which to evaluate distance functions, when distance functions are requested. distances must have measurement units. Any distances outside the observation strip (object$w.lo to object$w.hi) are discarded. If distances is NULL, a sequence of getOption("Rdistance_intEvalPts") (default 101) evenly spaced distances between object$w.lo and object$w.hi (inclusive) is used.

isSmooth

Logical. TRUE if the distance function is smoothed (and hence has no parameters).

Value

A matrix of distance function values, of size length(distances) X nrow(params). Each row of params is associated with a column, i.e., a different distance function. Distances are associated with rows, i.e., use matplot(d,return) to plot values on separate distance functions specified by rows of params.


Rdistance documentation built on April 12, 2025, 1:12 a.m.