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 sdemodel().

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 x, t, unit.

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

'nls' for non-hierarchical models (default). For hierarchical models it can be 'nls', for fixed locals, or 'nlme' for mixed effects.

control

Optional control list for nls() or nlme().

phi

Optional transformation function. If NULL (default), it is automatically generated.

phiprime

Optional derivative function. If NULL (default), it is automatically generated.

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))

[Package resde version 1.1 Index]