# inneropt: Inner Optimization Functions In CollocInfer: Collocation Inference for Dynamic Systems

## Description

Estmates coefficients given parameters.

## Usage

 `1` ```inneropt(data,times,pars,coefs,lik,proc,in.meth='nlminb',control.in=list()) ```

## 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', 'trust' or 'SplineEst'. The last calls `SplineEst.NewtRaph`. This is fast but has poor convergence. `control.in` Control object for inner optimization function.

## Details

This minimizes the objective function defined by the addition of the `lik` and `proc` objectives with respect to the coefficients. A number of generic optimization routines can be used and some experimentation is recommended.

## Value

A list with elements

 `coefs` A matrix giving he optimized coefficients. `res` The results of the inner optimization function.

`outeropt`, `Smooth.LS`,`LS.setup`, `multinorm.setup`, `SplineCoefsErr`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31``` ```## Not run: # FitzHugh-Nagumo Equations data(FhNdata) # Some data 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(FhNtimes),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 = inneropt(FhNdata,times=FhNtimes,FhNpars,coefs,lik,proc,in.meth='nlminb') plot(fd(res\$coefs,bbasis)) ## End(Not run) ```