- Reworking code to allow standard format for:

- evaluating likelihood, –
**Done** - fitting by maximum-likelihood, –
**Done** - simulating, –
**Done** - bootstrapping
- plotting models and bootstrap results.

changePt.sim, changePt.lik implemented.

#### Function Behavior notes

R’s mle function wants a named list.

Updated parameter handling of OU.lik to allow parameters in alpha,theta,sigma format or theta1, theta2, theta3 format, as either lists or numerics, named or unnamed. Type handling in each function isn’t helping the speed, but optimization will have to wait.

- *Note:* Considered allowing for a generalized change-point function, taking two separate models and splitting them over a changepoint. No obvious way to handle which parameters are global and which are local when the models can differ in their parameter structure though, so not simply generalizable and abstract.

### Logic for model analysis

Collection of different models, each with a suite of associated methods. Current models are:

- OU
- Warning, a linear change in alpha
- ChangePt, a discrete jump in alpha

Methods

- simulate
- evaluate likelihood
- fit by likelihood
- bootstrap parameter estimates
- bootstrap model choice (Neyman-Pearson)
- plotting functions for: simulation, parameter bootstrap, model choice, model value fit expected value over time-series

#### Challenges

Trouble getting convergence for maximum likelihood fits to simulation results. By throwing inf log likelihood with out-of-bounds parameters (should really set a limit epsilon rather than zero on alpha/sigma values using “L-BFGS-B” method) can avoid hard errors in optim, but mle throws hard errors and optim complains about convergence: “ERROR: ABNORMAL_TERMINATION_IN_LNSRCH”, a convergence error of 52 in “L-BFGS-B” method.