Learn R Programming

BoneProfileR (version 4.0)

BP_FitMLCompactness: Estimation of the likelihood of a bone section

Description

Estimation of the model of compactness of a bone section.
The two-steps analysis performs first a quasi-Newton method, then a Bayesian MCMC and finally again a quasi-Newton method. It generally ensures that global minimum is found. On the other hand, it doubles the time to complete.

Usage

BP_FitMLCompactness(
  bone,
  fitted.parameters = c(P = 0.5, S = 0.02, Min = 0.001, Max = 0.999),
  priors = NULL,
  fixed.parameters = c(K1 = 1, K2 = 1),
  twosteps = TRUE,
  replicates.CI = 10000,
  analysis = 1,
  control.optim = list(trace = 1),
  silent = FALSE
)

Value

The -Ln L

Arguments

bone

The bone image to be used

fitted.parameters

Parameters of the model to be fitted

priors

Priors used for intermediate estimations

fixed.parameters

Fixed parameters of the model

twosteps

Does a 2-steps analysis be performed?

replicates.CI

Number of replicates to estimate confidence interval

analysis

Name or rank of analysis

control.optim

The list of options for optim.

silent

Should information be shown?

Author

Marc Girondot marc.girondot@gmail.com

Details

BP_FitMLCompactness estimates likelihood of model of a bone section

See Also

Other BoneProfileR: BP_AutoFit(), BP_ChooseBackground(), BP_ChooseCenter(), BP_ChooseForeground(), BP_DetectBackground(), BP_DetectCenters(), BP_DetectForeground(), BP_DuplicateAnalysis(), BP_EstimateCompactness(), BP_FitBayesianCompactness(), BP_FitBayesianPeriodicCompactness(), BP_FitMLPeriodicCompactness(), BP_FitMLRadialCompactness(), BP_GetFittedParameters(), BP_ListAnalyses(), BP_LnLCompactness(), BP_OpenImage(), BP_Report(), Erinaceus_europaeus, plot.BoneProfileR(), summary.BoneProfileR()

Examples

Run this code
if (FALSE) {
# Not run:
library(BoneProfileR)
 bone <- BP_OpenImage()
 # or, to use the package imager to open a tiff image
 bone <- BP_OpenImage(ijtiff=TRUE)
library(BoneProfileR)
path_Hedgehog <- system.file("extdata", "Erinaceus_europaeus_fem_2-1_small.png", 
                             package = "BoneProfileR")
 bone <- BP_OpenImage(file=path_Hedgehog)
 bone <- BP_DetectBackground(bone=bone, analysis="logistic")
 bone <- BP_DetectForeground(bone=bone, analysis="logistic")
 bone <- BP_DetectCenters(bone=bone, analysis="logistic")
 bone <- BP_EstimateCompactness(bone, analysis="logistic")
 plot(bone, type="mineralized", show.grid=FALSE)
 plot(bone, type="unmineralized", show.grid=FALSE)
 plot(bone, type="section", show.grid=FALSE)
 bone <- BP_FitMLCompactness(bone, analysis="logistic", twosteps=TRUE)
 BP_GetFittedParameters(bone, analysis="logistic", ML=TRUE, return.all=FALSE)
 plot(bone)
 plot(bone, type="observations")
 plot(bone, type="observations+model", analysis=1)
 bone <- BP_DuplicateAnalysis(bone, from="logistic", to="flexit")
 fittedpar <- BP_GetFittedParameters(bone, analysis="logistic", ML=TRUE, return.all=FALSE)[, "mean"]
 bone <- BP_DuplicateAnalysis(bone, from="logistic", to="flexit")
 BP_ListAnalyses(bone)
 bone <- BP_FitMLCompactness(bone, 
                fitted.parameters=c(fittedpar, K1=1, K2=1), 
                fixed.parameters=NULL, analysis="flexit", twosteps=TRUE)
 compare_AIC(Logistic=BP_GetFittedParameters(bone, analysis="logistic", , ML=TRUE, return.all=TRUE), 
             Flexit=BP_GetFittedParameters(bone, analysis="flexit", , ML=TRUE, return.all=TRUE))
 out4p <- plot(bone, type="observations+model", analysis="logistic")
 out6p <- plot(bone, type="observations+model", analysis="flexit")
}

Run the code above in your browser using DataLab