outeropt {CollocInfer}R Documentation

Outer Optimization Functions

Description

Outer optimization; performs profiled estimation.

Usage

outeropt(data,times,pars,coefs,lik,proc,
      in.meth='nlminb',out.meth='nlminb',
      control.in=list(),control.out=list(),active=1:length(pars))

Arguments

data

Matrix of observed data values.

times

Vector observation times for the data.

pars

Initial values of parameters to be estimated processes.

coefs

Vector giving the current estimate of the coefficients in the spline.

lik

lik object defining the observation process.

proc

proc object defining the state process.

in.meth

Inner optimization function currently one of 'nlminb', 'maxNR', 'optim' or 'SplineEst'. The last calls SplineEst.NewtRaph. This is fast but has poor convergence.

out.meth

Outer optimization function to be used, one of 'optim' (defaults to BFGS routine in optim unless control.out$meth specifies otherwise), 'nlminb', 'maxNR' #, 'trust' or 'subplex'. When squared error is being used, 'ProfileGN' and 'nls' can also be given. The former of these calls Profile.GausNewt, a fast but naive Gauss-Newton solver.

control.in

Control object for inner optimization function.

control.out

Control object for outer optimization function.

active

Indices indicating which parameters of pars should be estimated; defaults to all of them.

Details

The outer optimization for parameters looks only at the objective defined by the lik object. For every parameter value, coefs are optimized by inneropt and then the value of lik for these coefficients is computed.

A number of optimization routines can be used here, some experimentation is recommended. Libraries for these optimization routines are not pre-loaded. Where these functions take options as explicit arguments instead of a list, they should be listed in control.out and will be called by their names.

The routine creates temporary files 'curcoefs.tmp' and 'optcoefs.tmp' to update coefficients as pars evolves. These overwrite existing files of those names and are deleted before the function terminates.

Value

A list containing

pars

Optimized parameters

coefs

Optimized coefficients at pars

res

The result of the outer optimization.

counter

A set of parameters and objective values for each successful iteration.

See Also

inneropt, Profile.LS, ProfileSSE, ProfileErr, LS.setup, multinorm.setup

Examples


## Not run: 
data(FhNdata)

knots = seq(0,20,0.2)         # Create a basis
norder = 3
nbasis = length(knots) + norder - 2
range = c(0,20)

bbasis = create.bspline.basis(range=range,nbasis=nbasis,norder=norder,breaks=knots)

lambda = 10000               # Penalty value

DEfd = smooth.basis(FhNtimes,FhNdata,fdPar(bbasis,1,0.5))   # Smooth to estimate
                                                            # coefficients first
coefs = DEfd$fd$coefs
colnames(coefs) = FhNvarnames

profile.obj = LS.setup(pars=FhNpars,coefs=coefs,fn=make.fhn(),basisvals=bbasis,
      lambda=lambda,times=FhNtimes)

lik = profile.obj$lik
proc= profile.obj$proc

res = outeropt(data=FhNdata,times=FhNtimes,pars=FhNpars,coefs=coefs,lik=lik,proc=proc,
    in.meth="nlminb",out.meth="nlminb",control.in=NULL,control.out=NULL)


plot(res$coefs,main='outeropt')
print(blah)

## End(Not run)

[Package CollocInfer version 1.0.4 Index]