Skip to main content
deleted 3 characters in body
Source Link
corey979
  • 24.3k
  • 7
  • 60
  • 105

I defined a function with nn terms where nn is a variable:

LogLH[μ_, σ_] = n Log[a[σ]] - Sum[Log[y[[i]]] +  
(Log[y[[i]]] - μ)^2 / (2 σ^2), {i, 1, n}]

In this function, the y[[i]]y[[i]] are (assumed to represent) observations of a quantity - picked from a list of nn elements.

This statement multiply produces the error "The expression i cannot be used as a part specification". It seems however, that M. correctly evaluates the function. M. also computes the partial derivatives for [Mu]μ and [Sigma]σ. But the above errors repeat and lateron, I can not apply the Solve command to the resulting system of equations. Hence my question: How can I define an open ended list of n elements in M.?

I defined a function with n terms where n is a variable:

LogLH[μ_, σ_] = n Log[a[σ]] - Sum[Log[y[[i]]] +  
(Log[y[[i]]] - μ)^2 / (2 σ^2), {i, 1, n}]

In this function, the y[[i]] are (assumed to represent) observations of a quantity - picked from a list of n elements.

This statement multiply produces the error "The expression i cannot be used as a part specification". It seems however, that M. correctly evaluates the function. M. also computes the partial derivatives for [Mu] and [Sigma]. But the above errors repeat and lateron, I can not apply the Solve command to the resulting system of equations. Hence my question: How can I define an open ended list of n elements in M.?

I defined a function with n terms where n is a variable:

LogLH[μ_, σ_] = n Log[a[σ]] - Sum[Log[y[[i]]] +  
(Log[y[[i]]] - μ)^2 / (2 σ^2), {i, 1, n}]

In this function, the y[[i]] are (assumed to represent) observations of a quantity - picked from a list of n elements.

This statement multiply produces the error "The expression i cannot be used as a part specification". It seems however, that M. correctly evaluates the function. M. also computes the partial derivatives for μ and σ. But the above errors repeat and lateron, I can not apply the Solve command to the resulting system of equations. Hence my question: How can I define an open ended list of n elements in M.?

deleted 29 characters in body
Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k

I defined a function with n terms where n is a variable:

LogLH[\[Mu]_LogLH[μ_, \[Sigma]_]σ_] = n Log[a[\[Sigma]]]Log[a[σ]] - Sum[Log[y[[i]]] +  
(Log[y[[i]]] - \[Mu]μ)^2 / (2 \[Sigma]^2σ^2), {i, 1, n}]

In this function, the y[[i]] are (assumed to represent) observations of a quantity - picked from a list of n elements.

This statement multiply produces the error "The expression i cannot be used as a part specification". It seems however, that M. correctly evaluates the function. M. also computes the partial derivatives for [Mu] and [Sigma]. But the above errors repeat and lateron, I can not apply the Solve command to the resulting system of equations. Hence my question: How can I define an open ended list of n elements in M.?

I defined a function with n terms where n is a variable:

LogLH[\[Mu]_, \[Sigma]_] = n Log[a[\[Sigma]]] - Sum[Log[y[[i]]] +  
(Log[y[[i]]] - \[Mu])^2 / (2 \[Sigma]^2), {i, 1, n}]

In this function, the y[[i]] are (assumed to represent) observations of a quantity - picked from a list of n elements.

This statement multiply produces the error "The expression i cannot be used as a part specification". It seems however, that M. correctly evaluates the function. M. also computes the partial derivatives for [Mu] and [Sigma]. But the above errors repeat and lateron, I can not apply the Solve command to the resulting system of equations. Hence my question: How can I define an open ended list of n elements in M.?

I defined a function with n terms where n is a variable:

LogLH[μ_, σ_] = n Log[a[σ]] - Sum[Log[y[[i]]] +  
(Log[y[[i]]] - μ)^2 / (2 σ^2), {i, 1, n}]

In this function, the y[[i]] are (assumed to represent) observations of a quantity - picked from a list of n elements.

This statement multiply produces the error "The expression i cannot be used as a part specification". It seems however, that M. correctly evaluates the function. M. also computes the partial derivatives for [Mu] and [Sigma]. But the above errors repeat and lateron, I can not apply the Solve command to the resulting system of equations. Hence my question: How can I define an open ended list of n elements in M.?

Source Link

List with n elements where n is a variable

I defined a function with n terms where n is a variable:

LogLH[\[Mu]_, \[Sigma]_] = n Log[a[\[Sigma]]] - Sum[Log[y[[i]]] +  
(Log[y[[i]]] - \[Mu])^2 / (2 \[Sigma]^2), {i, 1, n}]

In this function, the y[[i]] are (assumed to represent) observations of a quantity - picked from a list of n elements.

This statement multiply produces the error "The expression i cannot be used as a part specification". It seems however, that M. correctly evaluates the function. M. also computes the partial derivatives for [Mu] and [Sigma]. But the above errors repeat and lateron, I can not apply the Solve command to the resulting system of equations. Hence my question: How can I define an open ended list of n elements in M.?