sdefit {resde} | R Documentation |
Fit SDE model
Description
ML estimation of parameters for a reducible SDE
Usage
sdefit(model, x, t, unit=NULL, data=NULL, start=NULL,
global=NULL, local=NULL, known=NULL, method="nls",
control=NULL, phi=NULL, phiprime=NULL)
Arguments
model |
Model specification, as produced by |
x , t |
Vectors with variables, or names of columns in data frame. |
unit |
If applicable, unit id vector, or name of its column in data frame. |
data |
Data frame, if data not given directly in |
start |
Named vector or named list with starting parameter values for non-hierarchical models. They can also be given in global. |
global |
Named vector or list of global parameters and their starting values for hierarchical models. Can also contain starting values for non-hierarchical models. |
local |
Named vector or list of local parameters and their starting values for hierarchical models. The value can be a vector with values for each unit, or a single scalar that applies to all the units. |
known |
Named vector or list with any parameters that should be fixed at given values. |
method |
|
control |
Optional control list for |
phi |
Optional transformation function. If |
phiprime |
Optional derivative function. If |
Value
List with two components: a list fit
containing the output from
the optimizer (nls
or nlme
), and a list more
containing
sigma estimates, log-likelihood, AIC and BIC. Note that in fit
, "residual sum-of-squares"
corresponds to uvector
, not to x
or y
. Same for nls
and nlme
methods like fitted
or residuals
applied to fit
.
Examples
m <- sdemodel(phi=~x^c, beta0=~b*a^c, beta1=~-b)
mod1 <- sdefit(m, "height", "age", data=Loblolly[Loblolly$Seed=="301",],
start=c(a=70, b=0.1, c=1))
mod2 <- sdefit(m, "height", "age", "Seed", Loblolly, global=c(b=0.1, c=0.5),
local=c(a=72))