Skip to content

Fiml meanstructure argument#304

Merged
Maximilian-Stefan-Ernst merged 3 commits intodevelfrom
fiml_meanstructure_argument
Feb 13, 2026
Merged

Fiml meanstructure argument#304
Maximilian-Stefan-Ernst merged 3 commits intodevelfrom
fiml_meanstructure_argument

Conversation

@Maximilian-Stefan-Ernst
Copy link
Collaborator

No description provided.

Comment on lines +38 to +40
throw(ArgumentError(
"You set `meanstructure = true`, but your model specification contains no mean parameters."
))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
throw(ArgumentError(
"You set `meanstructure = true`, but your model specification contains no mean parameters."
))
throw(
ArgumentError(
"You set `meanstructure = true`, but your model specification contains no mean parameters.",
),
)

Comment on lines +43 to +45
throw(ArgumentError(
"If your model specification contains mean parameters, you have to set `Sem(..., meanstructure = true)`."
))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
throw(ArgumentError(
"If your model specification contains mean parameters, you have to set `Sem(..., meanstructure = true)`."
))
throw(
ArgumentError(
"If your model specification contains mean parameters, you have to set `Sem(..., meanstructure = true)`.",
),
)

"If your model specification contains mean parameters, you have to set `Sem(..., meanstructure = true)`."
))
end
end No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
end


function SemFIML(; observed::SemObservedMissing, specification, kwargs...)
function SemFIML(; observed::SemObservedMissing, implied, specification, kwargs...)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Comment on lines +49 to +51
throw(ArgumentError(
"Full information maximum likelihood (FIML) can only be used with a meanstructure.
Did you forget to set `Sem(..., meanstructure = true)`?"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
throw(ArgumentError(
"Full information maximum likelihood (FIML) can only be used with a meanstructure.
Did you forget to set `Sem(..., meanstructure = true)`?"))
throw(
ArgumentError(
"Full information maximum likelihood (FIML) can only be used with a meanstructure.
Did you forget to set `Sem(..., meanstructure = true)`?",
),
)

observed_var_prefix::Union{Symbol, AbstractString} = :obs,
kwargs...,
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Comment on lines +47 to +56
throw(ArgumentError(
"Your dataset contains missing values.
Remove missing values or use full information maximum likelihood (FIML) estimation.
A FIML model can be constructed with
Sem(
...,
observed = SemObservedMissing,
loss = SemFIML,
meanstructure = true
)"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
throw(ArgumentError(
"Your dataset contains missing values.
Remove missing values or use full information maximum likelihood (FIML) estimation.
A FIML model can be constructed with
Sem(
...,
observed = SemObservedMissing,
loss = SemFIML,
meanstructure = true
)"))
throw(
ArgumentError(
"Your dataset contains missing values.
Remove missing values or use full information maximum likelihood (FIML) estimation.
A FIML model can be constructed with
Sem(
...,
observed = SemObservedMissing,
loss = SemFIML,
meanstructure = true
)",
),
)


@testset "Sem(implied=$impliedtype, loss=$losstype)" for impliedtype in (RAM, RAMSymbolic),
losstype in (SemML, SemWLS)
@testset "Sem(implied=$impliedtype, loss=SemML)" for impliedtype in (RAM, RAMSymbolic)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@testset "Sem(implied=$impliedtype, loss=SemML)" for impliedtype in (RAM, RAMSymbolic)

@test @inferred(nsamples(model)) == nsamples(obs)
end

@testset "Sem(implied=RAMSymbolic, loss=SemWLS)" begin

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@testset "Sem(implied=RAMSymbolic, loss=SemWLS)" begin

semloss = loss(model).functions[1]
@test semloss isa SemWLS

@test @inferred(nsamples(model)) == nsamples(obs)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@test @inferred(nsamples(model)) == nsamples(obs)
end

@Maximilian-Stefan-Ernst Maximilian-Stefan-Ernst merged commit 9997387 into devel Feb 13, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments