自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 Python学习笔记【2】

CSC1001 Lecture2 定义函数 def Fuction1(): print ('sss') def Fuction2(): return 'sss' 当直接用函数的时候两者相同,但是如果调用函数时,必须要有return,否则会出现问题 在定义函数时变量都是局部变量,可以与全局变量重名但无影响 如果要用全局变量,在def后一行加 global x % 得出的数字是浮点数 aa...

2020-04-17 01:54:45 280 1

原创 R语言学习笔记【8】线性回归

ERG Tutorial 3 Linear Model A = lm( medv ~ lstat + I(lstat^2), date = Boston)#对lstat和lstat^2进行线性回归 A = lm( medv ~ poly(lstat, 5), date = Boston)#对lstat,lstat^2……lstat^3进行线性回归 自定义函数 AAA = function(x,y...

2020-02-21 17:27:57 947

原创 Python学习笔记

CSC1001 Lecture2 ** 平方 % 取余数 x += 3 #等于x = x + 3 type() #检验数据类型 >>> divmod(57, 20) (2, 17) int(),float() #改变数值类型 input()函数返回 字符串类型 数据 eval()函数 把字符串转为数值,常用eval(input( )) list用[]来表示 >>&g...

2020-02-19 14:25:30 970

原创 R语言学习笔记【7】数据库管理

STA3050 Lec7笔记 选取 > d1[d1$age<25,] 分类以及排序 order() 返回向量排序 > order(d1$age) # order of age in d1 [1] 5 3 4 6 1 8 11 10 7 2 9 > d1[order(d1$age, d1$acc_no),] #age是第一关键词,acc_no是第二关键词 > ra...

2020-02-09 12:49:23 414

原创 R语言学习笔记【6】线性代数的计算

STA3050 Lec6笔记 R has built‐in function for transpose **t()**, matrix multiplication **%*%**, inner product **%*%** (x'x) and outer product **%o%** (xx') diag()函数#矩阵和向量之间转换 > x<-1:4 # create a ...

2020-02-07 14:21:19 1163

原创 R语言学习笔记【5】输入输出与其他编程问题

STA3050 Lec5笔记 定义一个函数 > "%+-%" <- function(x,s) { c(x-s,x+s) } > 3 %+-% 5 [1]-2 8 z<-outer(y,x,"+") # save the table to z, where z(i,j)=y(i)+x(j) 输出数字格式: > sprintf("%f", pi) # output...

2020-02-06 13:11:20 394

原创 R语言学习笔记【4】R语言中的编程

STA3050 Lec4笔记 1、创建函数 se<-function(x){ n<-length(x) # find the sample size return(sd(x)/sqrt(n)) } #这里的n是局部变量 创建函数的另一种写法 se<-function(x){sd(x)/sqrt(length(x))} 2、&和&&都代表and,但&a...

2020-01-31 14:14:30 475

原创 R语言学习笔记【3】数据可视化基础

STA3050 Lec3笔记 par(**mfrow=c(3,2)**) #实现一页多图的功能,一个图版三行两列。mfrow按行排序,mfcol按列排序。 hist(d$lnpd86,**freq=F**) #freq=F 直方图采用density freq=T直方图采用frequency lines(x,dnorm(x,mean(d$lnpd90),sd(d$lnpd90 )),**lty...

2020-01-30 13:40:03 994

原创 R语言学习笔记【2】随机抽样/正态分布等函数的使用

STA3050 Lec2笔记 > sample(c(-1,0,1),size=20, prob=c(0.25,0.5,0.25),replace=T) > w<-as.ts(w) # transform w into a time series object > plot(w,main="random walk") #制图 > abline(h=10) #绘线 &gt...

2020-01-28 21:28:51 3853

原创 R语言学习笔记【1】seq/rep/matrix/list/as.numeric/with/factor/is.na函数的使用

STA3050 Lec1笔记 seq rep matrix #在R中<-和=等价,但<-是全局赋值操作,=是局部赋值操作 seq(1, 21, by = 4) [1] 1 5 9 13 17 21 rep(3, 5) #重复3五次 [1] 3 3 3 3 3 rep(c(1, 4), c(2, 3)) #分别重复“1,4”二、三次 [1] 1 1 4 4 4 rep(1:5,...

2020-01-28 11:25:39 3384

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除