| plot_target | R Documentation |
This function plots a 3-D surface of the nonlinear least squares (NLS) target function used in estimating a PSTR model. It is mainly intended as a diagnostic tool for choosing reasonable initial values for the nonlinear parameters.
plot_target(
obj,
im = 1,
iq = NULL,
par = NULL,
basedon = c(1, 2),
from,
to,
length.out = 40
)
obj |
An object of class |
im |
Integer. The number of switches |
iq |
Either an integer index (a column number in the transition-variable matrix) or a character string (a transition-variable name) specifying which transition variable is used when computing the target function. |
par |
Numeric vector of length |
basedon |
Integer vector of length |
from |
Numeric vector of length |
to |
Numeric vector of length |
length.out |
Either a scalar or a numeric vector of length |
The target function is evaluated on a two-dimensional grid over two selected parameters,
while all other nonlinear parameters are held fixed at values provided by par.
The nonlinear parameter vector is always ordered as
\delta, c_1, \ldots, c_m, where \gamma = \exp(\delta) and m = im.
In addition to the exported function plot_target(obj = ...), the same functionality
is available as an R6 method via obj$plot_target(...).
A plotly object representing a 3-D surface plot of the target function
values evaluated on the specified parameter grid.
NewPSTR, LinTest, WCB_LinTest,
EstPSTR, EvalTest, WCB_TVTest,
WCB_HETest
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20,
indep_k = c("vala", "debta", "cfa", "sales"),
tvars = c("vala"), iT = 14)
# 1) Exported function interface
ret <- plot_target(obj = pstr, iq = 1, basedon = c(1, 2),
from = c(log(1), 6), to = c(log(18), 10),
length.out = c(40, 40))
# 2) R6 method interface
ret2 <- pstr$plot_target(iq = 1, basedon = c(1, 2),
from = c(log(1), 6), to = c(log(18), 10),
length.out = c(40, 40))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.