Skip to content

Scaling arguments: pc.biplot, obs.scale, var.scale #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hphillips97 opened this issue Jan 8, 2025 · 0 comments
Open

Scaling arguments: pc.biplot, obs.scale, var.scale #4

hphillips97 opened this issue Jan 8, 2025 · 0 comments

Comments

@hphillips97
Copy link

hphillips97 commented Jan 8, 2025

Variable arrows - pc.biplot

The documentation states that when argument pc.biplot = TRUE, this should scale the observations up by sqrt(n) and scale the variables scaled down by sqrt(n). However, looking at the source, only the observations are scaled, but not the variables:

if (pc.biplot) {
    df.u <- df.u * nobs.factor
}

If this is to be inline with the documentation, I believe this should be:

if (pc.biplot) {
    df.u <- df.u * nobs.factor
    df.v <- df.v / nobs.factor
}

However, I can see that df.v later gets scaled in a completely different way, regardless of whether pc.biplot = TRUE. Perhaps I'm missing something.

Scale - obs.scale and var.scale

The documentation also states the scale factor α allows the variances of the components to be apportioned between the row
points and column vectors by representing the approximation X as X = (U Λ^α) (Λ^(1−α) V^T).

The default value for the scale argument is 1 as expected. However, the default value for obs.scale = 1 - scale and var.scale = scale.

It looks like the two default values for obs.scale and var.scale should be swapped? At least that's how I would interpret it from the documentation.

@hphillips97 hphillips97 changed the title Scaling issues with arguments: pc.biplot, obs.scale, var.scale Scaling issues arguments: pc.biplot, obs.scale, var.scale Jan 9, 2025
@hphillips97 hphillips97 changed the title Scaling issues arguments: pc.biplot, obs.scale, var.scale Scaling arguments: pc.biplot, obs.scale, var.scale Jan 9, 2025
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

No branches or pull requests

1 participant