text:
# Using diagnostic plots in order to decide variables to set up multiple linear regression - R

I'm working with a baseball dataset using R. The dataset contains the baseball season records for teams between the years 1871 and 2016. One of the columns has the number of wins for the season and all the other variables have other information like the number of stolen bases or number of home runs.

I'm trying to create a multiple linear regression. The dependent variable will be the number of wins for the season and the predictor variables will be some of the other columns in the dataset.

My questions are - How do I decide on which independent variables to use and also are diagnostic plots useful in deciding which columns to use as the independent variables in the multiple linear regression?

Here is a dput sample of my dataset:

dput(head(moneyball_training_data))

structure(list(INDEX = 1:6, TARGET_WINS = c(39L, 70L, 86L, 70L,
82L, 75L), TEAM_BATTING_H = c(1445L, 1339L, 1377L, 1387L, 1297L,
1279L), TEAM_BATTING_2B = c(194L, 219L, 232L, 209L, 186L, 200L
), TEAM_BATTING_3B = c(39L, 22L, 35L, 38L, 27L, 36L), TEAM_BATTING_HR = c(13L,
190L, 137L, 96L, 102L, 92L), TEAM_BATTING_BB = c(143L, 685L,
602L, 451L, 472L, 443L), TEAM_BATTING_SO = c(842L, 1075L, 917L,
922L, 920L, 973L), TEAM_BASERUN_SB = c(NA, 37L, 46L, 43L, 49L,
107L), TEAM_BASERUN_CS = c(NA, 28L, 27L, 30L, 39L, 59L), TEAM_BATTING_HBP = c(NA_integer_,
NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_
), TEAM_PITCHING_H = c(9364L, 1347L, 1377L, 1396L, 1297L, 1279L
), TEAM_PITCHING_HR = c(84L, 191L, 137L, 97L, 102L, 92L), TEAM_PITCHING_BB = c(927L,
689L, 602L, 454L, 472L, 443L), TEAM_PITCHING_SO = c(5456L, 1082L,
917L, 928L, 920L, 973L), TEAM_FIELDING_E = c(1011L, 193L, 175L,
164L, 138L, 123L), TEAM_FIELDING_DP = c(NA, 155L, 153L, 156L,
168L, 149L)), row.names = c(NA, 6L), class = "data.frame")

For every single variable in the dataset I created a simple linear model - just one independent variable and one dependent variable.

Here you can also see the code I created to make diagnostic plots, specifically on one hand the fitted values vs. the residuals and on the other hand a histogram of the residuals.

Am I on the right track? If I go through all these diagnostic plots in order to check for homoscedasticity, etc, and only include the columns that have a good linear relationship to the dependent variable and combine them together, did I do it right in setting up my multiple linear regression?

For example, I see that when I create a linear model of number of stolen bases on the x and number of wins on the y, and I create diagnostic plots and see that the histogram of residuals for this linear model looks normally distributed... then I can include the variable 'number of stolen bases' in my multiple linear regression model that I'm creating... and then look to other variables to see what else I can include?

TEAM_BATTING_H_linear_model <- lm(TARGET_WINS ~ TEAM_BATTING_H, moneyball_training_data)

ggplot(data = TEAM_BATTING_H_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_BATTING_H_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_BATTING_2B_linear_model <- lm(TARGET_WINS ~ TEAM_BATTING_2B, moneyball_training_data)

ggplot(data = TEAM_BATTING_2B_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_BATTING_2B_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_BATTING_3B_linear_model <- lm(TARGET_WINS ~ TEAM_BATTING_3B, moneyball_training_data)

ggplot(data = TEAM_BATTING_3B_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_BATTING_3B_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_BATTING_HR_linear_model <- lm(TARGET_WINS ~ TEAM_BATTING_HR, moneyball_training_data)

ggplot(data = TEAM_BATTING_HR_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_BATTING_HR_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_BATTING_BB_linear_model <- lm(TARGET_WINS ~ TEAM_BATTING_BB, moneyball_training_data)

ggplot(data = TEAM_BATTING_BB_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_BATTING_BB_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_BATTING_SO_linear_model <- lm(TARGET_WINS ~ TEAM_BATTING_SO, moneyball_training_data)

ggplot(data = TEAM_BATTING_SO_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_BATTING_SO_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_BASERUN_SB_linear_model <- lm(TARGET_WINS ~ TEAM_BASERUN_SB, moneyball_training_data)

ggplot(data = TEAM_BASERUN_SB_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_BASERUN_SB_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_BASERUN_CS_linear_model <- lm(TARGET_WINS ~ TEAM_BASERUN_CS, moneyball_training_data)

ggplot(data = TEAM_BASERUN_CS_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_BASERUN_CS_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_BATTING_HBP_linear_model <- lm(TARGET_WINS ~ TEAM_BATTING_HBP, moneyball_training_data)

ggplot(data = TEAM_BATTING_HBP_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_BATTING_HBP_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_PITCHING_H_linear_model <- lm(TARGET_WINS ~ TEAM_PITCHING_H, moneyball_training_data)

ggplot(data = TEAM_PITCHING_H_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_PITCHING_H_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_PITCHING_HR_linear_model <- lm(TARGET_WINS ~ TEAM_PITCHING_HR, moneyball_training_data)

ggplot(data = TEAM_PITCHING_HR_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_PITCHING_HR_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_PITCHING_BB_linear_model <- lm(TARGET_WINS ~ TEAM_PITCHING_BB, moneyball_training_data)

ggplot(data = TEAM_PITCHING_BB_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_PITCHING_BB_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_PITCHING_SO_linear_model <- lm(TARGET_WINS ~ TEAM_PITCHING_SO, moneyball_training_data)

ggplot(data = TEAM_PITCHING_SO_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_PITCHING_SO_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_FIELDING_E_linear_model <- lm(TARGET_WINS ~ TEAM_FIELDING_E, moneyball_training_data)

ggplot(data = TEAM_FIELDING_E_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_FIELDING_E_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

TEAM_FIELDING_DP_linear_model <- lm(TARGET_WINS ~ TEAM_FIELDING_DP, moneyball_training_data)

ggplot(data = TEAM_FIELDING_DP_linear_model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed") +
xlab("Fitted values") +
ylab("Residuals") +
labs(title = "", subtitle = "Scatterplot - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

ggplot(data = TEAM_FIELDING_DP_linear_model, aes(x = .resid)) +
geom_histogram() +
xlab("Residuals") +
labs(title = "", subtitle = "Histogram - Linear Model") +
theme(plot.title = element_text(hjust = 0.5, face = "bold")) +
theme(plot.subtitle = element_text(hjust = 0.5)) +
labs(caption = "")

Here are two sample images:

Your question pertains to the "selection of variables" problem in regression, for which there is a large statistical literature that is quite a lot to summarise. There are a few issues to consider here, so I will go through them slowly.

A preliminary note on training and testing: One of the difficulties that one encounters in conducting selection of variables is that many of the methods for doing this "optimise" over sets of available variables. One problem with this is that most testing methods constructed for regression analysis (e.g., T-tests, F-tests, etc.) assume that no optimisation of selected variables has occurred, which means that if you apply these tests then they will be biased towards showing relationships between the selected explanatory variables and the response variable.

In order to avoid this, you can use one of two general approaches. One approach is to use a model form like LASSO regression that has a built-in selection mechanism as part of the model. These types of models build in a selection mechanism by imposing a penalty for non-zero regression coefficients in the model. The subsequent tests for the model take account of this in-built selection mechanism and so they are not biased by it. Alternatively, one can use regular regression methods (that do not have in-built selection mechanisms) but split your data into a training set used to fit the models and perform selection of variables, and then a testing set used to formally test the relationship between the selected explanatory variables and the response variable.

In any case, whatever method you use, you will need to consider whether you are performing your selection of variables "within the model" and if not, you will need to consider using a separate training and testing phase, which generally involves some random partition of your data for this purpose.

Use one multiple regression, not lots of simple regressions: It is not useful in these cases to construct simple regression models for the individual variables. That approach ignores the colinearity between the explanatory variables, and it does not assist in understanding their contribution to the multiple regression model. The ultimate goal in regression analysis is to model the response as a function of all relevant explanatory variables, so you should be using a multiple regression model for this.

From what you have written, it appears that your goal in using the simple regression models was to construct a plot that will show the relationship between each explanatory variable and the response variable. Fortunately, this can be done in a multiple regression model by using added variable plots. This plot shows the relationship between these variables conditional on having removed the effect of all other explanatory variables in the model. Consequently, it shows you the conditional relationship of interest. (Note that the line-of-best-fit in the added variable plot uses the estimated slope coefficient from the multiple regression model, which is not true when you plot the marginal relationships using simplie regressions.)

You can construct added variable plots using the avPlots function in the car package in R. This function takes an input model and automatically prints all its added variable plots. It is also possible to extract the information for these plots and plot them using ggplot2 if you prefer the latter graphical system (see instructions here).

Some methods for selection of variables: There are a few broad methods still in use for selection of variables. The simplest method is to avoid it all together, using the "kitchen sink" approach where you fit a regression model will all the available variables in it. Under this approach you eschew the selection of variables analysis and just use all the explanatory variables that are plausible predictors a priori. If you do this then you may end up including some explanatory variables that are not related to the response variable. For models constructed for predictive analysis, the only real cost of this is loss of a few degrees-of-freedom, which is usually not a big problem. For models constructed for expalantory or causal reasons, this method can be problematic. Some analysts do not like this approach, but I think it is quite reasonable in many cases.

Another way to do selection of variables in your regression analysis is to use a model form with an in-built selection mechanism, such as LASSO regression. This is equivalent to a Bayesian analysis where you give a prior to your regression coefficients, with some non-zero probability that they are zero. Estimation in LASSO regression will estimate coefficients to be zero if there is sufficiently weak evidence of a relationship between the corresponding explanatory variable and the response variable. The model has an adjustable "penalty" function that allows you to set the appropriate bar for how much evidence you require for includion of a variable in the model.

Finally, another common way to do selection of variables is to use standard regression models (i.e., those without an in-built selection mechanism) and then select variables to include based on optimisation of some kind of "goodness-of-fit" statistic. Commonly used statistics for this purpose include the Akaike information criterion, the Bayesian information criterion or the adjusted coefficient of variation. If your model space is not too large (i.e., you do not have too many available explanatory variables) it is usually possible to search over all possible models. Since this involves model selection using optimisation over a large number of models, it is important to separate training of the model from formal testing of relationships in the selected model.

• Hi Ben, thanks for the thorough response here. The part about simple regressions ignoring the collinearity and therefore not being useful was especially to the point of my question. I'm wondering about a couple of other clarifying points. 1) You mention AIC as a goodness-of-fit statistic. When I look at the summary of a linear model in R, I see p-values listed for different independent variables. Would p-value here also be a goodness of fit statistic? Mar 1, 2021 at 7:32
• and 2) if I use a kitchen sink approach in deciding variables to include in the model or I go through different goodness-of-fit statistics or an a-priori thinking / eyeballing it -- is there a standard workflow method to show in an r markdown document "my thinking"? I could present "here's my multiple linear regression model" but how would I show "this is the best possible model based on permutations of independent variables" Mar 1, 2021 at 7:34

Someone else with more expertise may speak more clearly to this, but I thought I'd note a few considerations (not really hazarding an answer). I'm not sure how useful bivariable diagnostic plots are for determining whether to include a variable in a multivariable model. I'd be interested to hear opinions on that. But I do think that there are general limitations in being guided by bivariable relationships for choosing which variables to include in a larger model. Two key problems with this are:

1. Masked relationships. Predictors can have a relationship with the outcome which is not visible in a bivariable analysis. Say your 'team batting H' variable is weakly negatively correlated with the outcome, while number of stolen bases variable is weakly positively correlated with the outcome. Both of these relationships might appear weak when inspected in a plot, and thus you may choose to not include them in the multivariable model. If there is a positive correlation between these two predictors, however, those bivariable plots will underestimate the true effect of each predictor on the outcome. So by not including these predictors in the multivariable model, you have potentially missed two variables strongly related to the outcome.

2. Spurious associations. The inverse of (1). Predictors which appear to be strongly related to the outcome in bivariable plots, may in fact have little relationship with the outcome in the multivariable model.

p.s. if you're concerned about non-linearity, which is a reasonable expectation, why not include spline terms for your continuous predictors?

• Hi Lachlan, thanks for the note here. I see that if I analyze these bivariate relationships separately, I may totally miss the idea that these variable can be collinear, as I understand it, and there could be an interaction taking place. Based on both of your responses, I think I should only use diagnostic plots after creating a linear model to assess the model as a whole. Your suggestion about spline terms seems like a good one but I don't know much about them :/ Mar 1, 2021 at 9:19


text:
An Optimal Solution for the Muffin Problem

• Published in 2019
• Added on
In the collections
The muffin problem asks us to divide $m$ muffins into pieces and assign each of those pieces to one of $s$ students so that the sizes of the pieces assigned to each student total $m/s$, with the objective being to maximize the size of the smallest piece in the solution. We present a recursive algorithm for solving any muffin problem and demonstrate that it always produces an optimal solution.

Other information

key
AnOptimalSolutionfortheMuffinProblem
type
article
date_added
2020-08-17
date_published
2019-09-14

BibTeX entry

@article{AnOptimalSolutionfortheMuffinProblem,
key = {AnOptimalSolutionfortheMuffinProblem},
type = {article},
title = {An Optimal Solution for the Muffin Problem},
author = {Richard E. Chatwin},
abstract = {The muffin problem asks us to divide {\$}m{\$} muffins into pieces and assign each
of those pieces to one of {\$}s{\$} students so that the sizes of the pieces assigned
to each student total {\$}m/s{\$}, with the objective being to maximize the size of
the smallest piece in the solution. We present a recursive algorithm for
solving any muffin problem and demonstrate that it always produces an optimal
solution.},
comment = {},
date_added = {2020-08-17},
date_published = {2019-09-14},
urls = {http://arxiv.org/abs/1907.08726v2,http://arxiv.org/pdf/1907.08726v2},
collections = {attention-grabbing-titles,food,fun-maths-facts,protocols-and-strategies},
url = {http://arxiv.org/abs/1907.08726v2 http://arxiv.org/pdf/1907.08726v2},
year = 2019,
urldate = {2020-08-17},
archivePrefix = {arXiv},
eprint = {1907.08726},
primaryClass = {math.CO}
}

format: plain


text:
# Chapter 7. Statistical Estimation and Sampling Distributions

## Presentation on theme: "Chapter 7. Statistical Estimation and Sampling Distributions"— Presentation transcript:

Chapter 7. Statistical Estimation and Sampling Distributions
7.1 Point Estimates 7.2 Properties of Point Estimates 7.3 Sampling Distributions 7.4 Constructing Parameter Estimates 7.5 Supplementary Problems

7.1 Point Estimates 7.1.1 Parameters
In statistical inference, the term parameter is used to denote a quantity , say, that is a property of an unknown probability distribution. For example, the mean, variance, or a particular quantile of the probability distribution Parameters are unknown, and one of the goals of statistical inference is to estimate them.

Figure 7.1 The relationship between a point estimate and an unknown parameter θ

Figure 7.2 Estimation of the population mean by the sample mean

7.1.2 Statistics Statistics
In statistical inference, the term statistics is used to denote a quantity that is a property of a sample. Statistics are functions of a random sample. For example, the sample mean, sample variance, or a particular sample quantile. Statistics are random variables whose observed values can be calculated from a set of observed data.

7.1.3 Estimation Estimation
A procedure of “guessing” properties of the population from which data are collected. A point estimate of an unknown parameter is a statistic that represents a “guess” at the value of . Example 1 (Machine breakdowns) How to estimate P(machine breakdown due to operator misuse) ? Example 2 (Rolling mill scrap) How to estimate the mean and variance of the probability distribution of % scrap ( ) ?

7.2 Properties of Point Estimates 7.2.1. Unbiased Estimates (1/5)
Definitions - A point estimate for a parameter is said to be unbiased if - If a point estimate is not unbiased, then its bias is defined to be

7.2.1. Unbiased Estimates (2/5)
Point estimate of a success probability -

7.2.1. Unbiased Estimates(3/5)
Point estimate of a population mean -

7.2.1. Unbiased Estimates(4/5)
Point estimate of a population variance

7.2.1. Unbiased Estimates (5/5)

7.2.2. Minimum Variance Estimates (1/4)
Which is the better of two unbiased point estimates?

7.2.2. Minimum Variance Estimates (2/4)

7.2.2. Minimum Variance Estimates (3/4)
An unbiased point estimate whose variance is smaller than any other unbiased point estimate: minimum variance unbised estimate (MVUE) Relative efficiency Mean squared error (MSE) How is it decomposed ? Why is it useful ?

7.2.2. Minimum Variance Estimates (4/4)

Example: two independent measurements
Point estimates of the unknown C They are both unbiased estimates since The relative efficiency of to is Let us consider a new estimate Then, this estimate is unbiased since What is the optimal value of p that results in having the smallest possible mean square error (MSE)?

Let the variance of be given by
Differentiating with respect to p yields that The value of p that minimizes Therefore, in this example, The variance of

The relative efficiency of to is
In general, assuming that we have n independent and unbiased estimates having variance respectively for a parameter , we can set the unbiased estimator as The variance of this estimator is

Mean square error (MSE):
Let us consider a point estimate Then, the mean square error is defined by Moreover, notice that

7.3 Sampling Distribution 7.3.1 Sample Proportion (1/2)

7.3.1 Sample Proportion (2/2) Standard error of the sample mean

7.3.2 Sample Mean (1/3) Distribution of Sample Mean

7.3.2 Sample Mean (2/3) Standard error of the sample mean

7.3.2 Sample Mean (3/3)

7.3.3 Sample Variance (1/2) Distribution of Sample Variance

Theorem: if is a sample from a normal population having mean and variance , then are independent random variables, with being normal with mean and variance and being chi-square with n-1 degrees of freedom. (proof) Let Then, or equivalently, Dividing this equation by we get Cf. Let X and Y be independent chi-square random variables with m and n degrees of freedom respectively. Then, Z=X+Y is a chi-square random variable with m+n degrees of freedom.

In the previous equation,
Therefore,

7.3.3 Sample Variance (2/2) t-statistics

7.4 Constructing Parameter Estimates 7.4.1 The Method of Moments (1/3)
Method of moments point estimate for One Parameter

7.4.1 The Method of Moments (2/3)
Method of moments point estimates for Two Parameters

7.4.1 The Method of Moments (3/3)
Examples - What if the distribution is exponential with the parameter ?

7.4.2 Maximum Likelihood Estimates (1/4)
Maximum Likelihood Estimate for One Parameter

7.4.2 Maximum Likelihood Estimates (2/4)
Example -

7.4.2 Maximum Likelihood Estimates (3/4)
Maximum Likelihood Estimate for Two Parameters

7.4.2 Maximum Likelihood Estimates (4/4)
Example

7.4.3 Examples (1/6) Glass Sheet Flaws - The method of moment

7.4.3 Examples (2/6) The maximum likelihood estimate:

7.4.3 Examples (3/6) Example 26: Fish Tagging and Recapture

7.4.3 Examples (4/6)

7.4.3 Examples (5/6) Example 36: Bee Colonies

7.4.3 Examples (6/6)

MLE for For some distribution, the MLE may not be found by differentiation. You have to look at the curve of the likelihood function itself.


text:
<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />

# 1.30: Scientific Notation

Difficulty Level: At Grade Created by: CK-12
Estimated11 minsto complete
%
Progress
Practice Scientific Notation

MEMORY METER
This indicates how strong in your memory this concept is
Progress
Estimated11 minsto complete
%
Estimated11 minsto complete
%
MEMORY METER
This indicates how strong in your memory this concept is

Most of the stars pictured in this view of the night sky are hundreds of light years from Earth. A light year is the distance that light can travel in a year, or about 6 trillion (6,000,000,000,000) miles. As this example shows, quantities in science may be very large. Many other quantities in science are very small. Both very large and very small numbers have many zeroes, so they are hard to read and write without making mistakes. That’s where scientific notation comes in.

### What Is Scientific Notation?

Scientific notation is a way of writing very large or very small numbers that uses exponents. Numbers are written in this format:

\begin{align*} a \times 10^b\end{align*}

The letter a stands for a decimal number, and the letter b stands for an exponent, or power, of 10. For example, the number 300 is written in scientific notation as 3.0 × 102. The number 0.03 is written as 3.0 × 10-2. Do you need a review of exponents? If so, watch the video at this URL:

### Using Scientific Notation

It’s easier to convert numbers to and from scientific notation than you might think. Refer to the examples on the chalkboard below as you read the following steps. Follow the steps in the sequence listed here to convert a number to scientific notation. Follow the steps in the reverse order to convert a number from scientific notation.

1. Move the decimal point left or right until you reach the last nonzero digit. This new decimal number is a in a × 10b.
2. Count how many places you moved the decimal point in Step 1. This number is b in a × 10b.
3. Did you move the decimal point left (first example in the Figure below)? If so, b is positive. Did you move the decimal point right (second example in the Figure below)? If so, b is negative.

These two examples show how to convert large and small numbers to scientific notation.

Q: Apply the steps above to write 450,000 in scientific notation.

A: The unwritten decimal point in this number follows the last zero. Move the decimal point from this position to the left and stop just before the last digit, giving you 4.5 for a. The decimal point was moved five places to the left, so b is 5. In scientific notation the number is 4.5 × 105.

Q: Apply the steps in reverse order to write the number that is expressed as 7.2 × 104 in scientific notation.

A: Add zeroes to 7.2 as you move the decimal point four places to the right. This gives you the number 72,000.

### Summary

• Scientific notation is a way of writing very large or very small numbers that uses exponents. Numbers are written in the format a × 10b.
• Changing numbers to or from scientific notation is easy to do by following three simple steps.

### Vocabulary

• scientific notation: Way of writing very large or very small numbers that uses exponents in the format a × 10b.

### Practice

Go to this URL to practice converting numbers to and from scientific notation. Be sure to check your answers.

### Review

1. What is scientific notation? Why are numbers written in scientific notation?
2. Write 0.0045 in scientific notation.
3. What number is written as 6.0 × 106 in scientific notation?

### Notes/Highlights Having trouble? Report an issue.

Color Highlighted Text Notes

### Vocabulary Language: English

Scientific Notation

Scientific notation is a means of representing a number as a product of a number that is at least 1 but less than 10 and a power of 10.

order of magnitude

Formally, the order of magnitude is the exponent in scientific notation. Informally it refers to size. Two objects or numbers are of the same order of magnitude are relatively similar sizes.

Standard Form

As opposed to scientific notation, standard form means writing numbers in the usual way with all of the zeros accounted for in the value.

Show Hide Details
Description
Difficulty Level:
Authors:
Tags:
Subjects:


text:
## Cellular automaton model of bacterial biosensors

So this fortnight at the doctoral training centre, we've been from "Hello World" to image processing in C and Perl. Yeah.

Anyway, before my brain explodes from over-knowledge-ness, I thought I'd blog about the program I made! It's a cellular automaton (like Conway's Game of Life) that essentially represents lots of bacteria immobilised on a silicon chip. I based it on this paper from 2004. In my simulation, the cells grow, divide and die based on how much food they are getting from the environment.

The bacteria contain a special gene from fireflies called luciferase, which allows them to bioluminesce. Halfway through the simulation, the cells are bathed in a solution that causes DNA damage. This activates the luciferase gene. The idea behind the original experiment was to use bacteria to sense when a molecule causes DNA damage, in order to screen for molecules that might cause cancer.

The simulation outputs a rudimentary display to the terminal. The glowing bacteria are represented by the letter "O" and the wild-type bacteria are shown by the "#" symbol.

If you want to read more about the biological background and the implementation, you can read my report, or try compiling and running my C code.

This was a really good opportunity to test out all the things I learned about C this week! In addition, the write-up I handed in was written in LaTeX, which I am completely new to. I've uploaded my Tex files (report.tex and code.tex) and the bibliography file (cellularautomata.bib, which was created by Mendeley) if you want to have a look at them - it turns out that the trick with LaTeX is just to have a template file to build on.

I found a useful bit of LaTeX code to stitch two PDFs together (which you can download as a file):

\documentclass[11pt,a4paper]{article}

\usepackage{pdfpages}
\begin{document}

\includepdf[pages={1-5}]{writeup.pdf}
\includepdf[pages={1-7}]{code.pdf}

\end{document}

Pretty cool, huh? I've put all the LaTeX bits together in a .tar.gz file here. To extract and compile, run these commands in sequence:

tar -xzvf tex-files.tar.gz
pdflatex writeup.tex
bibtex writeup.aux
pdflatex writeup.tex
pdflatex writeup.tex
pdflatex code.tex
pdflatex stitch.tex

## Modifying a FLAME model

As I mentioned in my previous post about my adventures in FLAME modelling, I started out with code from my lecturer. I started with three two-dimensional models, each of which contained a different type (genus) of bacteria (Vibrio, Sar11 and "Bacteria X"). Each bacteria agent had X and Y co-ordinates, an ID and a radius. The radius was different for each type of bacteria, and it defined the rules that applied to that bacteria. They moved around by Brownian motion, and if they hit a virus there was a certain probability that they would be killed. The phages moved around in a similar fashion.

My code can be downloaded from here. In this post, I'm going to take you through how I converted these three models into a single model, added a third dimension, and persuaded the viruses and bacteria to replicate. This is a tale of how it's possible to do some quite cool things to a program even if you don't fully understand how it works.

If you're particularly interested, you can download a PDF of the report I handed in here. It starts with a brief review of a mathematical bacteriophage model, then goes on to the FLAME model in the second half (page 2). I got a mark of 95% for it, so I'm showing it off to everyone ^_^

## Running FLAME models at the Linux command line

Update: I've written another post about how I edited the model.

Last week, I modified a FLAME model to make it 3D and added some other features (with help from my John). This animation is of the model running, with me wiggling it around a bit to show the 3D-ness, and then leaving it be. There are explosions!

I think it's pretty cool. It represents a community of bacteria being attacked by viruses. These viruses - known as "bacteriophages" - could be really useful for treating infections, because they can kill bacteria which are resistant to traditional antibiotics.

In order to work out what dosage to use, and when to apply it, we need to know more about how bacteria and viruses interact with each other. This is difficult to study in real life, since viruses are so tiny - but by using computer models, we can make better approximations of how they behave.

The animation shows three types of bacteria, represented by green, blue and pink spheres. The orange dots are viruses. When a bacterium is infected by one of the viruses, it bursts, releasing lots of new viruses. Each virus and bacterium is an "agent" inside the model, and they each follow a particular set of rules, and carry pieces of information. I was using a piece of software called "FLAME" for this.

FLAME uses C and XML to make rules for the agents in a model. I found the documentation a bit obtuse, so I thought I'd make a blog post about exactly what I did, in case it was useful to anyone.

Initially, you need to install a set of programs - gcc, xparser, libmboard, and the FLAME visualiser. The installation instructions on the website are quite straight-forward, so I'll start my tutorial by talking about running a model.

Running a model in FLAME using the Linux command line

You can download my model code from here. It contains 4 files.

• 0.xml describes the starting state of all the agents in the model
• phageAndBacteriaV6.c contains all of the functions that the agents use
• phageAndBacteriaV6.xml describes all the agents, and the messages they send each other
• visual-rules.xml dictates how the model will be visualised

You start by using the xparser program on the xml file. I saved all my files in /home/beth/models/ so that is the location that I will use in my command line work - you should substitute it for your working folder. So: open up a terminal. Next, navigate to the directory where you have installed xparser and run

./xparser /home/beth/models/phageAndBacteriaV6.xml

This will create a load of files in home/beth/models. Navigate to /home/beth/models and run

 make

This creates the model programs, most importantly one called main. You can then run the model, giving the number of iterations you want (in this case, 100) and the location of the 0.xml file (in this case, ./0.xml)

./main 100 ./0.xml

This creates a load of xml files, numbered 1 to 100. Each one contains information about every single agent in the model at a particular time step. Now, these don't look very exciting in themselves, but this is where the flame visualiser comes in.

Navigate to where you've installed the visualiser and run

./flame_visualiser

A window should pop up. Go to "File" > "Open" and find visual-rules.xml. If you click on "Open Visual Window", you should now see lots of lovely spheres. It's a fairly straight-forward program to use - you can drag the picture around, start and stop the animation, go back and forward through the iterations, and zoom. If you have a tiny screen, you can grab and move the window by holding down Alt when you click & drag.

I made my animation by opening "Image Settings" and then setting the iteration to 0 and clicking "Start Animation." This saves a series of numbered images. You can rotate the picture while you're recording if you fancy. Then I opened up The GIMP, clicked "File" > "Open As Layers" and selected all 100 images. Then I saved the image as a .gif, selecting "Save As Animation".

So that's how to run an existing model, and make a pretty picture. In my next post, I talk about how to edit one.

Edit: I forgot to add, the visual-rules.xml document was generated by the flame visualiser. You need to give each type of bacteria a radius and a colour using the visualiser, and an xml document will be generated.


text:
# Cells in Series and Parallel

As we know the most frequently used method to connect electrical components is Series Connection and Parallel Connection. Since the cell is an important part of an electric circuit. To know more about Cells, Series Connection and parallel Connection explore the article!

## Cells

Cells generate electricity and also derives chemical reactions.  One or more electrochemical cells are batteries. Every cell has two terminals namely:

1. Anode: Anode is the terminal from where the current flows in from out i.e. it provides an incoming channel for the current to enter the circuit or the device.
2. Cathode: Cathode is the terminal from where the current flows out i.e. it provides an outgoing current flow from the circuit or the device.

There are two simplest ways for cell connectivity  are as follows:

1. Series Connection: Series connection is the connectivity of the components in a sequential array of components.
2. Parallel Connection: Parallel connection is the connectivity of the components alongside to other components.

## Cells in Series Connection

In series, cells are joined end to end so that the same current flows through each cell.  In case if the cells are connected in series the emf of the battery is connected to the sum of the emf of the individual cells. Suppose we have multiple cells and they are arranged in such a way that the positive terminal of one cell is connected to the negative terminal of the another and then again the negative terminal is connected to the positive terminal and so on, then we can that the cell is connected in series.

### Equivalent EMF/Resistance of Cells in Series

If E is the overall emf of the battery combined with n number cells and E1, E2, E, Eare the emfs of individual cells.

Then   E1 + E+  E+ …….E

Similarly, if r1, r2, r3, rn are the internal resistances of individual cells, then the internal resistance of the battery will be equal to the sum of the internal resistance of the individual cells i.e.

r = r+ r2+  r+  rn

## Cells in Parallel Connection

Cells are in parallel combination if the current is divided among various cells. In a parallel combination, all the positive terminal are connected together and all the negative terminal are connected together.

### Equivalent EMF/Resistance of Cells in Parallel

If emf of each cell is identical, then the emf of the battery combined with n numbers of cells connected in parallel is equal to the emf of each cell. The resultant internal resistance of the combination is,

r =  $$( \frac{1}{r_1}$$ + $$\frac{1}{r_2 }$$ +  $$\frac{1}{ r_3}$$ +……..  $$\frac{1}{r_n}$$ )-1

### Equivalent EMF/Resistance of Cells in Series and Parallel

Assume the emf of each cell is E and internal resistance of each cell is r. As n  numbers of cells are connected in each series, the emf of each series, as well as the battery, will be nE.  The equivalent resistance of the series is nr. As, m the number of series connected in parallel equivalent internal resistance of that series and parallel battery is nr/m.

## Solved Questions For You

Q. The internal resistance of a cell of emf 1.5 V, if it can deliver a maximum current of 3 A is,

1. 0.5 Ω
2. 4.5 Ω
3. 2 Ω
4. 1  Ω

Solution: A. For maximum amount, load resistance = 0

⇒ E = Ir

r = $$\frac{E}{I}$$

= $$\frac{1.5}{3}$$

= 0.5 Ω

Q.2 For a given cell, its terminal voltage depends on

1. External resistance, Internal Resistance
2. External resistance
3. Internal Resistance
4. None of these

Solution: A. Inside the cell, the energy is put into the circuit by the cell, but some of this energy is out by the internal resistor. So the potential difference available to the rest of the circuit is the emf minus the potential difference lost inside the cell.

Share with friends
Customize your course in 30 seconds

Which class are you in?

5th
6th
7th
8th
9th
10th
11th
12th
Get ready for all-new Live Classes!
Now learn Live with India's best teachers. Join courses with the best schedule and enjoy fun and interactive classes.
Ashhar Firdausi
IIT Roorkee
Biology
Dr. Nazma Shaik
VTU
Chemistry
Gaurav Tiwari
APJAKTU
Physics
Get Started

Watch lectures, practise questions and take tests on the go.
Customize your course in 30 seconds

Which class are you in?

No thanks.


text:
# Question #e2639

Sep 6, 2016

No, it is called dipole-dipole interaction, which is a weaker type of hydrogen bond.

#### Explanation:

Hydrogen bond occur only between hydrogen atoms and molecules possessing nitrogen, oxygen and fluorine.

Example,
H-bond between water molecules ${H}_{2} O$.

H-bond between ammonia molecules $N {H}_{3}$ and water molecules ${H}_{2} O$.

H-bond between hydrofluoric acid $H F$.

The interaction between hydrochloric acid molecules $H C l$ is called dipole-dipole interaction, which is a weaker type of hydrogen bond.

image source: http://johnsonapchem2015intervsintraforces.weebly.com


text:
Products for USB Sensing and Control
Products for USB Sensing and Control

#### sales inquiries

##### quotes, distributor information, purchase orders
sales@phidgets.com

#### technical inquiries

##### support, advice, warranty, returns, misshipment
support@phidgets.com

#### website inquiries

web@phidgets.com

##### Unit 1 - 6115 4 St SE Calgary AB  T2H 2H9 Canada
Projects Dealers Terms and Conditions Discontinued Products Phidget21 Documentation

#### PHIDGETS Inc.

Unit 1 - 6115 4 St SE
Calgary AB  T2H 2H9
+1 403 282-7335

## Thumbstick Phidget

ID: HIN1100_0
Recommended for new designs: This product (or a similar replacement with a compatible form, fit and function) is estimated to be available for ten years or more.

Make a custom controller for your project with this thumbstick. Two-axis with a center pushbutton, it plugs into a VINT port.

## $20.00 Quantity Available: 757 Qty Price 5$19.00
10 $18.00 25$16.00
50 $14.00 100$13.00
250 $12.00 500$11.00
1000 $10.00 The Thumbstick Phidget provides a familiar 2-axis thumbstick similar to those on a video game controller. The stick springs back to the neutral position when released. It can also be pressed down with a click, which will register in software and can be tied to a function in your software. This Phidget connects to your computer through a VINT Hub. #### Features: • Two-axis position - vertical and horizontal position can easily be converted to angles and magnitude • Button - The thumbstick also operates as a button, adding extra functionality to your program. #### VINT Hubs This Phidget is a smart device that must be controlled by a VINT Hub. For more information about VINT, have a look at the VINT Primer. You can use a Phidget Cable to simply and easily connect the two devices. Here's a list of all of the different VINT Hubs currently available: Product Board Part Number Price Number of VINT Ports Controlled By VINT Hub Phidget$30.00 6 USB (Mini-USB)
Wireless VINT Hub
$60.00 6 Local Network (Ethernet or Wi-Fi) PhidgetSBC4$120.00 6

#### Phidget Cables

Use a Phidget cable to connect this device to the hub. You can solder multiple cables together in order to make even longer Phidget cables, but you should be aware of the effects of having long wires in your system.

Product Physical Properties
Part Number Price Cable Length
Phidget Cable 60cm
$2.00 600 mm Phidget Cable 10cm$1.50 100 mm
Phidget Cable 350cm
$3.00 3.5 m Phidget Cable 120cm$2.25 1.2 m
Phidget Cable 180cm
$2.75 1.8 m Phidget Cable 30cm$1.75 300 mm
Phidget Cable 90cm
$2.00 900 mm Phidget Cable 150cm$2.50 1.5 m

## Part 1: Setup

### Select Device

Your Phidget must be connected to a device with a VINT port using a 3-wire Phidget cable.

## Step 1: Install Phidgets Library

Before you begin using your Phidgets, you will need to install the Phidget Library.

If you're unsure which one you should get, press ⊞ WIN + Pause/Break:

3a. Select Next

## Step 1: Install Phidgets Library

3b. Read the Licence Agreement. Select Next.

## Step 1: Install Phidgets Library

3c. Choose Installation Location. Select Next.

## Step 1: Install Phidgets Library

3d. Confirm Install

## Step 1: Install Phidgets Library

3e. Wait for Installation to complete. This should only take a few moments.

## Step 1: Install Phidgets Library

3f. Installation Complete. Close installation Window.

## Step 2: Connect Devices

● Connect USB Cable to your Windows Computer

● Connect VINT Device(s)

## Step 3: Verify Connection

1. Open the Phidgets Control Panel:

## Step 3: Verify Connection

2. If connected, your Phidgets will appear in the Phidget Control Panel.

## Done!

If you're able to see and interact with your devices in the Phidget Control Panel, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

For more help installing in Windows (e.g. manual install, using a VM, etc.), visit this page:

## Step 1: Install Phidgets Library

Before you begin using your Phidgets, you will need to install the Phidget Library.

## Step 1: Install Phidgets Library

3a. Select Continue

## Step 1: Install Phidgets Library

3c. Here, you have the option to select the installation location. Select Install to continue.

## Step 1: Install Phidgets Library

3e. Wait for Installation to complete. This should only take a few moments.

## Step 1: Install Phidgets Library

3f. You may see a message that the extension has been blocked. Select Open Security Preferences.

## Step 1: Install Phidgets Library

3g. Beside the message for Phidgets Inc, Click Allow.

## Step 1: Install Phidgets Library

3h. Installation Complete, Click Close.

## Step 1: Install Phidgets Library

3i. To delete the installer, click Move to Trash.

## Step 2: Connect Devices

● Connect USB Cable to your Mac

● Connect VINT Device(s)

## Step 3: Verify Connection

1. Open the Phidgets Control Panel:

## Step 3: Verify Connection

2. If connected, your Phidgets will appear in the Phidget Control Panel.

## Done!

If you're able to see and interact with your devices in the Phidget Control Panel, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

## Step 1: Install Phidgets Library

1. First, you need to install the libusb-1.0 development libraries. For example, in Debian based distributions:

apt-get install libusb-1.0-0-dev

You’ll also need a C compiler and builder, if you don’t already have one installed.

apt-get install gcc
apt-get install make

## Step 1: Install Phidgets Library

3. Use the following commands in the location you unpacked to install the library:

./configure
make
sudo make install

## Step 1: Install Phidgets Library

4. (Optional) You can also download and unpack the following optional packages:

phidget22networkserver - Phidget Network Server, which enables the use of Phidgets over your network

phidget22admin - Admin tool to track who is connected to your Phidgets when using the network server

libphidget22extra - Required for phidget22networkserver and phidget22admin

libphidget22java - The Java libraries for Phidget22

For installation instructions for these packages, see the README file included with each one.

## Step 2: Connect Devices

● Connect USB Cable to your Linux Computer

● Connect VINT Device(s)

## Step 3: Verify Connection

1. The easiest way to verify that your libraries are working properly is to compile and run an example program. Download and unpack this C example that will detect any Phidget:

## Step 3: Verify Connection

2. Next, open the terminal in the location where you unpacked the example. Compile and run using:

gcc HelloWorld.c -o HelloWorld -lphidget22
sudo ./HelloWorld

ou should receive a “Hello” line for each Phidget channel that is discovered:

I don’t see any Phidgets show up in the HelloWorld example

You need to run it with sudo in order to be able to access USB devices. In order to use Phidgets without sudo, you need to set your udev rules. See the Advanced Information page on the final slide of this guide for details.

## Done!

If you're able to see your devices in the Hello World example, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

## Step 1: Install Phidgets Library

Before you begin using your Phidgets, you will need to install the Phidget Library.

If you're unsure which one you should get, press ⊞ WIN + Pause/Break:

3a. Select Next

## Step 1: Install Phidgets Library

3b. Read the Licence Agreement. Select Next.

## Step 1: Install Phidgets Library

3c. Choose Installation Location. Select Next.

## Step 1: Install Phidgets Library

3d. Select Next to confirm install.

## Step 1: Install Phidgets Library

3e. Wait for Installation to complete. This should only take a few moments.

## Step 1: Install Phidgets Library

3f. Installation Complete. Close installation Window.

## Step 2: Connect Devices

● Connect Power Jack

● Connect VINT Device(s)

● Connect Ethernet to a Router or Switch (optional)

## Step 3: Verify Connection

Choose a setup method:

## Step 3: Connect Wireless

1. When you connect the power supply to the HUB5000, the red LED should turn on.

## Step 3: Connect Wireless

2. On your mobile device, go to the Wi-Fi settings and connect to the HUB5000:

## Step 3: Connect Wireless

4. Once your device is connected to the HUB5000’s WiFi signal:

Click on the WiFi network and find an option that says “Manage router” or “Visit homepage”.

Go to your internet browser and type 192.168.100.1 in the address bar.

## Step 3: Connect Wireless

5. Create a password for your HUB5000. You'll use it to access the Configure Page from now on.

## Step 3: Connect Wireless

6. Navigate to the network page. Change the Mode to Client.

## Step 3: Connect Wireless

7. Enter your Wifi Network details and click Save & Apply. It may take a few minutes for your Phidgets to appear in the Phidget Control Panel, which we’ll check in the next step.

## Step 4: Verify Connection

1. Open the Phidgets Control Panel:

## Step 4: Verify Connection

2. If connected, your Phidgets will appear in the Phidget Control Panel.

## Done!

If you're able to see and interact with your devices in the Phidget Control Panel, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

For more help installing in Windows (e.g. manual install, using a VM, etc.), visit this page:

## Step 3: Connect Wireless

1. When you connect the power supply to the HUB5000, the red LED should turn on.

## Step 3: Connect Wireless

3. Create a password for your HUB5000. You'll use this password to access the Configure Page from now on.

## Step 3: Connect Wireless

4. Navigate to the network page. Change the Mode to Client.

## Step 3: Connect Wireless

5. Enter your Wifi Network details to use your Hub wirelessly and click Save & Apply. You can then disconnect the ethernet cable.

It may take a few minutes for your Phidgets to appear in the Phidget Control Panel, which we’ll check in the next step.

## Step 4: Verify Connection

1. Open the Phidgets Control Panel:

## Step 4: Verify Connection

2. If connected, your Phidgets will appear in the Phidget Control Panel.

## Done!

If you're able to see and interact with your devices in the Phidget Control Panel, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

For more help installing in Windows (e.g. manual install, using a VM, etc.), visit this page:

## Step 1: Install Phidgets Library

Before you begin using your Phidgets, you will need to install the Phidget Library.

## Step 1: Install Phidgets Library

3a. Select Continue

## Step 1: Install Phidgets Library

3c. Here, you have the option to select the installation location. Select Install.

## Step 1: Install Phidgets Library

3e. Wait for Installation to complete. This should only take a few moments.

## Step 1: Install Phidgets Library

3f. You may see a message that the extension has been blocked. Select Open Security Preferences.

## Step 1: Install Phidgets Library

3g. Beside the message for Phidgets Inc, Click Allow.

## Step 1: Install Phidgets Library

3h. Installation Complete, Click Close.

## Step 1: Install Phidgets Library

3i. To delete the installer, click Move to Trash.

## Step 2: Connect Devices

● Connect Power Jack

● Connect VINT Device(s)

● Connect Ethernet to a Router or Switch (optional)

## Step 3: Verify Connection

Choose a setup method:

## Step 3: Connect Wireless

1. When you connect the power supply to the HUB5000, the red LED should turn on.

## Step 3: Connect Wireless

2. On your mobile device, go to the Wi-Fi settings and connect to the HUB5000:

## Step 3: Connect Wireless

4. Once your device is connected to the HUB5000’s WiFi signal:

Click on the WiFi network and find an option that says “Manage router” or “Visit homepage”.

Go to your internet browser and type 192.168.100.1 in the address bar.

## Step 3: Connect Wireless

5. Create a password for your HUB5000. You'll use this password to access the Configure Page from now on.

## Step 3: Connect Wireless

6. Navigate to the network page. Change the Mode to Client.

## Step 3: Connect Wireless

7. Enter your Wifi Network details and click Save & Apply. It may take a few minutes for your Phidgets to appear in the Phidget Control Panel, which we’ll check in the next step.

## Step 4: Verify Connection

1. Open the Phidget Control Panel:

## Step 4: Verify Connection

2. If connected, your Phidgets will appear in the Phidget Control Panel.

## Done!

If you're able to see and interact with your devices in the Phidget Control Panel, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

## Step 3: Connect Wireless

1. When you connect the power supply to the HUB5000, the red LED should turn on.

## Step 3: Connect Wireless

3. Create a password for your HUB5000. You'll use this password to access the Configure Page from now on.

## Step 3: Connect Wireless

4. Navigate to the network page. Change the Mode to Client.

## Step 3: Connect Wireless

5. Enter your Wifi Network details to use your Hub wirelessly and click Save & Apply. You can then disconnect the ethernet cable.

It may take a few minutes for your Phidgets to appear in the Phidget Control Panel, which we’ll check in the next step.

## Step 4: Verify Connection

1. Open the Phidget Control Panel:

## Step 4: Verify Connection

2. If connected, your Phidgets will appear in the Phidget Control Panel.

## Done!

If you're able to see and interact with your devices in the Phidget Control Panel, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

## Step 1: Install Phidgets Library

1. First, you need to install the libusb-1.0 development libraries. For example, in Debian based distributions:

apt-get install libusb-1.0-0-dev

You’ll also need a C compiler and builder, if you don’t already have one installed.

apt-get install gcc
apt-get install make

## Step 1: Install Phidgets Library

3. Use the following commands in the location you unpacked to install the library:

./configure
make
sudo make install

## Step 1: Install Phidgets Library

4. (Optional) You can also download and unpack the following optional packages:

phidget22networkserver - Phidget Network Server, which enables the use of Phidgets over your network

phidget22admin - Admin tool to track who is connected to your Phidgets when using the network server

libphidget22extra - Required for phidget22networkserver and phidget22admin

libphidget22java - The Java libraries for Phidget22

For installation instructions for these packages, see the README file included with each one.

## Step 2: Connect Devices

● Connect Power Jack

● Connect VINT Device(s)

● Connect Ethernet to a Router or Switch (optional)

## Step 3: Verify Connection

Choose a setup method:

## Step 3: Connect Wireless

1. When you connect the power supply to the HUB5000, the red LED should turn on.

## Step 3: Connect Wireless

2. On your mobile device, go to the Wi-Fi settings and connect to the HUB5000:

## Step 3: Connect Wireless

4. Once your device is connected to the HUB5000’s WiFi signal:

Click on the WiFi network and find an option that says “Manage router” or “Visit homepage”.

Go to your internet browser and type 192.168.100.1 in the address bar.

## Step 3: Connect Wireless

5. Create a password for your HUB5000. You'll use this password to access the Configure Page from now on.

## Step 3: Connect Wireless

6. Navigate to the network page. Change the Mode to Client.

## Step 3: Connect Wireless

7. Enter your Wifi Network details and click Save & Apply. It may take a few minutes for your Phidgets to appear in the Phidget Control Panel, which we’ll check in the next step.

## Step 4: Verify Connection

1. The easiest way to verify that your libraries are working properly is to compile and run an example program. Download and unpack this C example that will detect any Phidget:

## Step 3: Verify Connection

2. Next, open the terminal in the location where you unpacked the example. Compile and run using:

gcc HelloWorld.c -o HelloWorld -lphidget22
sudo ./HelloWorld

ou should receive a “Hello” line for each Phidget channel that is discovered:

I don’t see any Phidgets show up in the HelloWorld example

You need to run it with sudo in order to be able to access USB devices. In order to use Phidgets without sudo, you need to set your udev rules. See the Advanced Information page on the final slide of this guide for details.

## Done!

If you're able to see your devices in the Hello World example, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

## Step 3: Connect Wireless

1. When you connect the power supply to the HUB5000, the red LED should turn on.

## Step 3: Connect Wireless

3. Create a password for your HUB5000. You'll use this password to access the Configure Page from now on.

## Step 3: Connect Wireless

4. Navigate to the network page. Change the Mode to Client.

## Step 3: Connect Wireless

5. Enter your Wifi Network details to use your Hub wirelessly and click Save & Apply. You can then disconnect the ethernet cable.

It may take a few minutes for your Phidgets to appear in the Phidget Control Panel, which we’ll check in the next step.

## Step 4: Verify Connection

1. The easiest way to verify that your libraries are working properly is to compile and run an example program. Download and unpack this C example that will detect any Phidget:

## Step 3: Verify Connection

2. Next, open the terminal in the location where you unpacked the example. Compile and run using:

gcc HelloWorld.c -o HelloWorld -lphidget22
sudo ./HelloWorld

ou should receive a “Hello” line for each Phidget channel that is discovered:

I don’t see any Phidgets show up in the HelloWorld example

You need to run it with sudo in order to be able to access USB devices. In order to use Phidgets without sudo, you need to set your udev rules. See the Advanced Information page on the final slide of this guide for details.

## Done!

If you're able to see your devices in the Hello World example, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

## Step 1: Install Phidgets Library

Before you begin using your Phidgets, you will need to install the Phidget Library.

If you're unsure which one you should get, press ⊞ WIN + Pause/Break:

3a. Select Next.

## Step 1: Install Phidgets Library

3b. Read the Licence Agreement. Select Next.

## Step 1: Install Phidgets Library

3c. Choose Installation Location. Select Next.

3d. Select Next.

## Step 1: Install Phidgets Library

3e. Wait for Installation to complete. This should only take a few moments.

## Step 1: Install Phidgets Library

3f. Installation Complete. Close installation Window.

## Step 2: Connect Devices

● Connect Power Jack

● Connect VINT Device(s)

● Connect Ethernet to a Router or Switch in the same network as your Windows PC

## Step 3: Verify Connection

1. Open the Phidgets Control Panel:

## Step 3: Verify Connection

2. If connected, your Phidgets will appear in the Phidget Control Panel.

Now that the SBC's ethernet connection is verified, it can be connected to wifi.

If you don't have a USB wifi adapter or you're planning to stay on ethernet, you can scroll down to

## Step 4: Connect Wireless

2. Create a password for your SBC. You'll use this to access the configuration page from now on.

## Step 4: Connect Wireless

3. Navigate to Network -> Wireless. Select your Network, enter the wifi password and select Add This Network.

## Step 4: Connect Wireless

4. Scroll down to your saved networks, click on your network and select Join This Network.

## Step 4: Connect Wireless

5. It should now say connected in the status column.

You can now unplug the ethernet cable.

## Done!

If you're able to see and interact with your devices in the Phidget Control Panel, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

For more help installing in Windows (e.g. manual install, using a VM, etc.), visit this page:

## Step 1: Install Phidgets Library

Before you begin using your Phidgets, you will need to install the Phidget Library.

## Step 1: Install Phidgets Library

3a. Select Continue

## Step 1: Install Phidgets Library

3c. Here, you have the option to select the installation location. Select Install.

## Step 1: Install Phidgets Library

3e. Wait for Installation to complete. This should only take a few moments.

## Step 1: Install Phidgets Library

3f. You may see a message that the extension has been blocked. Select Open Security Preferences.

3g. Click Allow.

## Step 1: Install Phidgets Library

3h. Installation Complete, Click Close.

## Step 1: Install Phidgets Library

3i. To delete the installer, click Move to Trash.

## Step 2: Connect Devices

● Connect Power Jack

● Connect VINT Device(s)

● Connect Ethernet to a Router or Switch in the same network as your Mac

## Step 3: Verify Connection

1. Open the Phidget Control Panel:

## Step 3: Verify Connection

2. If connected, your Phidgets will appear in the Phidget Control Panel.

Now that the SBC's ethernet connection is verified, it can be connected to wifi.

If you don't have a USB wifi adapter or you're planning to stay on ethernet, you can scroll down to

## Step 4: Connect Wireless

2. Create a password for your SBC. You will use this to access the configuration page from now on.

## Step 4: Connect Wireless

3. Navigate to Network -> Wireless. Select your Network, enter the wifi password and select Add This Network.

## Step 4: Connect Wireless

4. Scroll down to your saved networks, click on your network and select Join This Network.

## Step 4: Connect Wireless

5. It should now say connected in the status column.

You can now unplug the ethernet cable.

## Done!

If you're able to see and interact with your devices in the Phidget Control Panel, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

## Step 1: Install Phidgets Library

1. First, you need to install the libusb-1.0 development libraries. For example, in Debian based distributions:

apt-get install libusb-1.0-0-dev

You’ll also need a C compiler and builder, if you don’t already have one installed.

apt-get install gcc
apt-get install make

## Step 1: Install Phidgets Library

3. Use the following commands in the location you unpacked to install the library:

./configure
make
sudo make install

## Step 1: Install Phidgets Library

4. (Optional) You can also download and unpack the following optional packages:

phidget22networkserver - Phidget Network Server, which enables the use of Phidgets over your network

phidget22admin - Admin tool to track who is connected to your Phidgets when using the network server

libphidget22extra - Required for phidget22networkserver and phidget22admin

libphidget22java - The Java libraries for Phidget22

For installation instructions for these packages, see the README file included with each one.

## Step 2: Connect Devices

● Connect Power Jack

● Connect VINT Device(s)

● Connect Ethernet to a Router or Switch in the same network as your Linux machine

## Step 3: Verify Connection

1. The easiest way to verify that your libraries are working properly is to compile and run an example program. Download and unpack this C example that will detect any Phidget:

## Step 3: Verify Connection

2. Next, open the terminal in the location where you unpacked the example. Compile and run using:

gcc HelloWorld.c -o HelloWorld -lphidget22
sudo ./HelloWorld

If everything is working, you should receive a “Hello” line for each Phidget channel that is discovered:

I don’t see any Phidgets show up in the HelloWorld example

You need to run it with sudo in order to be able to access USB devices. In order to use Phidgets without sudo, you need to set your udev rules. See the Advanced Information page on the final slide of this guide for details.

Now that the SBC's ethernet connection is verified, it can be connected to wifi.

If you don't have a USB wifi adapter or you're planning to stay on ethernet, you can scroll down to

## Step 4: Connect Wireless

If you're using a terminal-only Linux machine, use the browser on your phone instead.

(If you use a phone, you need to enter the IP address your router assigned to the SBC instead of phidgetsbc.local)

## Step 4: Connect Wireless

2. Create a password for your SBC. You will use this to access the configuration page from now on.

## Step 4: Connect Wireless

3. Navigate to Network -> Wireless. Select your Network, enter the wifi password and select Add This Network.

## Step 4: Connect Wireless

4. Scroll down to your saved networks, click on your network and select Join This Network.

## Step 4: Connect Wireless

5. It should now say connected in the status column.

You can now unplug the ethernet cable.

## Step 4: Connect Wireless

6. Run the HelloWorld example again to confirm that your Phidgets are accessible over wifi.

## Done!

If you're able to see your devices in the Hello World example, you're done with the Setup part of this guide.

Scroll down to Part 2: Using Your Phidget for the next step.

## Part 2: Using Your Phidget

The 2-axis Thumbstick Phidget tracks the horizontal and vertical position of the stick between -1 and 1. The stick will snap back to the center when released. The thumbstick can also be clicked down to activate a push-button, similar to a video game controller.

### Explore Your Phidget Channels Using The Control Panel

1. Open your Control Panel, and you will find the following channels:

2. Double click on a channel to open an example program.

Expand All
Joystick Axis: Reports the tilt of the joystick (Channel 0 for up/down and channel 1 for left/right)

In your Control Panel, double click on "Joystick Axis":

Joystick Button: Reports the state of the pushbutton

In your Control Panel, double click on "Joystick Button":

## Part 4: Advanced Topics and Troubleshooting

Expand All
How do I know what channel, serial number, or hub port to use in my program?

Before you open a Phidget channel in your program, you can set these properties to specify which channel to open. You can find this information through the Control Panel.

1. Open the Control Panel and double-click on the red map pin icon:

2. The Addressing Information window will open. Here you will find all the information you need to address your Phidget in your program.

See the Phidget22 API for your language to determine exact syntax for each property.

Setting the Change Trigger and Data Interval

The Change Trigger is the minimum change in the sensor data needed to trigger a new data event. The Data Interval is the time (in ms) between data events sent out from your Phidget. You can modify one or both of these values to achieve different data outputs. You can learn more about these two properties here.

MacOS users can upgrade device firmware by double-clicking the device row in the Phidget Control Panel.

Windows users can upgrade the firmware for this device using the Phidget Control Panel as shown below.

Firmware upgrades include important bug fixes and performance improvements, but there are some situations where you may want to revert to an old version of the firmware (for instance, when an application you're using is compiled using an older version of phidget22 that doesn't recognize the new firmware).

MacOS and Linux users can downgrade using the phidget22admin tool in the terminal (see included readme for instructions).

Windows users can downgrade directly from the Phidget Control Panel if they have driver version 1.9.20220112 or newer:

Firmware Version Numbering Schema

Phidgets device firmware is represented by a 3-digit number. For firmware patch notes, see the device history section on the Specifications tab on your device's product page.

• If the digit in the 'ones' spot changes, it means there have been bug fixes or optimizations. Sometimes these changes can drastically improve the performance of the device, so you should still upgrade whenever possible. These upgrades are backwards compatible, meaning you can still use this Phidget on a computer that has Phidget22 drivers from before this firmware upgrade was released.
• If the digit in the 'tens' spot changes, it means some features were added (e.g. new API commands or events). These upgrades are also backwards compatible, in the sense that computers running old Phidget22 drivers will still be able to use the device, but they will not be able to use any of the new features this version added.
• If the digit in the 'hundreds' spot changes, it means a major change has occurred (e.g. a complete rewrite of the firmware or moving to a new architecture). These changes are not backwards compatible, so if you try to use the upgraded board on a computer with old Phidget22 drivers, it will show up as unsupported in the Control Panel and any applications build using the old libraries won't recognize it either. Sometimes, when a Phidget has a new hardware revision (e.g. 1018_2 -> 1018_3), the firmware version's hundreds digit will change because entirely new firmware was needed (usually because a change in the processor). In this case, older hardware revisions won't be able to be upgraded to the higher version number and instead continue to get bug fixes within the same major revision.
Converting to Polar Coordinates

For some applications, you may want to convert the 2-axis data of the Thumbstick Phidget into an angle and magnitude. This can be helpful if you want to use it like a video game controller. You can use the following formulas:

${\displaystyle {\text{r}}={\sqrt {x^{2}+y^{2}}}}$
${\displaystyle \phi =atan2(x,y)}$

Where r is the magnitude, ϕ is the angle, and x and y are the two axis values. Atan2 is the 2-argument arctangent function, which you can find in most math libraries. For example, in C# you could use Math.Atan2(x,y). Depending on your language, ϕ may be in radians or degrees. Since x and y range from -1.0 to 1.0, the resulting r will range from -√2 to √2, so you may also want to modify the first formula like so:

${\displaystyle {\text{r}}={\frac {\sqrt {x^{2}+y^{2}}}{\sqrt {2}}}}$

This way, your r will range from 0 to 1, which is more intuitive than -√2 to √2.

#### Product Specifications

Sensor Properties
Controlled By VINT
VoltageRatio Input Resolution 0.0021
Electrical Properties
Current Consumption (Unconfigured) 20 μA
Current Consumption Max * 1 mA
Physical Properties
Operating Temperature Min -40 °C
Operating Temperature Max 85 °C
Customs Information
American HTS Import Code 8471.80.40.00
Country of Origin CN (China)

* - Current consumption varies depending on selected data interval. See the graph below for details.

#### Product History

Date Board Revision Device Version Comment
September 2017 0104Product Release
January 2018 0105Library bug fixes
October 2021 0106ChangeTrigger now functions independently for each axis

#### Code Samples

 Choose a Language Choose a Device Serial Number: ?

#### Example Options

				Make your selections to display sample code.

#### Code Samples

Language:

APIDetailLanguageOS

#### Software Objects

Channel NameAPIChannel
Thumbstick Axis VoltageRatioInput 0 - 1
Thumbstick Button DigitalInput 0

#### API

 Choose a Language C C# / VB.NET Java JavaScript Max/MSP Python Swift Phidget Manager Networking NetworkConnection USBConnection Logging Dictionary

Back Forward
Print this API

#### Have a look at our other thumbsticks:

Product Sensor Properties
Part Number Price Controlled By
Mini Joy Stick Sensor
$5.00 VoltageRatio Input, Digital Input (5V) Thumbstick Phidget$20.00 VINT


text:
# B Does my speedy spaceship (.999+C) have a temperature?

#### Suppaman

Summary
Assume we measure the temperature as the ship passes, what will it be?
I assume that as time is moving much slower on the ship and that may affect the frequency of heat radiation. I am not sure how to phrase the question because I do not want to assume any answers. I did ask Mr. Google but no results.

Related Special and General Relativity News on Phys.org

#### PeroK

Homework Helper
Gold Member
2018 Award
Summary: Assume we measure the temperature as the ship passes, what will it be?

I assume that as time is moving much slower on the ship and that may affect the frequency of heat radiation. I am not sure how to phrase the question because I do not want to assume any answers. I did ask Mr. Google but no results.
How do you define temperature?

How would you measure the temperature of a moving object?

#### Suppaman

Everything in the sky is moving and we can measure their temp so like that. And I asked if it had a temp, and you asked me two questions, please answer mine first.

#### PeroK

Homework Helper
Gold Member
2018 Award
Everything in the sky is moving ...
I'll need to think about that!

Homework Helper
Gold Member
2018 Award
Try this:

#### Ibix

I think it depends how you choose to define temperature, as PeroK's link suggests. Certainly one can define "rest temperature" which is invariant, and it makes sense to do so. Certainly you will measure the radiation from a moving object as red- or blue-shifted, which would let you define a "relativistic temperature".

I'd prefer to define temperature as invariant, and as far as I'm aware that's the modern approach to more or less everything. I don't know if there is a consensus in this case or not - my only text on relativistic thermodynamics is over eighty years old.

So ultimately, I think you need to answer PeroK's questions - how are you defining temperature and what method are you using to measure it. When you've answered both, the answer to your question will be obvious. Until you've answered both, the answer is "could be anything".

For stars in the sky, generally we're trying to compare like with like. So I expect that we measure the apparent blackbody curve, correct for the Doppler shift by looking at spectral lines, and thereby measure "rest temperature".

#### Suppaman

The ship obviously has a temp, it is moving and that will not change that temp. If I take a photo with my IR camera as it passes in front of the camera, neither coming or going, just in passing, what will my camera measure? Let us say that if the ship was stopped it would reg 1000 deg F and now it is moving and time is slower on the ship it would still be 1000 deg F based on the ship's sensors but what would I see?

#### PeroK

Homework Helper
Gold Member
2018 Award
The ship obviously has a temp, it is moving and that will not change that temp. If I take a photo with my IR camera as it passes in front of the camera, neither coming or going, just in passing, what will my camera measure? Let us say that if the ship was stopped it would reg 1000 deg F and now it is moving and time is slower on the ship it would still be 1000 deg F based on the ship's sensors but what would I see?
There's the transverse Doppler effect:

Note that IR radiation is a measure of the heat an object is radiating and not its temperature. Two objects heated to the same temperature do not necessarily radiate the same heat. Compare a well insulated house with a poorly insulated one.

Also, more important, if you have several observers, all moving with respect to each other and all measuring different temperatures of the ship, then you can see that the concept becomes physically less meaningful.

You would have to say: "the temperature of that object relative to me is ...". In the same way that you say "the velocity of that ship relative to me is ...".

As @Ibix has pointed out, temperature is something that we would like to define as invariant - i.e. an inherent quantity of the object itself. Not dependent on the relative velocity of an observer to the object.

#### Ibix

If I take a photo with my IR camera as it passes in front of the camera, neither coming or going, just in passing, what will my camera measure?
It'll show a blackbody spectrum (edit: assuming your ship is a blackbody - see next post), related to the blackbody spectrum you would measure at rest by the transverse Doppler shift. So you'd see a blackbody temperature reduced by a factor of $\gamma$ compared to the at-rest measure.

Whether you regard this measure as "the temperature of the spaceship", or whether you correct for the motion of the ship (recovering the at-rest measure) and call this the temperature of the ship, is up to you.

The measurements are a matter of fact. How you label them follows consensus opinion and, as I said, I don't know what the modern consensus is. I expect it is for using "temperature" to mean invariant (or rest) temperature. But I do not know.

Last edited:

#### Ibix

It's also worth looking at the photo in this post to see the issues with IR for temperature measurement, quite apart from any relativistic effects. It works for blackbodies - not so much for very non-black things.

Nonetheless, whatever IR spectrum you measure will be related to the at-rest IR spectrum by the transverse Doppler effect.

#### russ_watters

Mentor
Why is this even an Einsteinian relativity question? Temperature is not frame dependent in Galilean Relativity either. When you travel in a plane, you'd cook if it was.

#### russ_watters

Mentor
Note that IR radiation is a measure of the heat an object is radiating and not its temperature. Two objects heated to the same temperature do not necessarily radiate the same heat. Compare a well insulated house with a poorly insulated one.
That's oddly put. It should be obvious that IR is a surface temperature measurement and there are limitations associated with that, but that doesn't make the measurement inaccurate, it just makes it different from an internal measurement.

What can make the measurement itself inaccurate is emissivity differences between materials.

#### Suppaman

Thank you all. I think I was looking for how we would view the observable properties of the speedy ship. For example, suppose there was a place that had a very high emission of energy, gigawatt laser, some super high power emitter of some kind that if a physical was in its focus for a super short time it would totally destroy the item. Now our speedy ship passes through this area very quickly, but the time exposed is long enough to do damage. But time on our ship is slow and it is so slow there is not enough time experienced by the ship for the energy beam to do damage. In the physical universe, we can have physical objects that are experiencing slow time, I am looking for information on what the rules are for interacting with them. We know gravity and speed can slow time but we do not know what time really is.

#### Orodruin

Staff Emeritus
Homework Helper
Gold Member
2018 Award
Why is this even an Einsteinian relativity question? Temperature is not frame dependent in Galilean Relativity either. When you travel in a plane, you'd cook if it was.
Again, this depends. If you mean the rest temperature, sure. If you mean the temperature that you would associate with the spectrum radiated from the body that will be affected by the Doppler effect and correspondingly red or blue shifted.

#### Ibix

For example, suppose there was a place that had a very high emission of energy, gigawatt laser, some super high power emitter of some kind that if a physical was in its focus for a super short time it would totally destroy the item. Now our speedy ship passes through this area very quickly, but the time exposed is long enough to do damage. But time on our ship is slow and it is so slow there is not enough time experienced by the ship for the energy beam to do damage.
You contradict yourself here. Either damage was done or it was not. It may be that you don't understand one frame's explanation for why damage was done (I'd have to work through it myself, but I'd suspect Doppler and angular aberration). But if you simply assume there's a contradiction then you are choosing to be confused.

#### Suppaman

You, someone, asked why this was " an Einsteinian relativity question? " Would it be best to ask a question and enclose it in a higher level question asking what category the question should be asked in? Perhaps there is a category or topic that can be used to ask a question and the powers that be are expected to assign it to an appropriate category or topic? I do not want to waste anyone's time. I also would appreciate having my question reworded to make proper sense rather than being criticized for asking a less than best question. Some times a really good question may not yet have a proper or universally accepted answer.

#### jbriggs444

Homework Helper
We know gravity and speed can slow time
No they do not. They affect the way we associate time here measured against this reference frame with time there measured against that reference frame. But they do not "slow time". Time proceeds at one second per second regardless.

#### Suppaman

So there is no twin paradox?

#### jbriggs444

Homework Helper
So there is no twin paradox?
The twin paradox does not involve time slowing down. It involves the comparison of time over here with time over there. And it involves the fact that the elapsed time between events depends on the path taken.

#### Suppaman

One twin is obviously older than the other. How did that happen?

#### PeroK

Homework Helper
Gold Member
2018 Award
One twin is obviously older than the other. How did that happen?

In general, many people before they learn SR have a misapprehension that "speed makes time run slower". If they learn SR properly, they learn that this is a misapprehension. In fact, the first thing they learn is that all inertial motion is relative and that velocity-based time dilation is symmetric.

From your posts above and on previous threads, it's clear that you have never lost the misapprehension about motion and time. In fact, you seem quite subborn in resisting all attempts to explain this to you.

My honest advice is to take a step back, forget all you think you know about SR and to start learning it without any misapprehensions or false preconceptions about what it says. These are preventing you understanding SR and understnding the answers to your questions.

This question about motion and temperature is a case in point.

In particular: there is no physical difference between a spaceship at rest relative to the Earth and te same ship travelling at nearly the speed of light relative to the Earth. It's the same ship and there are no physical differences associated with relative motion. There cannot be as the Earth is likewise travelling at nearly the speed of light relative to the ship.

Last edited:

#### Suppaman

Bailey et al. (1977) measured the lifetime of positive and negative muons sent around a loop in the CERN Muon storage ring. This experiment confirmed both time dilation and the twin paradox, i.e. the hypothesis that clocks sent away and coming back to their initial position are slowed with respect to a resting clock.[27][28] Other measurements of the twin paradox involve gravitational time dilation as well. See for instance the Hafele–Keating experiment and repetitions.

#### Nugatory

Mentor
So there is no twin paradox?
It’s not a paradox, if that’s what you mean.
Time passes at the rate of one second per second for both the traveling twin and the stay at home twin.

Their clocks tick off different amounts of time between the separation and reunion events for the same reason that two cars driving along different routes between the same two points will generally record a different number of kilometers driven: the different routes have different lengths, not because anything funny is happening with their speedometers.

#### PeroK

Homework Helper
Gold Member
2018 Award
Bailey et al. (1977) measured the lifetime of positive and negative muons sent around a loop in the CERN Muon storage ring. This experiment confirmed both time dilation and the twin paradox, i.e. the hypothesis that clocks sent away and coming back to their initial position are slowed with respect to a resting clock.[27][28] Other measurements of the twin paradox involve gravitational time dilation as well. See for instance the Hafele–Keating experiment and repetitions.
There is no shortage of material which, through a general lack of precise language, can reinforce your misconceptions. This is not so much wrong as misleading, when taken out of context.

As a counter to this, you could try:

It's not motion that causes differential aging, but changing from one inertial frame to another and, more generally, the shape of the path through spacetime.

#### Nugatory

Mentor
Bailey et al. (1977) measured the lifetime of positive and negative muons sent around a loop in the CERN Muon storage ring. This experiment confirmed both time dilation and the twin paradox, i.e. the hypothesis that clocks sent away and coming back to their initial position are slowed with respect to a resting clock.[27][28] Other measurements of the twin paradox involve gravitational time dilation as well. See for instance the Hafele–Keating experiment and repetitions.
And careless wording like this is part of the reason that Wikipedia is not, in general, an acceptable source here. This description isn’t exactly wrong but without a great deal more context it is terribly misleading - and it’s misled you.

A decent textbook might say something similar (the English language is not a precision instrument) but will also cover the other concepts that are needed to understand what’s going on: events; the spacetime interval; the distinction between proper time and coordinate time; relativity of simultaneity; frames as conventions for assigning coordinates to events; and the distinction between invariants and coordinate/frame-dependent quantities.

Wikipedia, even when it’s right, won’t always do this. Some Wikipedia articles are good, some aren’t, and the only way of knowing which are which is to ask someone who is already familiar with the subject.

Last edited:

"Does my speedy spaceship (.999+C) have a temperature?"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving


text:
# Russian limit problem

Calculus Level 3

In the above image, use $$n \rightarrow \infty$$ instead of $$n \rightarrow 0$$.

Follow the directions indicated in the photo.

×


text:
## Another question about particular turing machines

I am reading (or better said - trying to read) Computational Complexity - A Modern Approach. I have both the draft, which circulates online and the book.

In the book and the draft, there is this claim about simulating multiple tape machines with single tape one. It seems to have different (but probably inconsequential) variations in the book and in the draft.

The draft:

For every $f: \{0,1\}^* \rightarrow \{0,1\}$, time-constructable $T: N \rightarrow N$ if f is computable in time T(n) by a Turing machine M, using k tapes (plus additional input and output tapes) then it is computable in time ${5kT(n)}^2$ by a Turing machine M' using only a single work tape (plus additional input and output tapes).

The book:

Define a single-tape Turing machine to be a TM that has only one read-write tape, that is used as input, work and output tape. For every $f: \{0,1\}^* \rightarrow \{0,1\}$, time-constructable $T: N \rightarrow N$ if f is computable in time T(n) by a Turing machine M, using k tapes, then it is computable in time ${5kT(n)}^2$ by a single-tape Turing machine M'.

The basic idea is that you can "compress" k tapes into one for the price of at most 5kT(n) increase of running time. The chosen approach for encoding the k tapes on one is to place the frist symbol of the each tape at the first k positions of the tape of M'. The second symbols get to the second k positions on the resulting tape and etc. For example:
tape1: >alpha
tape2: >beta
tape3: >gamma

becomes

>abgleaptmhama_a

The alphabet of the machine is extended twice and each symbol gets a "twin" which is used only if the emulated cursor of the emulated tape is on it.
So M' works by scanning the tape once forward to read all of the k symbols that are under the emulated cursors of the emulated tapes, then uses the transition function of M to discover what is to be written and in which direction is to be moved each of the k emulated cursors. The backward movement is used to write this information.
Since for T(n) steps the cursor of any tape of M can go at most to T(n)-th position, the cursor of M' can-t go much beyond kT(n)-th position of the tape of M'. Sweeping back and forth then must take at most 2kT(n) steps.

Why 5?

I've consulted a book by Papadimitriou, but the same problem there is addressed by using different encoding - all tapes are concatenated together. So there is need when an emulated cursor moves right to a blank position, all the following symbols must be shifted to the right. In my humble understanding this gives at most little more than 4kT(n) steps per one step of M, which makes 5kT(n) more plausible.

But the Turing machine described before doesn't seem to have such problem, nothing must be shifted when a cursor needs to move to the right over a blank. I can't see it, and because I'm dumb and lazy I don't want to sit there in Excel and make 100s of rows of Turing machine code. Can someone help me?


text:
# Derivative

The Derivative function (abbreviated derivative) assigns each $x$ to the corresponding differential quotient.
Calculating the derivative is called differentiating or deriving.

!

### Remmeber

The derivative $f'(x)$ assigns the slope of the parent function $f$ at any point $x$.

The advantage of the derivative lies within not having to calculate the differential quotient over and over. Instead, you have a function in which you insert the point with the searched slope.

## Higher derivatives

When differentiating the derivative, the derivative of the derivative function is called second derivative.
The derivative of the second derivative $f''$ is called third derivative etc.

i

### Hint

In general, the first three derivatives are normally written with dashes:
$f'(x)$, $f''(x)$ und $f'''(x)$

After the third derivative, the style is usually the following:
$f^{(4)}(x)$
$f^{(5)}(x)$
...

### Example

The function $f(x)$ and its first two derivatives:

Calculating the derivative at point $x=1$:
$f'(x)=2x$
$f'(1)=2\cdot1=2$