% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/drivermaps_loglik.R
\name{optifix}
\alias{optifix}
\title{optifix. Optimise with fixed parameters}
\usage{
optifix(
  par,
  fixed,
  fn,
  gr = NULL,
  ...,
  method = c("Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN"),
  lower = -Inf,
  upper = Inf,
  control = list(),
  hessian = FALSE
)
}
\arguments{
\item{par}{Initial values for the parameters to be optimized.}

\item{fixed}{Logical or index vector indicating fixed parameters.}

\item{fn}{Function to be minimized.}

\item{gr}{Optional gradient function.}

\item{...}{Additional arguments passed to \code{fn} and \code{gr}.}

\item{method}{Optimization method.}

\item{lower}{Lower bounds for parameters.}

\item{upper}{Upper bounds for parameters.}

\item{control}{Control parameters passed to optimization.}

\item{hessian}{Logical; whether to return the Hessian matrix.}
}
\description{
its like optim, but with fixed parameters.
}
\details{
specify a second argument 'fixed', a vector of TRUE/FALSE values.
If TRUE, the corresponding parameter in fn() is fixed. Otherwise its
variable and optimised over.

The return thing is the return thing from optim() but with a couple of extra
bits - a vector of all the parameters and a vector copy of the 'fixed' argument.

Written by Barry Rowlingson <b.rowlingson@lancaster.ac.uk> October 2011

This file released under a CC By-SA license:
http://creativecommons.org/licenses/by-sa/3.0/

and must retain the text: "Originally written by Barry Rowlingson" in comments.
}
