Search code examples
mathematical-optimizationjulia

Julia: How to find a list of the elements of a Composite Type


Let's say we are using the rosenbrock function in the Optim package designed by John Myles White. Could someone tell me where I would find the attributes/methods returned from this function?

f(x)=(1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2
a=optimize(f, [0.0, 0.0])
attributes(a)

I am primarily interested in grabbing the optimized values to create a distribution of values to test for bias, approximate standard errors (in a data sample with a estimated statistics), etc.


Solution

  • Okay, so I found the following by delving into how White created the benchmarks for the package.

    >a.minimum
    2-element Array{Float64,1}:
    1.00001
    1.00001
    

    I have also found

    >a.iterations
    60
    

    However, reading over Composite Types again I am still not sure how to find the list of elements of composite types.