Description Usage Arguments Details Value Author(s) See Also Examples
This function plots the surface of the target function for the nonlinear least square estimation. It is useful for finding the suitable initial value for the estimation.
1 2 | plot_target(obj, im = 1, iq = NULL, par = NULL, basedon = c(1, 2),
from, to, length.out = 40)
|
obj |
an object of the class PSTR returned from some functions in the package. |
im |
specifies the number of switches in the transtion function. The default value is 1. |
iq |
a column number (in |
par |
a vector of the values of the parameters. NULL by default, then it will be made automatically. |
basedon |
an integer vector of length 2 specify which two parameters to use to build the grid. |
from |
a vector of length 2 of the starting (minimal) values of the parameters. |
to |
a vector of length 2 of the end (maximal) values of the parameters. |
length.out |
a 2-dim vector or scalar of desired length (number of points) for the parameters. 40 by default. |
The funciton uses the plotly
package to plot the 3-D surface of the target function for the nonlinear least square estimation.
The function takes the PSTR object as one of the inputs. The user needs to give the number of switches im
, and the transition variable iq
,
such that the target function values can be computed.
The number of parameters to estimate in the nonlinear least square estimation is 1+im
, that is, one smoothness parameter and the im
switching locations.
However, the 3-D plot is based on only two changing parameters with the others (if more than two parameters) constant. Thus, the user needs to input a vector par
,
which gives the values of the other parameters. Note that par
should still be of length 1+im
with the order δ (always use delta in this function),
c_1, ..., c_m.
The user should give the vector basedon
of length two, that shows which two parameters will be used to build the grid.
basedon
gives the positions of the two parameters in par
. Thus, the values in the positions basedon
in par
will not be used.
from
, to
and length.out
serve to build the grid for the two parameters.
These arguments must be of length two for the two parameters, respectively.
See the seq
function for the details.
A plottable object from the plotly
package.
Yukai Yang, yukai.yang@statistik.uu.se
Functions which return an object of the class PSTR and can be input into this function
NewPSTR
, LinTest
, WCB_LinTest
, EstPSTR
, EvalTest
, WCB_TVTest
and WCB_HETest
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.