This user is a PhD student in the field of operations research at Berkeley. He usually contributes to the following general topics:
“ | → I don't wanna hear about what the rich are doing | ” |
— Today's
Motto of the Day
|
|
This is a Wikipedia
user page. This is not an encyclopedia article or the talk page for an encyclopedia article. If you find this page on any site other than Wikipedia, you are viewing a mirror site. Be aware that the page may be outdated and that the user whom this page is about may have no personal affiliation with any site other than Wikipedia. The original page is located at https://en.wikipedia.org/wiki/User:Faridani. |
At this moment, He is contributing to the following articles:
Social Network Analysis and Text Mining
Production and Logistics Sciences:
User Interfaces:
Entrepreneurship:
Other contributions:
People:
User boxes
Generalized Linear Models: logistic regression, Poisson regression, etc.
Use # for auto numbering, * for bullets
use <code></code> for Code Texts
. When you want the text and the link to be different use this [[Optimal_control_theory|control]]
control
{{Reflist|3}} Multicol {{colbegin|3}} {{lorem}} {{lorem}} {{colend}}
{{colbegin|3}} {{lorem}} {{lorem}} {{colend}}
<syntaxhighlight lang="python"> Time Visits 0.00 158 0.50 177 1.00 207 1.50 133 2.00 134 2.50 119 3.00 103 </syntaxhighlight>
For codes
Time Visits
0.00 158
0.50 177
1.00 207
1.50 133
2.00 134
2.50 119
3.00 103
This is the table I usually use:
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω Γ Δ Θ Λ Ξ Π Σ Φ Ψ Ω |
∫ ∑ ∏ √ − ± ∞ ≈ ∝ = ≡ ≠ ≤ ≥ × · ÷ ∂ ′ ″ ∇ ‰ ° ∴ Ø ø ∈ ∉ ∩ ∪ ⊂ ⊃ ⊆ ⊇ ¬ ∧ ∨ ∃ ∀ ⇒ ⇔ → ↔ ↑ ℵ - – — |
The R function for fitting a generalized linear model is glm(). A Poisson regression is done when a counting process is being observed.
glm( numData˜roadType+weekDay, family=poisson(link=log), data=roadData)
fits a model → Poisson(), where log() = . setting family=poisson.
The following code does the Poisson regression in R
X<-read.table("C:/poissonvisits.txt", header = TRUE)
names(X)
attach(X)
hourofday <- Time
foo <- split(Visits, hourofday)
foo <- sapply(foo, sum)
barplot(foo, space = 0, xlab = "hour of the day", ylab = "total count")
#Starting from here we do the GLM
w <- Time/24 * 2 * pi
out1 <- glm(Visits ~ I(sin(w)) + I(cos(w)), family = poisson)
summary(out1)
out2 <- update(out1, . ~ . + I(sin(2 * w)) + I(cos(2 * w)))
summary(out2)
out3 <- update(out2, . ~ . + I(sin(3 * w)) + I(cos(3 * w)))
summary(out3)
anova(out1, out2, out3, test = "Chisq")
plot(hourofday, Visits, xlab = "hour of the day")
curve(predict(out2, data.frame(w = x/24 * 2 * pi), type = "response"),add = TRUE)
where the file poissonvisits.txt
is defined as
Time Visits
0.00 158
0.50 177
1.00 207
1.50 133
2.00 134
2.50 119
3.00 103
For more information about glm()
in R
type ?glm